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

613 questions
2
votes
1 answer

How to extract random intercepts from mixed effects Tidymodels

I am trying to extract random intercepts from tidymodels using lme4 and multilevelmod. I able to do this using lme4 below: Using R and lme4: library("tidyverse") library("lme4") # set up model mod <- lmer(Reaction ~ Days +…
daszlosek
  • 1,366
  • 10
  • 19
2
votes
0 answers

Tuning Tidymodels’ Recipe and Model Parameters Simultaneously

We can use Tidymodels to tune both recipe parameters and model parameters simultaneously, right? I'm struggling to understand what corrective action I should take based on the message, Error: Some tuning parameters require finalization but there…
Dean
  • 168
  • 8
2
votes
1 answer

How can I unscale and understand glmnet coefficients while using tidymodels?

I'm a bit confused with how I should interpret the coefficients from the elastic net model that I'm getting through tidymodels and glmnet. Ideally, I'd like to produce unscaled coefficients for maximum interpretability. My issue is that I'm honestly…
Evan O.
  • 1,553
  • 2
  • 11
  • 20
2
votes
1 answer

Tune recipe in workflow set with custom range (or value)

I'm trying to use workflow_set() function in tidymodels to evaluate a batch of models. I've understand that is possible to modify some model specification in order to change the search range so, for example, given this specification: spec_lin <-…
Ilproff_77
  • 207
  • 1
  • 3
  • 17
2
votes
1 answer

Tidymodels + Spark

I'm trying to develop a simple logistic regression model using Tidymodels with the Spark engine. My code works fine when I specify set_engine = "glm", but fails when I attempt to set the engine to spark. Any advice would be much…
Dean
  • 168
  • 8
2
votes
1 answer

Tidymodels Error: Can't rename variables in this context

I recently picked up Tidymodels after having used R for a few months in my school. I was trying to make my first model using the Titanic Dataset on Kaggle, but ran into some issues when fitting the model. Could someone help me? titanic_rec <-…
2
votes
1 answer

Missing data after step_naomit in fit_resamples

I am currently applying the following recipe and workflow in order to fit a Random Forest using 5 folds cross validation using fit_resamples. The workflow looks something like this: library(tidymodels) # import data and convert response to…
anddt
  • 1,589
  • 1
  • 9
  • 26
2
votes
1 answer

step mutate fixed value to a list of variables in tidymodels

I wonder if could be possible to mutate variables inside my recipe taking a list of variables and imputing a fixed value (-12345) when NA is found. No success so far. my_list <- c("impute1", "impute2", "impute3") recipe <- recipes::recipe(target…
Forge
  • 1,587
  • 1
  • 15
  • 36
2
votes
1 answer

How to reduce the size of a preprocessing recipe object in r?

I am preprocessing a dataset with the R recipes packages, doing Yeo-Johnson transformation to make it more normally distributed and then scaling to standardize it. After that I want to reduce the size of the recipe object, I use the butcher package.…
2
votes
1 answer

Example of the tidymodels for fine tuning is still running

I am new to the tidymodels package. I was trying to understand how to fine tune many models and I found an example. I was running it and then at this step, grid_ctrl <- control_grid( save_pred = TRUE, parallel_over = "everything", …
Quynh-Mai Chu
  • 165
  • 1
  • 9
2
votes
1 answer

How to tune a tidymodels recipe parameter?

Description I am trying to tune a custom parameter in a recipe but I am having trouble to do so. I was under the impression that this is only a matter of calling tune("variableID") in the recipe and then use tune_grid() with a grid that contains a…
AlbertRapp
  • 408
  • 2
  • 9
2
votes
1 answer

R tidymodels / VIP variable importance determination

Via tidymodels and the vip package in R, I computed the variable importance. Code wise it would look like this: rf_vi_fit %>% pull_workflow_fit() %>% vip(geom = "point") + labs(title = "Random forest variable importance") Visually it would look…
Kylian
  • 319
  • 2
  • 14
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
  • 131
  • 7
2
votes
1 answer

How does tidymodels initial_split function deal with a strata variable that is continuous?

Using the R dataset diamonds, I was wondering how the initial_split function stratifies the continuous variable "x" in order to a create test and training set? ie initial_split(diamonds, probability=0.8, strata=x). I had read that the continuous…
Andrew
  • 111
  • 4
2
votes
2 answers

How to apply the trained & tested random forest model to a new dataset in tidymodels?

I have trained and tested a random forest model in R using tidymodels. Now i want to use the same model to predict a completely new dataset (not the training dataset). For example Julia silge, had explained the steps to train, test and evaluate a…
Betel
  • 151
  • 7