Skip to content

Releases: tidymodels/recipes

recipes 1.3.1

21 May 17:06
92bbc2f
Compare
Choose a tag to compare
  • Fixed bug where tune_args() would error if argument to step had a parsnip object with tuned arguments. (#1506)

recipes 1.3.0

17 Apr 12:13
c3cc8f4
Compare
Choose a tag to compare
  • Fixed printing for step_geodist() when no variables are selected. (#1423)

  • Fixed bug where extract_fit_time() would throw warning for when recipe didn't have any steps. (#1475)

  • step_num2factor() has gotten improved documentation to avoid getting NAs as output. (#575)

  • step_select() has started its deprecation process. See ?step_select() for alternatives. (#1488)

  • step_interact() now works with empty selections instead of erroring. (#1417)

  • Added developer function check_options(). (#1269)

  • fixed bug where step_nnmf_sparse() required that the Matrix package was loaded. (#1141)

  • Fixed bug where recipe() would error on sf objects. (#1393)

  • step_impute_bag() now has a much smaller memory footprint when prepped. (#638)

  • step_cut() not longer errors on NA values in bake(). (#1304)

  • The following arguments in steps can now take bare names as input instead of strings, calls to vars(), imp_vars(), and denom_vars(). (#1225)

    • step_classdist_shrunken(class)
    • step_classdist(class)
    • step_depth(class)
    • step_impute_bag(impute_with)
    • step_impute_knn(impute_with)
    • step_impute_linear(impute_with)
    • step_pls(outcome)
    • step_profile(profile)
    • step_ratio(denom)
  • Fixed bug in step_impute_knn() would error on character vectors when strings_as_factors = TRUE. (#926)

  • Make it so recipe.formula() can't take table objects as input, in accordance with documentation. (#1416)

  • The strings_as_factors argument of prep.recipe() has been soft-deprecated in favor of recipe(strings_as_factors). If both are provided, the value in recipe() takes precedence. This allows control of recipe behavior within a workflow, which wasn't previously possible. (@smingerson, #331, #287)

  • More informative error for some failures of step_impute_bag() (#209)

  • Fixed bugs in step_bs(), step_depth(), step_harmonic(), step_invlogit(), step_isomap(), step_logit(), check_range(), step_poly_bernstein(), step_spline_b(), step_spline_convex(), step_monotone(), step_natural(), step_nonnegative() would error in bake() with zero-row data. (#1219)

  • Fixed bug where step_lincomb() would remove both variables if they were identical. (#1357)

  • step_impute_bag() and step_impute_knn() now gives more informative warnings when impute_with data contains all NAs. (#1385)

  • step_spline_b(), step_spline_convex(), step_spline_monotone(), step_spline_natural(), and step_spline_nonnegative() now gives informative errors when applied to zero variance predictors. (#1455)

  • fixed bug where bake.step_discretize() would error if applied to predictor only containing NAs. (#1350)

  • Officially deprecate printer() in favor of print_step(). (#1243)

  • step_dummy() has gained contrasts argument. This change soft deprecates the use of getOption("contrasts") with step_dummy(). (##1349)

  • step_mutate_at() has been superceded in favor of step_mutate() when used with across(). (#662)

recipes 1.2.1

25 Mar 22:38
Compare
Choose a tag to compare

Bug Fixes

  • Fixed bug where sparsity creation steps error if applied to variables created by other steps. (#1448)

recipes 1.2.0

18 Mar 11:57
fb251cd
Compare
Choose a tag to compare

Improvements

  • recipe(), prep(), and bake() now work with sparse tibbles. (#1364, #1366)

  • recipe(), prep(), and bake() now work with sparse matrices. (#1364, #1368, #1369)

  • The following steps has gained the argument sparse. When set to "yes", they will produce sparse vectors. (#1392)

    • step_count()
    • step_dummy_extract()
    • step_dummy_multi_choice()
    • step_dummy()
    • step_dummy()
    • step_holiday()
    • step_indicate_na()
    • step_regex()
  • The following steps have been modified to preserve sparsity in its input. (#1395)

    • step_arrange()
    • step_filter_missing()
    • step_filter()
    • step_impute_mean()
    • step_impute_median()
    • step_lag()
    • step_lag()
    • step_rename_at()
    • step_rename()
    • step_rm()
    • step_sample()
    • step_scale()
    • step_select()
    • step_shuffle()
    • step_slice()
    • step_sqrt()
    • step_zv()
  • All steps and checks now require arguments trained, skip, role, and id at all times. (#1387)

Bug Fixes

  • Fixed bug where name repaired column names would get changed when baked for some steps. (#1347)

recipes 0.1.8

20 Feb 19:37
26cc857
Compare
Choose a tag to compare

Breaking Changes

  • The imputation steps do not change the data type being imputed now. Previously, if the data were integer, the data would be changed to numeric (for some step types). The change is breaking since the underlying data of imputed values are now saved as a list instead of a vector (for some step types).

  • The data sets were moved to the new modeldata package.

  • step_num2factor() was rewritten due to a bug that ignored the user-supplied levels (#425). The results of the transform argument are now required to be a function and levels must now be supplied.

Other Changes

  • Using a minus in the formula to recipes() is no longer allowed (it didn't remove variables anyway). step_rm() or update_role() can be used instead.

  • When using a selector that returns no columns, juice() and bake() will now return a tibble with as many rows as the original template data or the new_data respectively. This is more consistent with how selectors work in dplyr (#411).

  • Code was added to explicitly register tunable methods when recipes is loaded. This is required because of changes occurring in R 4.0.

  • check_class() checks if a variable is of the designated class. Class is either learned from the train set or provided in the check. (contributed by Edwin Thoen)

  • step_normalize() and step_scale() gained a factor argument with values of 1 or 2 that can scale the standard deviations used to transform the data. (#380)

  • bake() now produces a tibble with columns in the same order as juice() (#365)

recipes 1.1.1

12 Feb 18:02
Compare
Choose a tag to compare

Improvements

  • Example for step_novel() now better illustrates how it works. (@Edgar-Zamora, #1248)

  • prep.recipe(..., strings_as_factors = TRUE) now only converts string variables that have role "predictor" or "outcome". (@dajmcdon, #1358, #1376)

recipes 1.1.0

05 Jul 14:24
a69b49c
Compare
Choose a tag to compare

Improvements

  • Improved error message for misspelled argument in step functions. (#1318)

  • recipe() can now take data.frames with list-columns or sf data.frames as input to data. (#1283)

  • recipe() will now show better error when columns are misspelled in formula (#1283).

  • add_role() now errors if a column would simultaneously have roles "outcome" and "predictor". (#935)

  • prep() will now error if the ptype of the data doesn't match which was used to define the recipe. (#793)

  • Added more documentation in ?selections about how tidyselect::everything() works in recipes. (#1259)

  • New extract_fit_time() method has been added that returns the time it took to train the recipe. (#1071)

  • step_spline_b(), step_spline_convex(), step_spline_monotone(), and step_spline_nonnegative() now throws informative errors if thedegree, deg_free, and complete_set arguments causes an error. (#1170)

  • step_mutate() gained .pkgs argument to specify what packages need to be loaded for step to work. (#1282)

  • step_interact() now gives better error if terms isn't a formula. (#1299)

  • The prefix argument of step_dummy_multi_choice() is now properly documented. (#1298)

  • Significant speedup in step_dummy() when applied to many columns. (#1305)

  • step_dummy() now gives an informative error on attempt to generate too many columns to fit in memory. (#828)

  • step_dummy() and step_unknown() now throw more informative warnings for unseen levels. (#450)

  • step_dummy() now throws more informative warnings for NA values. (#450)

Bug Fixes

  • NA levels in factors aren't dropped when passed to recipe(). (#1291)

  • recipe() no longer crashes when given long formula expression (#1283).

  • Fixed bug in step_ns() and step_bs() where knots field in options argument wasn't correctly used. (#1297)

  • Bug fixed in step_interact() where long formulas were used. (#1231, #1289)

  • Fixed documentation mistake where default value of keep_original_cols argument were wrong. (#1314)

Developer

  • Developer helper function recipes_ptype() has been added, returning expected input data for prep() and bake() for a given recipe object. (#1329)

  • Developer helper function recipes_ptype_validate() has been added, to validate new data is compatible with recipe ptype. (#793)

  • Developer helper functions recipes_names_predictors() and recipes_names_outcomes() have been added to aid variable selection in steps. (#1026)

recipes 1.0.10

18 Feb 20:06
99e8a57
Compare
Choose a tag to compare

Bug Fixes

  • Fixed bug where step_log() breaks legacy recipe objects by indexing names(object) in bake(). (@stufield, #1284)

recipes 1.0.9

14 Dec 12:23
cc984ff
Compare
Choose a tag to compare

Improvements

  • Minor speed-up and reduced memory consumption for step_pca() in the bake() stage by reducing unused multiplications (@jkennel, #1265)

  • Document that update_role(), add_role() and remove_role() are applied before steps and checks. (#778)

  • Documentation for tidy methods for all steps has been added when missing and improved to describe the return value more accurately. (#936)

  • step_dummy() will now error if passed character instead of loudly ignoring them. Only applicable when setting strings_as_factors = FALSE. (#1233)

  • It is now documented that step_spline_b() can be made periodic. (#1223)

  • prep() now correctly throws a warning when training argument is set when prepping a prepped recipe, telling the user that it will be ignored. (#1244)

  • When errors are thrown about wrongly typed input to steps, the offending variables and their types are now listed. (#1217)

  • All warnings and errors have been updated to use the cli package for increased clarity and consistency. (#1237)

  • Added warnings when step_scale(), step_normalise(), step_center() or step_range() result in NaN columns. (@mastoffel, #1221)

Bug Fixes

  • Fixed bug where step_factor2string() if strings_as_factors = TRUE is set in prep(). (#317)

  • Fixed bug where tidy.step_cut() always returned zero row tibbles for trained recipes. (#1229)

recipes 1.0.8

26 Aug 13:44
0ab2d65
Compare
Choose a tag to compare

Bug Fixes

  • Fixed bugs where spline steps (step_ns(), step_bs(), step_spline_b(), step_spline_convex(), step_spline_monotone(), step_spline_natural(), step_spline_nonnegative()) would error if baked with 1 row. (#1191)