tidypredict (development version)
Added support for
baguette::bagger()bagged tree ensembles fit with the"CART"or"C5.0"base model, includingbag_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 supportsC50::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 ofrpart::rpart()models, matching howrpartassigns values that are exactly equal to a cut point. (#232)tidypredict_fit()now returns correct predictions forrandomForest::randomForest()models that have been saved and reloaded withparse_model()andas_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 forCubist::cubist()models whose predictor values fall exactly on a split threshold. Cubist compares split thresholds as 32-bit floats, so adispof 95.1 was sent down the wrong branch when the comparison was made in R’s doubles. (#232)tidypredict_test()now supportsC50::C5.0()models, including boosted and rule-based ones. (#232)tidypredict_interval()now honours itsintervalargument. It was hardcoded to 0.95, sotidypredict_interval(),tidypredict_to_column(add_interval = TRUE), andtidypredict_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 asglm()withfamily = binomialandLiblineaR::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, includingbart()parsnip models fitted with the"dbarts"engine. The model has to be fit withkeeptrees = 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), includingnaive_Bayes()parsnip models fitted with the"klaR"engine.tidypredict_fit()returns a named list of class-probability expressions (softmax of the summed log densities), andtidypredict_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, andnaive_Bayes()parsnip models fitted with the"naivebayes"engine.tidypredict_fit()returns a named list of class-probability expressions, andtidypredict_test()is not supported for these multiclass models. (#232)Added support for
parsnip::nullmodel()models, includingnull_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 whichtidypredict_test()is not supported. (#232)Added support for the partial least squares models in
mixOmics(pls(),spls(),plsda(), andsplsda()), includingpls()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 whichtidypredict_test()is not supported. (#232)Added support for multinomial
glmnet::glmnet()models (family = "multinomial"), includingmultinom_reg()parsnip models fitted with the"glmnet"engine.tidypredict_fit()returns a named list of class-probability expressions (softmax), andtidypredict_test()is not supported for these multiclass models. (#198)Added support for
nnet::multinom()multinomial log-linear models, includingmultinom_reg()parsnip models fitted with the"nnet"engine.tidypredict_fit()returns a named list of class-probability expressions (softmax), andtidypredict_test()is not supported for these multiclass models. (#232)Added support for
nnet::nnet()single hidden layer neural networks, includingmlp()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 whichtidypredict_test()is not supported. (#232)Added support for
sda::sda()shrinkage discriminant analysis models, includingdiscrim_linear()parsnip models fitted with the"sda"engine.tidypredict_fit()returns a named list of class-probability expressions (softmax), andtidypredict_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(), andlda_emp_bayes_eigen()), includingdiscrim_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), andtidypredict_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()withdegree = 1ormda::gen.ridge()), includingdiscrim_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), andtidypredict_test()is not supported for these multiclass models. (#232)Added support for
MASS::lda()linear discriminant analysis models, includingdiscrim_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), andtidypredict_test()is not supported for these multiclass models. (#232)Added support for
MASS::qda()quadratic discriminant analysis models, includingdiscrim_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), andtidypredict_test()is not supported for these multiclass models. (#232)Added support for
kernlab::ksvm()linear support vector machine models (vanilladotkernel), includingsvm_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, andH2OMultinomialModel), includingboost_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()), includingrule_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 becauseh2o.rule_importance()does not expose the per-class coefficients. (#232)Added support for
mboost::blackboost()gradient boosting regression models, includingboost_tree()parsnip models fitted with the"mboost"engine. Only theGaussian()family is supported. (#232)Added support for
aorsf::orsf()oblique random forest regression models, includingrand_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, includingdecision_tree()andboost_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), includingC5_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, includingrand_forest()parsnip models fitted with the"partykit"engine. Classification is not supported. (#232)Added support for
LiblineaR::LiblineaR()binary logistic regression models (type0, 6, 7), includinglogistic_reg()parsnip models fitted with the"LiblineaR"engine. Also added support for linear support vector machine models, includingsvm_linear()parsnip models fitted with the"LiblineaR"engine, for regression (type11, 12, 13) and binary classification (type1-5). Classification returns the SVM decision value rather than a probability. (#232)Added support for
xrf::xrf()rule-based models (RuleFit), includingrule_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, includinglinear_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 awtof 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 withparse_model()andas_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 wheninclude_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 whenalertwasTRUE. (#232)tidypredict_test()now compares ranger models againstpredict(). 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 predictionsfitinraw_resultsfor XGBoost, LightGBM, CatBoost and h2o models, matching every other model type. The column was previously calledbase. (#232)tidypredict_test()now reportsfit_diffas 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_diffis 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 (DepthwiseorLossguidegrow 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 supportGammafamily and Cox proportional hazards (family = "cox") models. (#200, #201)xgboost support now includes additional objectives:
binary:hinge,reg:absoluteerror,reg:gamma,reg:pseudohubererror, andreg: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 withrate_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 incorporatesbase_scorefor xgboost models withcount:poissonandreg:tweedieobjectives. Previously, predictions were incorrect whenbase_scorewas not the default value. (#184)tidypredict_fit()now correctly averages tree predictions for LightGBM models withboosting="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 werenum.treestimes 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 withglmnet()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_scorewasn’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
.defaultargument in producedcase_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()andglm()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)
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
stringrFixes issue with
earthparsed_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.7
CRAN release: 2020-10-05
- Change to with with version 5.1.2 and above of the
earthpackage. As a result,tidypredictwill only parse objects created by this and later versions ofearth.
tidypredict 0.4.3
CRAN release: 2019-09-03
Adds support for categorical predictors in
partykitFixes
parsniptests to meet standards of new CRAN version
tidypredict 0.4.2
CRAN release: 2019-07-15
Simplifies tests that verify
rangerAdds fit method for parsed
xgboostmodelsSets conditional requirement for
xgboost, for test and vignette
tidypredict 0.4.0
CRAN release: 2019-07-12
New features
Parses
rangerclassification models.Adds method support for
broom’stidy()function. Regression models onlyAdds
as_parsed_model()function. It adds the proper class components to the list.Adds initial support for
partykit’sctree()modelAdds support for
parsnipfitted models:lm,randomForest,ranger, andearthAdds support for xgb.Booster models provided by the
xgboostpackage (@Athospd, #43)Adds support for
Cubist::cubist()models (# 36)
tidypredict 0.3.0
CRAN release: 2019-01-10
Improvements
New parsed models are now list objects as opposed to data frames.
tidypredict_to_column() no longer supports
rangerandrandomForestbecause 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/yinterface forearthmodels 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.0
CRAN release: 2018-02-25
New features
- Add support for
ranger()models.
Bug fixes
- Using
x ~.in a randomForest() formula fails (#18 @washcycle).
