Skip to content

tidypredict (development version)

  • Added support for baguette::bagger() bagged tree ensembles fit with the "CART" or "C5.0" base model, including bag_tree() parsnip models fitted with the "rpart" or "C5.0" engine. Regression predictions average the individual trees, and classification predictions return the class with the largest average class probability. (#232)

  • tidypredict_fit() now supports C50::C5.0() models that split a discrete predictor into one branch per level. (#232)

  • tidypredict_fit() now uses a strict inequality (<) for the continuous splits of rpart::rpart() models, matching how rpart assigns values that are exactly equal to a cut point. (#232)

  • tidypredict_fit() now returns correct predictions for randomForest::randomForest() models that have been saved and reloaded with parse_model() and as_parsed_model(). Every split variable after the first leaf in a tree was named incorrectly, so the reloaded model split on the wrong columns. (#232)

  • tidypredict_fit() now returns correct predictions for Cubist::cubist() models whose predictor values fall exactly on a split threshold. Cubist compares split thresholds as 32-bit floats, so a disp of 95.1 was sent down the wrong branch when the comparison was made in R’s doubles. (#232)

  • tidypredict_test() now supports C50::C5.0() models, including boosted and rule-based ones. (#232)

  • tidypredict_interval() now honours its interval argument. It was hardcoded to 0.95, so tidypredict_interval(), tidypredict_to_column(add_interval = TRUE), and tidypredict_sql_interval() all returned a 95% interval regardless of what was asked for. (#232)

  • tidypredict_interval() now reports an unsupported model class with a message naming the class, rather than R’s default “no applicable method” error. (#232)

  • tidypredict_to_column() now explains that a model returning more than one formula is unsupported, instead of incorrectly claiming that tree based models are unsupported. (#232)

  • tidypredict_fit() now reports an unsupported model class with a message naming the class, rather than R’s default “no applicable method” error. (#232)

  • tidypredict_fit() now keeps small probabilities for models with a logit link, such as glm() with family = binomial and LiblineaR::LiblineaR(). The inverse link was written in a form that rounded to exactly 0 once the linear predictor fell below about -37. (#232)

  • Added support for dbarts::bart() Bayesian additive regression trees, including bart() parsnip models fitted with the "dbarts" engine. The model has to be fit with keeptrees = TRUE, and only continuous outcomes are supported since binary outcomes are fit with a probit link. (#232)

  • Added support for klaR::NaiveBayes() naive Bayes models with Gaussian densities (usekernel = FALSE), including naive_Bayes() parsnip models fitted with the "klaR" engine. tidypredict_fit() returns a named list of class-probability expressions (softmax of the summed log densities), and tidypredict_test() is not supported for these multiclass models. (#232)

  • Added support for naivebayes::naive_bayes() naive Bayes models fit without kernel density estimates (usekernel = FALSE), including Gaussian, categorical, Bernoulli, and Poisson conditional distributions, and naive_Bayes() parsnip models fitted with the "naivebayes" engine. tidypredict_fit() returns a named list of class-probability expressions, and tidypredict_test() is not supported for these multiclass models. (#232)

  • Added support for parsnip::nullmodel() models, including null_model() parsnip models fitted with the "parsnip" engine. Regression models return the outcome mean as a single expression, and classification models return a named list of constant class-probability expressions, for which tidypredict_test() is not supported. (#232)

  • Added support for the partial least squares models in mixOmics (pls(), spls(), plsda(), and splsda()), including pls() parsnip models fitted with the "mixOmics" engine, for regression and classification. Single-outcome regression models return one expression, multivariate outcomes return a named list of expressions, and the discriminant variants return a named list of class-probability expressions (softmax), for which tidypredict_test() is not supported. (#232)

  • Added support for multinomial glmnet::glmnet() models (family = "multinomial"), including multinom_reg() parsnip models fitted with the "glmnet" engine. tidypredict_fit() returns a named list of class-probability expressions (softmax), and tidypredict_test() is not supported for these multiclass models. (#198)

  • Added support for nnet::multinom() multinomial log-linear models, including multinom_reg() parsnip models fitted with the "nnet" engine. tidypredict_fit() returns a named list of class-probability expressions (softmax), and tidypredict_test() is not supported for these multiclass models. (#232)

  • Added support for nnet::nnet() single hidden layer neural networks, including mlp() parsnip models fitted with the "nnet" engine, for regression and classification. Regression models return a single expression, and classification models return a named list of class-probability expressions, for which tidypredict_test() is not supported. (#232)

  • Added support for sda::sda() shrinkage discriminant analysis models, including discrim_linear() parsnip models fitted with the "sda" engine. tidypredict_fit() returns a named list of class-probability expressions (softmax), and tidypredict_test() is not supported for these multiclass models. (#232)

  • Added support for the regularized linear discriminant analysis models in sparsediscrim (lda_diag(), lda_shrink_mean(), lda_shrink_cov(), and lda_emp_bayes_eigen()), including discrim_linear() parsnip models fitted with the "sparsediscrim" engine. tidypredict_fit() returns a named list of class-probability expressions (softmax of the per-class discriminant scores), and tidypredict_test() is not supported for these multiclass models. (#232)

  • Added support for mda::fda() flexible discriminant analysis models fit with a linear regression method (mda::polyreg() with degree = 1 or mda::gen.ridge()), including discrim_linear() parsnip models fitted with the "mda" engine. tidypredict_fit() returns a named list of class-probability expressions (softmax of the per-class discriminant scores), and tidypredict_test() is not supported for these multiclass models. (#232)

  • Added support for MASS::lda() linear discriminant analysis models, including discrim_linear() parsnip models fitted with the "MASS" engine. tidypredict_fit() returns a named list of class-probability expressions (softmax of the per-class discriminant scores), and tidypredict_test() is not supported for these multiclass models. (#232)

  • Added support for MASS::qda() quadratic discriminant analysis models, including discrim_quad() parsnip models fitted with the "MASS" engine. tidypredict_fit() returns a named list of class-probability expressions (softmax of the per-class quadratic discriminant scores), and tidypredict_test() is not supported for these multiclass models. (#232)

  • Added support for kernlab::ksvm() linear support vector machine models (vanilladot kernel), including svm_linear() parsnip models fitted with the "kernlab" engine, for regression and binary classification. Non-linear kernels and multiclass classification are not supported, and classification requires a probability model (prob.model = TRUE). (#232)

  • Added support for H2O gradient boosting models (H2ORegressionModel, H2OBinomialModel, and H2OMultinomialModel), including boost_tree() parsnip models fitted with the "h2o_gbm" engine, for regression and classification. Only GBM models are supported (not H2O’s XGBoost), predictions require a running H2O cluster, and gaussian, bernoulli, and multinomial distributions are supported. (#232)

  • Added support for H2O RuleFit models (h2o::h2o.rulefit()), including rule_fit() parsnip models fitted with the "h2o" engine, for regression and binary classification. Predictions require a running H2O cluster, and multiclass models are not supported because h2o.rule_importance() does not expose the per-class coefficients. (#232)

  • Added support for mboost::blackboost() gradient boosting regression models, including boost_tree() parsnip models fitted with the "mboost" engine. Only the Gaussian() family is supported. (#232)

  • Added support for aorsf::orsf() oblique random forest regression models, including rand_forest() parsnip models fitted with the "aorsf" engine. Only numeric predictors are supported and classification is not supported. (#232)

  • Added support for C50::C5.0() classification tree models, including decision_tree() and boost_tree() parsnip models fitted with the "C5.0" engine. Boosted models (trials > 1) combine trials by confidence-weighted voting. Fuzzy thresholds (fuzzyThreshold = TRUE) and cost matrices (costs) are not supported. (#232)

  • Added support for rule-based C50::C5.0() classification models (rules = TRUE), including C5_rules() parsnip models fitted with the "C5.0" engine. Boosted rule-based models (trials > 1) are not supported. (#232)

  • Added support for partykit::cforest() random forest regression models, including rand_forest() parsnip models fitted with the "partykit" engine. Classification is not supported. (#232)

  • Added support for LiblineaR::LiblineaR() binary logistic regression models (type 0, 6, 7), including logistic_reg() parsnip models fitted with the "LiblineaR" engine. Also added support for linear support vector machine models, including svm_linear() parsnip models fitted with the "LiblineaR" engine, for regression (type 11, 12, 13) and binary classification (type 1-5). Classification returns the SVM decision value rather than a probability. (#232)

  • Added support for xrf::xrf() rule-based models (RuleFit), including rule_fit() parsnip models fitted with the "xrf" engine, for regression (family = "gaussian") and binary classification (family = "binomial"). Multinomial models are not supported. (#232)

  • Added support for decision_tree() parsnip models fitted with the "rpart" engine. (#232)

  • Added support for linear_reg() parsnip models fitted with the "glm" engine. (#232)

  • Added support for quantreg::rq() quantile regression models, including linear_reg() parsnip models fitted with the "quantreg" engine. Models fitted with multiple quantiles return one fit expression per quantile, named by the quantile level. (#232)

  • tidypredict_fit() now returns correct predictions for xgboost models whose feature values fall exactly on a split threshold. xgboost compares split thresholds as 32-bit floats, so a value such as a wt of 3.19 was sent down the wrong branch when the comparison was made in R’s doubles. (#232)

  • tidypredict_fit() now returns correct predictions for xgboost models that have been saved and reloaded with parse_model() and as_parsed_model(). Previously every tree collapsed to a single leaf value. (#232)

  • tidypredict_test() now flags rows where the fitted value is above the model’s own prediction for xgboost models. Previously only differences in one direction were reported, so real disagreements could go unnoticed. (#232)

  • tidypredict_test() now reports the maximum fit, lower, and upper differences under the correct labels, and reports absolute rather than signed differences. Previously the fit and upper values were swapped, and the fit value was omitted entirely when include_intervals = FALSE. (#232)

  • tidypredict_test() now reports a failure message for multiclass CatBoost models when results exceed the threshold. Previously it always claimed that all results were within the threshold, even when alert was TRUE. (#232)

  • tidypredict_test() now compares ranger models against predict(). Previously the comparison silently measured tidypredict’s predictions against themselves and so always reported a difference of zero. (#232)

  • tidypredict_test() now reports an absolute maximum difference for glmnet models, which could previously be negative. (#232)

  • tidypredict_test() now names the model’s own predictions fit in raw_results for XGBoost, LightGBM, CatBoost and h2o models, matching every other model type. The column was previously called base. (#232)

  • tidypredict_test() now reports fit_diff as a signed difference for LightGBM, CatBoost and h2o models, so the direction of the error is visible. The threshold is applied to its absolute value, as before. (#232)

  • tidypredict_test() results for classification models are now reported consistently: fit_diff is a 0/1 indicator, the threshold is reported as 0 since labels are compared exactly, and the message counts records that do not match rather than quoting a maximum difference. (#232)

tidypredict 1.1.0

CRAN release: 2026-02-27

New Model Supports

  • Added support for rpart decision tree models (rpart). (#226)

  • Added support for CatBoost models (catboost.Model). (#179, #187, #188)

    • Objectives: RMSE, MAE, Quantile, MAPE, Poisson, Huber, LogCosh, Expectile, Tweedie, Logloss, CrossEntropy, MultiClass, and MultiClassOneVsAll.
    • Tree types: oblivious (default SymmetricTree) and non-oblivious (Depthwise or Lossguide grow policy).
    • Categorical features are handled automatically for parsnip/bonsai models; for raw CatBoost models use set_catboost_categories().
  • Added support for LightGBM models (lgb.Booster). (#177, #186)

    • Objectives: regression, binary classification, and multiclass classification.
    • Supports categorical features.
    • Supports linear trees (linear_tree = TRUE), which fit a linear model at each leaf instead of a constant.

Improvements

  • Tree models (rpart, partykit, ranger, randomForest, xgboost, lightgbm, catboost) now generate nested case_when() expressions that mirror the tree structure, instead of flat expressions with all leaf conditions at the same level. This produces more efficient SQL and R code because conditions are evaluated hierarchically. (#227)

  • parse_model() now documents the parsed model version system (v1/v2/v3) and model type classes in its help page. (#227)

  • earth() models now support additional GLM families and link functions: Gamma, inverse.gaussian, probit, and cloglog. (#194, #195)

  • glm() models now support additional families and link functions: Gamma family with inverse link, inverse.gaussian family with 1/mu^2 link, probit link, cloglog link, and sqrt link. (#203, #204, #205, #206, #207)

  • glmnet() models now support Gamma family and Cox proportional hazards (family = "cox") models. (#200, #201)

  • xgboost support now includes additional objectives: binary:hinge, reg:absoluteerror, reg:gamma, reg:pseudohubererror, and reg:squaredlogerror. (#184)

  • Added a vignette on floating-point precision issues with tree-based models. (#231)

Bug Fixes

  • tidypredict_fit() now correctly handles xgboost models with stump trees (single leaf, no splits). (#182)

  • tidypredict_fit() now correctly handles xgboost DART booster models with rate_drop > 0. DART uses tree weight normalization during training, and these weights are now properly applied to each tree’s predictions. (#183)

  • tidypredict_fit() now correctly incorporates base_score for xgboost models with count:poisson and reg:tweedie objectives. Previously, predictions were incorrect when base_score was not the default value. (#184)

  • tidypredict_fit() now correctly averages tree predictions for LightGBM models with boosting="rf" instead of summing them. (#185)

  • tidypredict_fit() now uses the correct split operator (<= instead of <) for ranger models. Previously, predictions were incorrect when data values exactly matched split values. (#189)

  • tidypredict_fit() now correctly averages tree predictions for ranger models instead of summing them. Previously, predictions were num.trees times too large. (#190)

  • tidypredict_fit() now throws a clear error for ranger and randomForest classification models, which are not supported. (#191, #193)

  • tidypredict_fit() now uses the correct split operator (<= instead of <) for randomForest models. (#192)

  • tidypredict_fit() now correctly handles partykit stump trees (models with no splits). (#196)

  • tidypredict_fit() now works with glmnet() models that use family function syntax (e.g., family = gaussian()) instead of string syntax (e.g., family = "gaussian"). (#197)

  • tidypredict_fit() now works with models that use family function syntax (e.g., family = gaussian()) instead of string syntax (e.g., family = "gaussian"). (#202)

tidypredict 1.0.1

CRAN release: 2025-12-13

Bug Fixes

  • Fixed bug where base_score wasn’t extracted correctly xgboost for version 3 or higher. (#173)

tidypredict 1.0.0

CRAN release: 2025-11-29

Breaking Changes

  • Random forest implementations (ranger and randomForest) will now produce a single formula instead of a list of expressions. (#84)

New Model Supports

  • Added support for glmnet models. (#165)

Improvements

  • xgboost models with objectives "reg:tweedie" and "count:poisson" are now supported. (#72, @SimonCoulombe)

  • tree based models now uses .default argument in produced case_when() code when applicable. (#153)

  • Speed up tidypredict_fit() for partykit and ranger packages. (#125)

  • Speed up tidypredict_fit() for xgboost models. (#130)

  • randomForest models now support regression outcomes. (#77)

  • An informative error will now be thrown if a lm model cannot be processed due to having linear combinations of predictors. (#124)

  • linear models such as lm() and glm() now work with interactions created with * and :. (#74)

  • Cubist rules will return simplified rules whenever possible to avoid multiplying by 0 and 1. (#152)

  • Make work with xgboost version > 2.0.0.0. (#169)

Bug Fixes

  • Fixed a bug where the intercept was added incorrectly to the result for cubist models. (#58)

  • Fixed bug where tidypredict would error on Cubist models without conditions. (#127)

  • Fixed bug where Cubst models incorrectly combined rules and committees. (#134)

tidypredict 0.5.1

CRAN release: 2024-12-19

  • Exported a number of internal functions to be used in {orbital} package

tidypredict 0.5

CRAN release: 2023-01-18

  • Changes maintainer to Edgar Ruiz

  • Updates author’s email addresses.

  • Removes dependency with stringr

  • Fixes issue with earth parsed_models (#108)

  • Addresses issues with XGBoost models

  • Improvements to XGBoosts tests

tidypredict 0.4.9

CRAN release: 2022-05-25

  • Fixes issue handling GLM Binomial earth models (#97)

  • Adds capability to handle single simple Cubist models (#57)

  • Fixed parenthesis issue in the creation of the interval formula (#76)

  • Fixed bug in SQL query generation for XGBoost models with objective binary:logistic.

  • Re-licensed package from GPL-3 to MIT. See consent from copyright holders here.

tidypredict 0.4.8

CRAN release: 2020-10-28

  • CRAN submission for a broken test case.

tidypredict 0.4.7

CRAN release: 2020-10-05

  • Change to with with version 5.1.2 and above of the earth package. As a result, tidypredict will only parse objects created by this and later versions of earth.

tidypredict 0.4.6

CRAN release: 2020-07-23

  • Small release for xgboost changes.

tidypredict 0.4.5

CRAN release: 2020-02-10

  • Switches maintainer to Max Kuhn

tidypredict 0.4.3

CRAN release: 2019-09-03

  • Adds support for categorical predictors in partykit

  • Fixes parsnip tests to meet standards of new CRAN version

tidypredict 0.4.2

CRAN release: 2019-07-15

  • Simplifies tests that verify ranger

  • Adds fit method for parsed xgboost models

  • Sets conditional requirement for xgboost, for test and vignette

tidypredict 0.4.0

CRAN release: 2019-07-12

New features

  • Parses ranger classification models.

  • Adds method support for broom’s tidy() function. Regression models only

  • Adds as_parsed_model() function. It adds the proper class components to the list.

  • Adds initial support for partykit’s ctree() model

  • Adds support for parsnip fitted models: lm, randomForest, ranger, and earth

  • Adds support for xgb.Booster models provided by the xgboost package (@Athospd, #43)

  • Adds support for Cubist::cubist() models (# 36)

tidypredict 0.3.0

CRAN release: 2019-01-10

New features

  • Adds support for MARS models provided by the earth package

Improvements

  • New parsed models are now list objects as opposed to data frames.

  • tidypredict_to_column() no longer supports ranger and randomForest because of the multiple queries generated by multiple trees.

  • All functions that read the parsed models and create the tidy eval formula now use the list object.

  • Most of the code that depends on dplyr programming has been removed.

  • Removes dependencies on: tidyr, tibble

  • The x/y interface for earth models can now be used.

Bug Fixes

  • It now returns all of the trees instead of just one for tree based models (randomForest & ranger) (#29)

tidypredict 0.2.1

CRAN release: 2018-12-20

Bug Fixes

  • tibble 2.0.0 compatibility fix (@krlmlr)

tidypredict 0.2.0

CRAN release: 2018-02-25

New features

Bug fixes