Skip to content

Releases: tidymodels/parsnip

parsnip 1.5.0

10 Apr 18:32
0d36294

Choose a tag to compare

Quantile Regression

  • Quantile levels are not dropped when a model specification is modified (#1304)

  • xgboost and qrnn engines were added for quantile regression to boost_tree() and mlp(), respectively. (#1321)

Ordinal Regression

The changes in this section are discussed in #1298.

  • A new model ordinal_reg() is introduced for ordinal regression (#953):

    • Its sole mode is "classification" and its default engine is "polr" for MASS::polr().
    • Additional engines "ordinalNet" for ordinalNet::ordinalNet() and "vglm" for VGAM::vglm() are documented.
    • In addition to penalty and mixture common to GLM models, two new model parameters are introduced: ordinal_link and odds_link.
    • Methods are written for translate(), update(), check_args(), and tunable().
    • Existing pan-model tests are extended and new model-specific tests are added.
  • New engines for ordinal prediction are documented:

    • "vgam" for VGAM::vgam() under gen_additive_mod()
    • "rpartScore" for rpartScore::rpartScore() under decision_tree()
    • "ordinalForest" for ordinalForest::ordfor() under rand_forest()
  • Engine arguments for the new ordinal prediction engines are documented.

  • Ordinal prediction tools are coordinated with new parameter tuners in dials and engines in ordered.

Bug Fixes

  • fit() with a formula now reliably drops rows with missing values during internal data conversion, regardless of the global options(na.action = ...) setting (#548).

  • Fixed a bug in random forest fits using the "aorsf" engine where the check for mtry could not be performed (#1276)

  • repair_call() now errors informatively when given an object that is not a fitted parsnip model (#598).

  • Fix bug in predicting class probabilities for multiclass earth models (#1334)

  • set_engine() now errors informatively when an invalid engine name is specified for models whose engines all come from extension packages (#1110).

  • Case weight usage was enabled for the "nnet" engines of mlp() and bag_mlp() as well as for the "dbarts" engine of bart().

Other Updates

  • For developers, format_predictions() is a new unified function for formatting prediction outputs, consolidating the logic from the individual format_*() functions (#927). The individual functions format_num(), format_class(), format_classprobs(), format_time(), format_survival(), format_linear_pred(), and format_hazard() are now deprecated.

  • The interface for declaring tunable parameters and any deviations for the standard parameter characteristics, has been simplified. These values can now be set inside of extension packages (#1349).

  • Documentation for the lightgbm engine now includes information about custom objective functions and automatic num_class handling (#1275).

  • The "Fitting and predicting with parsnip" article has moved to tidymodels.org (#1324).

  • All model details files note whether case weights can be used or not.

  • We now export the generics for predict_quantile(), predict_class(), predict_classprob(), and predict_hazard(). (#1257)

parsnip 1.4.1

11 Jan 20:24
5dc9c59

Choose a tag to compare

  • Fixed bug where xgboost mdoels would fail to predict when trees matched number of trees in model. (#1316)

parsnip 1.4.0

01 Dec 18:15
0289b94

Choose a tag to compare

  • Fixes issue with running predictions for Decision Trees in Spark (#1309)

  • Updates to some boosting tuning parameter information: (#1306)

    • lightgbm and catboost have smaller default ranges for the learning rate: -3 to -1 / 2 in log10 units.
    • lightgbm, xgboost, catboost, and C5.0 have smaller default ranges for the sampling proportion: 0.5 to 1.0.
    • catboost engine arguments were added for max_leaves and l2_leaf_reg.
  • Enable generalized random forest (grf) models for classification, regression, and quantile regression modes. (#1288)

  • surv_reg() is now defunct and will error if called. Please use survival_reg() instead (#1206).

  • Enable parsnip to work with xgboost version > 2.0.0.0. (#1227)

parsnip 1.3.3

31 Aug 20:17
9cee24b

Choose a tag to compare

  • Bug fix in how tunable parameters were configured for brulee neural networks.

  • A change to make linear SVM models more quiet.

  • A few default parameter ranges were changed for brulee neural network models.

parsnip 1.3.2

28 May 17:32
1c57fc2

Choose a tag to compare

  • Switch to base R pipe

  • Requires changes for CRAN's "No Suggests" check.

  • Avoid issues with reading from package files. (#1271)

parsnip 1.3.1

12 Mar 17:00
28e3f1d

Choose a tag to compare

Bug Fixes

  • Fixed a bug that errored when tidying a glmnet object with a penalty value greater than one (#1261).

parsnip 1.3.0

14 Feb 12:14

Choose a tag to compare

New Features

  • A new model mode ("quantile regression") was added. Including:

    • A linear_reg() engine for "quantreg".
    • Predictions are encoded via a custom vector type. See [hardhat::quantile_pred()].
    • Predicted quantile levels are designated when the new mode is specified. See ?set_mode.
  • Updates for sparse data formats:

    • fit_xy() can now take dgCMatrix input for x argument (#1121).
    • fit_xy() can now take sparse tibbles as data values (#1165).
    • predict() can now take dgCMatrix and sparse tibble input for new_data argument, and error informatively when model doesn't support it (#1167).
  • New extract_fit_time() method has been added that returns the time it took to train the model (#853).

  • mlp() with keras engine now work for all activation functions currently supported by keras (#1127).

  • mlp() now has a brulee_two_layer engine.

Other Changes

  • Transitioned package errors and warnings to use cli (#1147 and #1148 by @shum461, #1153 by @RobLBaker and @wright13, #1154 by @JamesHWade, #1160, #1161, #1081).

  • fit_xy() currently raises an error for gen_additive_mod() model specifications as the default engine ("mgcv") specifies smoothing terms in model formulas. However, some engines specify smooths via additional arguments, in which case the restriction on fit_xy() is excessive. parsnip will now only raise an error when fitting a gen_additive_mod() with fit_xy() when using the "mgcv" engine (#775).

  • Aligned null_model() with other model types; the model type now has an engine argument that defaults to "parsnip" and is checked with the same machinery that checks other model types in the package (#1083).

  • If linear regression is requested with a Poisson family, an error will occur and refer the user to poisson_reg() (#1219).

  • The deprecated function rpart_train() was removed after its deprecation period (#1044).

Bug Fixes

  • Make sure that parsnip does not convert ordered factor predictions to be unordered.

  • Ensure that knit_engine_docs() has the required packages installed (#1156).

  • Fixed bug where some models fit using fit_xy() couldn't predict (#1166).

  • Fixed bug related to using local (non-package) models (#1229)

  • tunable() now references a dials object for the mixture parameter (#1236)

Breaking Change

  • For quantile prediction, the quantile argument to predict() has been deprecate in facor of quantile_levels. This does not affect models with mode "quantile regression".

  • The quantile regression prediction type was disabled for the deprecated surv_reg() model.

  • NULL is no longer accepted as an engine (#1242).

parsnip 1.2.1

23 Mar 01:50
322a43b

Choose a tag to compare

  • Added a missing tidy() method for survival analysis glmnet models (#1086).

  • A few changes were made to achive more speed-ups (#1075) (#1073) (#1072)

parsnip 1.2.0

16 Feb 18:09
a30a15e

Choose a tag to compare

Bug Fixes

  • Tightened logic for outcome checking. This resolves issues—some errors and some silent failures—when atomic outcome variables have an attribute (#1060, #1061).

  • Fixed bug in fitting some model types with the "spark" engine (#1045).

  • Fixed issues in metadata for the "brulee" engine where several arguments were mistakenly protected. (#1050, #1054)

  • Fixed documentation for mlp(engine = "brulee"): the default values for learn_rate and epochs were swapped (#1018).

  • Fixed a bug in the integration with workflows where using a model formula with a formula preprocessor could result in a double intercept (#1033).

Other Changes

  • We no longer add eval_time arguments to the prediction specification for the engine (#1039).

  • parsnip now lets the engines for [mlp()] check for acceptable values of the activation function (#1019)

  • rpart_train() has been deprecated in favor of using decision_tree() with the "rpart" engine or rpart::rpart() directly (#1044).

  • .filter_eval_time() was moved to the survival standalone file.

  • Improved errors and documentation related to special terms in formulas. See ?model_formula to learn more. (#770, #1014)

  • Improved errors in cases where the outcome column is mis-specified. (#1003)

  • The new_data argument for the predict() method for censoring_model_reverse_km objects has been deprecated (#965).

  • When computing censoring weights, the resulting vectors are no longer named (#1023).

  • The predict() method for censoring_model_reverse_km objects now checks that ... are empty (#1029).

parsnip 1.1.1

17 Aug 23:44
fc953dd

Choose a tag to compare

  • Fixed bug where prediction on rank deficient lm() models produced .pred_res instead of .pred. (#985)

  • Fixed bug where sparse data was being coerced to non-sparse format doing predict().

  • For BART models with the dbarts engine, predict() can now also return the standard error for confidence and prediction intervals (#976).

  • augment() now works for censored regression models.

  • A few censored regression helper functions were exported: .extract_surv_status() and .extract_surv_time() (#973, #980).

  • Fixed bug where boost_tree() models couldn't be fit with 1 predictor if validation argument was used. (#994)