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
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
  • 85
  • 1
  • 3
3
votes
1 answer

Can't seem to remove variables in recipes

I'm new to recipes and having some issues with the API. Why can't I bake or juice my recipe steps when I've removed certain features that I'm not interested in? set.seed(999) train_test_split <- initial_split(mtcars) mtcars_train <-…
Zafar
  • 1,897
  • 15
  • 33
2
votes
0 answers

Prevent tidymodels from turning numeric to chr

Apologies if this has been asked before, but I was unable to find the corresponding info. I am using the recipe from tidymodels and trying to create a model (eventually). As I prepped my this is effectively what it looked like (apologies, I can't…
2
votes
1 answer

logistic_reg() estimates in tidymodels interpretation seem to be predicting incorrect class as positive outcome

I am using tidymodels to develop a logistic regression using the Palmer's Penguins dataset. I believe that female should be the reference class since it is the first level of my outcome variable, and therefore a positive outcome for the model should…
2
votes
1 answer

How can I pass an extra variable to a tidymodels fit function?

I am writing a tidymodels engine to fit the joint LASSO described here and implemented in the fuser package. This is a LASSO model for regression that allows partial sharing of information between groups, in this case tissues in a biomedical RNAseq…
alan ocallaghan
  • 3,116
  • 17
  • 37
2
votes
1 answer

Resamples (folds) for cross-validation in R

I'm using tidymodels framework for creating stratified resample folds for cross-validation in a random forest model. Is it possible to actually access and view / plot the data within each of these folds? Reproducible code…
jaykay
  • 71
  • 7
2
votes
1 answer

How to speed up the tidymodels bootstrapping with parallelization

I have the following code, that performs bootstrapping and calculates the confidence interval. library(resample) ibrary(broom) library(dplyr) library(purrr) library(tibble) lm_est <- function(split, ...) { lm(mpg ~ disp + hp, data =…
littleworth
  • 4,781
  • 6
  • 42
  • 76
2
votes
0 answers

tidymodels: f_meas metric_tweak error on metric_set

Using the iris dataset, a knn-classifier was tuned with iterative search for the purpose of multiple classification. However, an error is generated, when the macro-weighted version of f_meas (as created by metric_tweak) is used in metric_set. I…
2
votes
0 answers

Is there a metric for run times, or some other recommended way to collect runtimes when tuning a model in tidymodels?

I am using the tidymodels R package to fit a random forest model with the ranger engine, but I think this question is general to tuning any type of model tidymodels supports. When running my tuning grid, I would like to record the time it takes to…
bokov
  • 3,444
  • 2
  • 31
  • 49
2
votes
1 answer

Best method for running model with different variables combinations

I'm trying to fit a model with different combinations of the variables in my data. I want to find the best performing way to do so. There are a lot of similar questions (link, link, link, link, link, to list the most interacted with ones). Most of…
2
votes
1 answer

How do I extract a model fit from a tidymodels workflowset?

I am trying to learn tidymodels and DALEXtra.... I have successfully built a set of models with workflow_map: grid_results <- all_workflows %>% workflow_map( seed = 1503, resamples = the_folds, grid = 100, control =…
itsMeInMiami
  • 2,324
  • 1
  • 13
  • 34
2
votes
1 answer

plotting tidymodel rsults with roc_curve() receives numeric vs. character error

I am teaching myself how to use the excellent tidymodels collection of packages to practice machine learning. In the below example, I am basically trying to reproduce Julie Sigle's blog post here (https://juliasilge.com/blog/water-sources/) on using…
alejandro_hagan
  • 843
  • 2
  • 13
2
votes
1 answer

Compare performance of linear regression models that differ by predictors used using cross validation

I would like to compare, using tidymodels and cross-validation, 3 linear regression models that can be specified as the following: (model_A) y ~ a (model_B) y ~ b (model_AB) y ~ a + b In the following y will denote the target variable, while a and…
filebb
  • 23
  • 5
2
votes
1 answer

How to tune a model using grid search and a single validation fold with tidymodels?

I have just learnt about the KNN algorithm and machine learning. It is a lot for me to take in and we are using tidymodels in R to practice. Now, I know how to implement a grid search using k-fold cross-validation as follows: hist_data_split <-…
Ethan Mark
  • 293
  • 1
  • 9
2
votes
1 answer

How to plot a tree produced by C5.0 in tidymodels?

Why in the following short reprex I get an error for plotting a C5.0 tree when using tidymodels and I don't get same error when using C5.0 package directly ? I used the same C50 parameters in both cases. I tried to find documentation about this but…
Marc Kees
  • 206
  • 2
  • 15