|
| 1 | +--- |
| 2 | +output: hugodown::hugo_document |
| 3 | + |
| 4 | +slug: tidymodels-2025-q3 |
| 5 | +title: Q3 2025 tidymodels digest |
| 6 | +date: 2025-11-18 |
| 7 | +author: Emil Hvitfeldt |
| 8 | +description: > |
| 9 | + A summary of what has been going on for the tidymodels group in the mid 2025. |
| 10 | +
|
| 11 | +photo: |
| 12 | + url: https://unsplash.com/photos/autumn-trees-with-colorful-leaves-in-a-park-Qx6Ojv9WPo8 |
| 13 | + author: Anurag Jamwal |
| 14 | + |
| 15 | +# one of: "deep-dive", "learn", "package", "programming", "roundup", or "other" |
| 16 | +categories: [roundup] |
| 17 | +tags: [tidymodels] |
| 18 | +rmd_hash: 0cc22455fc61a268 |
| 19 | + |
| 20 | +--- |
| 21 | + |
| 22 | +<!-- |
| 23 | +TODO: |
| 24 | +* [x] Look over / edit the post's title in the yaml |
| 25 | +* [x] Edit (or delete) the description; note this appears in the Twitter card |
| 26 | +* [x] Pick category and tags (see existing with [`hugodown::tidy_show_meta()`](https://rdrr.io/pkg/hugodown/man/use_tidy_post.html)) |
| 27 | +* [x] Find photo & update yaml metadata |
| 28 | +* [x] Create `thumbnail-sq.jpg`; height and width should be equal |
| 29 | +* [x] Create `thumbnail-wd.jpg`; width should be >5x height |
| 30 | +* [x] [`hugodown::use_tidy_thumbnails()`](https://rdrr.io/pkg/hugodown/man/use_tidy_post.html) |
| 31 | +* [x] Add intro sentence, e.g. the standard tagline for the package |
| 32 | +* [x] [`usethis::use_tidy_thanks()`](https://usethis.r-lib.org/reference/use_tidy_thanks.html) |
| 33 | +--> |
| 34 | + |
| 35 | +The tidymodels framework is a collection of R packages for modeling and machine learning using tidyverse principles. |
| 36 | + |
| 37 | +Since the beginning of 2021, we have been publishing quarterly updates here on the tidyverse blog summarizing what's new in the tidymodels ecosystem. The purpose of these regular posts is to share useful new features and any updates you may have missed. You can check out the tidymodels tag to find all tidymodels blog posts here, including our roundup posts as well as those that are more focused. |
| 38 | + |
| 39 | +Since our last update we have had some larger releases that you can read about in these posts. |
| 40 | + |
| 41 | +- [tune 2.0.0](https://tidyverse.org/blog/2025/11/tune-2/) |
| 42 | +- [recipes 1.3.0](https://tidyverse.org/blog/2025/04/recipes-1-3-0/) |
| 43 | +- [rsample 1.3.0](https://tidyverse.org/blog/2025/04/rsample-1-3-0/) |
| 44 | +- [improved sparsity support in tidymodels](https://tidyverse.org/blog/2025/03/tidymodels-sparsity/) |
| 45 | + |
| 46 | +The post will update, you on which packages have changed and the improvements you should know about that haven't been covered in the above posts. |
| 47 | + |
| 48 | +Here's a list of the packages and their News sections: |
| 49 | + |
| 50 | +- [dials](https://dials.tidymodels.org/news/index.html) |
| 51 | +- [parsnip](https://parsnip.tidymodels.org/news/index.html) |
| 52 | +- [rsample](https://rsample.tidymodels.org/news/index.html) |
| 53 | +- [recipes](https://recipes.tidymodels.org/news/index.html) |
| 54 | +- [probably](https://probably.tidymodels.org/news/index.html) |
| 55 | +- [brulee](https://brulee.tidymodels.org/news/index.html) |
| 56 | + |
| 57 | +Let's look at a few specific updates. |
| 58 | + |
| 59 | +## Quiet linear svm models |
| 60 | + |
| 61 | +When you used to fit a linear SVM model, you would get a message that you were not able to avoid. |
| 62 | + |
| 63 | +``` r |
| 64 | +library(parsnip) |
| 65 | +library(modeldata) |
| 66 | + |
| 67 | +res <- |
| 68 | + svm_linear(mode = "classification", engine = "kernlab") |> |
| 69 | + fit(Class ~ ., data = two_class_dat) |
| 70 | +#> Setting default kernel parameters |
| 71 | +``` |
| 72 | + |
| 73 | +This message by itself was not that useful and was unable to turn off in a reasonable way. We have silenced this message to hopefully alleviate some of the noise that came from using this method. |
| 74 | + |
| 75 | +<div class="highlight"> |
| 76 | + |
| 77 | +<pre class='chroma'><code class='language-r' data-lang='r'><span><span class='kr'><a href='https://rdrr.io/r/base/library.html'>library</a></span><span class='o'>(</span><span class='nv'><a href='https://github.com/tidymodels/parsnip'>parsnip</a></span><span class='o'>)</span></span> |
| 78 | +<span><span class='kr'><a href='https://rdrr.io/r/base/library.html'>library</a></span><span class='o'>(</span><span class='nv'><a href='https://modeldata.tidymodels.org'>modeldata</a></span><span class='o'>)</span></span> |
| 79 | +<span><span class='c'>#> </span></span> |
| 80 | +<span><span class='c'>#> Attaching package: 'modeldata'</span></span> |
| 81 | +<span></span><span><span class='c'>#> The following object is masked from 'package:datasets':</span></span> |
| 82 | +<span><span class='c'>#> </span></span> |
| 83 | +<span><span class='c'>#> penguins</span></span> |
| 84 | +<span></span><span></span> |
| 85 | +<span><span class='nv'>res</span> <span class='o'><-</span> </span> |
| 86 | +<span> <span class='nf'><a href='https://parsnip.tidymodels.org/reference/svm_linear.html'>svm_linear</a></span><span class='o'>(</span>mode <span class='o'>=</span> <span class='s'>"classification"</span>, engine <span class='o'>=</span> <span class='s'>"kernlab"</span><span class='o'>)</span> <span class='o'>|></span> </span> |
| 87 | +<span> <span class='nf'><a href='https://generics.r-lib.org/reference/fit.html'>fit</a></span><span class='o'>(</span><span class='nv'>Class</span> <span class='o'>~</span> <span class='nv'>.</span>, data <span class='o'>=</span> <span class='nv'>two_class_dat</span><span class='o'>)</span></span> |
| 88 | +<span><span class='nv'>res</span></span> |
| 89 | +<span><span class='c'>#> parsnip model object</span></span> |
| 90 | +<span><span class='c'>#> </span></span> |
| 91 | +<span><span class='c'>#> Support Vector Machine object of class "ksvm" </span></span> |
| 92 | +<span><span class='c'>#> </span></span> |
| 93 | +<span><span class='c'>#> SV type: C-svc (classification) </span></span> |
| 94 | +<span><span class='c'>#> parameter : cost C = 1 </span></span> |
| 95 | +<span><span class='c'>#> </span></span> |
| 96 | +<span><span class='c'>#> Linear (vanilla) kernel function. </span></span> |
| 97 | +<span><span class='c'>#> </span></span> |
| 98 | +<span><span class='c'>#> Number of Support Vectors : 361 </span></span> |
| 99 | +<span><span class='c'>#> </span></span> |
| 100 | +<span><span class='c'>#> Objective Function Value : -357.1487 </span></span> |
| 101 | +<span><span class='c'>#> Training error : 0.178255 </span></span> |
| 102 | +<span><span class='c'>#> Probability model included.</span></span> |
| 103 | +<span></span></code></pre> |
| 104 | + |
| 105 | +</div> |
| 106 | + |
| 107 | +## Fewer numeric overflow issues in brulee |
| 108 | + |
| 109 | +The brulee package has been improved to try to help avoid numeric overflow in the loss functions. The following things have been done to help deal with this type of issue. |
| 110 | + |
| 111 | +- Starting values were transitioned to using Gaussian distribution (instead of uniform) with a smaller standard deviation. |
| 112 | + |
| 113 | +- The results always contain the initial results to use as a fallback if there is overflow during the first epoch. |
| 114 | + |
| 115 | +- `brulee_mlp()` has two additional parameters, `grad_value_clip` and `grad_value_clip`, that prevent issues. |
| 116 | + |
| 117 | +- The warning was changed to "Early stopping occurred at epoch {X} due to numerical overflow of the loss function." |
| 118 | + |
| 119 | +## Additional torch optimizers in brulee |
| 120 | + |
| 121 | +Several additional optimizers have been added: `"ADAMw"`, `"Adadelta"`, `"Adagrad"`, and `"RMSprop"`. Previously, the options were `"SGD"` and `LBFGS"`. \## Acknowledgements |
| 122 | + |
| 123 | +We want to sincerely thank everyone who contributed to these packages since their previous versions: |
| 124 | + |
| 125 | +- dials: [@brendad8](https://github.com/brendad8), [@hfrick](https://github.com/hfrick), [@topepo](https://github.com/topepo), and [@Wander03](https://github.com/Wander03). |
| 126 | +- parsnip: [@chillerb](https://github.com/chillerb), [@EmilHvitfeldt](https://github.com/EmilHvitfeldt), [@jmgirard](https://github.com/jmgirard), [@topepo](https://github.com/topepo), and [@ZWael](https://github.com/ZWael). |
| 127 | +- rsample: [@abichat](https://github.com/abichat), [@hfrick](https://github.com/hfrick), [@mkiang](https://github.com/mkiang), and [@vincentarelbundock](https://github.com/vincentarelbundock). |
| 128 | +- recipes: [@EmilHvitfeldt](https://github.com/EmilHvitfeldt), [@SimonDedman](https://github.com/SimonDedman), and [@topepo](https://github.com/topepo). |
| 129 | +- probably: [@abichat](https://github.com/abichat), [@ayueme](https://github.com/ayueme), [@dchiu911](https://github.com/dchiu911), [@EmilHvitfeldt](https://github.com/EmilHvitfeldt), [@frankiethull](https://github.com/frankiethull), [@gaborcsardi](https://github.com/gaborcsardi), [@hfrick](https://github.com/hfrick), [@Jeffrothschild](https://github.com/Jeffrothschild), [@jgaeb](https://github.com/jgaeb), [@jrwinget](https://github.com/jrwinget), [@mark-burdon](https://github.com/mark-burdon), [@martinhulin](https://github.com/martinhulin), [@simonpcouch](https://github.com/simonpcouch), [@teunbrand](https://github.com/teunbrand), [@topepo](https://github.com/topepo), [@wjakethompson](https://github.com/wjakethompson), and [@yellowbridge](https://github.com/yellowbridge). |
| 130 | +- brulee: [@genec1](https://github.com/genec1), [@talegari](https://github.com/talegari), and [@topepo](https://github.com/topepo). |
| 131 | + |
0 commit comments