Questions tagged [tidymodels]

The tidymodels framework is a collection of R packages for modeling and machine learning using tidyverse principles.

The tidymodels framework is a "meta-package" for modeling and statistical analysis that shares the underlying design philosophy, grammar, and data structures of the . It includes a core set of packages that are loaded on startup, and extra packages that are installed along with tidymodels but not attached on startup. The tidymodels framework provides tooling for modeling tasks including supervised machine learning (predictive modeling), unsupervised machine learning, time series analysis, text analysis, and more.

Resources

Related tags

231 questions
14
votes
1 answer

What is the difference among prep/bake/juice in the R package "recipes"?

I read the introduction to tidymodels and I am confused about what prep(), bake() and juice() from the recipes package do to the data. What each does? I honestly found confusing to have such names for functions, what would be a more intuitive name…
Andrea
  • 179
  • 10
8
votes
3 answers

retreiving tidy results from regression by group with broom

The answer to this question clearly explains how to retrieve tidy regression results by group when running a regression through a dplyr pipe, but the solution is no longer reproducible. How can one use dplyr and broom in combination to run a…
C. Rea
  • 91
  • 5
6
votes
1 answer

Tidymodels tune_grid: "Can't subset columns that don't exist" when not using formula

I've put together a data preprocessing recipe for the recent coffee dataset featured on TidyTuesday. My intention is to generate a workflow, and then from there tune a hyperparameter. I'm specifically interesting in manually declaring predictors and…
mdneuzerling
  • 368
  • 2
  • 9
6
votes
1 answer

tidymodels: ranger with cross validation

The dataset can be found here: https://www.kaggle.com/mlg-ulb/creditcardfraud I am trying to use tidymodels to run ranger with 5 fold cross validation on this dataset. I have have 2 code blocks. The first code block is the original code with the…
OTA
  • 196
  • 9
5
votes
1 answer

Add missing indicator columns using the tidymodels recipes package

I'd like to create a recipe using the recipes package that both imputes missing data and adds indicator columns that indicate which values were missing. It would also be nice if there was an option to choose between including an indicator column for…
Cameron Bieganek
  • 5,372
  • 12
  • 27
4
votes
1 answer

Tuning a LASSO model and predicting using tidymodels

I want to perform penalty selection for the LASSO algorithm and predict outcomes using tidymodels. I will use the Boston housing dataset to illustrate the problem. library(tidymodels) library(tidyverse) library(mlbench) data("BostonHousing") dt <-…
Augustin
  • 227
  • 1
  • 7
4
votes
1 answer

running multiple regression models using tidymodels

I've recently been using tidymodels to run models and select parameters that best satisfy some objective function. For example using a hypothetical regression on mtcars data (using the regression examples from the bottom answer of this question as…
Robert Hickman
  • 673
  • 1
  • 4
  • 14
4
votes
2 answers

Plotting decision tree results from tidymodels

I have managed to build a decision tree model using the tidymodels package but I am unsure how to pull the results and plot the tree. I know I can use the rpart and rpart.plot packages to achieve the same thing but I would rather use tidymodels as…
Edgar Zamora
  • 394
  • 1
  • 9
4
votes
1 answer

Error with tune_grid function from R package tidymodels

I've been reproducing Julia Silge's code from his Youtube video of Sentiment Analysis with tidymodels for Animal Crossing user reviews (https://www.youtube.com/watch?v=whE85O1XCkg&t=1300s). In minute 25, she uses tune_grid(), and when I try to use…
3
votes
1 answer

R Tidymodels: What objects to save for use in production after fitting a recipe-based workflow utilizing pre-processing?

After designing a Tidymodels recipe-based workflow, which is tuned then fitted to some training data, I'm not clear what objects (fitted "workflow", "recipe", ..etc) should be saved to disk for use in predicting new data in production. I understand…
wphampton
  • 404
  • 3
  • 11
3
votes
1 answer

Tidymodels Package: Visualising a random forest model using ggplot() to show the most important predictors

Overview I am following a tutorial (see below) to find the best fit models from bagged trees, random forests, boosted trees, and general linear models. Tutorial (see examples…
Alice Hobbs
  • 715
  • 1
  • 8
  • 21
3
votes
1 answer

Tidymodels Logistic Regression getting coefficients and standard errors

Is there a way to get the standard errors and p-values for logistic regression in tidy models? I can get the coefficients by the following code below.. but I want to calculate odds ratios for each feature and I will need the standard errors as…
Eisen
  • 519
  • 1
  • 10
3
votes
0 answers

error with tune_grid function from tune r package (tidymodels) - Error: A `parameters` object has required columns

This is my very first question that I have posted on stack overflow. I have done my best to create a decent reprex using the reprex r package. Any feedback is appreciated. Here goes: I believe that the error is located at the very bottom of my…
3
votes
0 answers

Is there a way to install tidymodels in R Version 3.6.1?

I'm also currently running an older version of Rstudio (Version 1.1.463) as my mac is running El Capitan (not enough memory to update). When trying to install and run 'tidymodels' I receive: Error: package or namespace load failed for ‘tidymodels’…
Olli
  • 55
  • 2
2
votes
2 answers

Dplyr: case_when - how to use to select a column?

I would like to use case_when from dplyr in order to select a column to change its role for a tidymodels recipe. What am I doing wrong? In the following MWE an ID-role should be assigned to the column "b": library(tidyverse) library(tidymodels) #…
Roland
  • 129
  • 7
1
2 3
15 16