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
0
votes
1 answer

i can't figure out how to fix tidymodel error

# Partition the data: library(tidymodels) set.seed(1234) uni_split <- initial_split(suspicious_match, strata = truth) uni_train <- training(uni_split) uni_test <- testing(uni_split) uni_split ## Build a model recipe : library(themis) uni_rec <-…
M619
  • 1
  • 2
0
votes
1 answer

How to compute importance from a LM using Tidymodels in R?

I am trying to compute variable importance on a linear model using tidymodels. As far as I can tell, the vip package is used to extract the importance when using tidymodels. For example, If I wanted to extract importance from a random forest…
Electrino
  • 2,636
  • 3
  • 18
  • 40
0
votes
0 answers

Prediction Intervals from Quantile Regression Forests have higher coverage than expected?

Question: What factors may cause the prediction interval to have wider coverage than would be expected? Particularly with regard to quantile regression forests with the ranger package? Specific Context + REPREX: I am using quantile regression…
0
votes
1 answer

Can the out of bag error for a random forests model in R's TidyModel's framework be obtained?

If you directly use the ranger function, one can obtain the out-of-bag error from the resulting ranger class object. If instead, one proceeds by way of setting up a recipe, model specification/engine, with tuning parameters, etc., how can we extract…
0
votes
1 answer

How do workflows in TidyModels apply recipe steps to CV folds?

To control for a minority positive class for the project I'm working on, I'm implementing step_downsample() in my recipe. I'm also using 10-fold cross-validation to mitigate bias. When I use a workflow to wrap up the learner, recipe, a grid search,…
Jeffrey Brabec
  • 481
  • 6
  • 11
0
votes
0 answers

class probability column for yardstick::roc_cruve

I have a doubt regarding the column to pass when calling roc_curve. If you look at the example provided at https://www.tidymodels.org/start/recipes/#predict-workflow you can see that the argument provided is .pred_late. flights_pred %>% …
Jorge
  • 137
  • 4
0
votes
1 answer

How to add beta parameter to F1 Score for fit_resample in TidyModel

I am using the fit_resamples() function in TidyModels to get the F1 metrics as below. I would like to know how to pass the beta parameter whose default is set at 1 at the moment. glm_workflow %>% fit_resamples(resamples = trainDatFolds, …
Zarni
  • 109
  • 6
0
votes
2 answers

Extract plain model from tidymodel object

Is it possible to extract, say, a model of class glm from a tidymodel built with recipe and logistic_reg() %>% set_engine("glm")? I'd like to use packages from the easystats project, which require "normal", non-tidy models. The workflow extractor…
Marco B
  • 121
  • 6
0
votes
1 answer

Difference in output between predict.rpart and predict.glm

I split a dataset up in a training and test sample. I then fit a logit model on the training data to predict the outcome of the test sample. I can do this in two ways: Using Tidyverse: logit_mod <- logistic_reg() %>% set_mode("classification") %>%…
JKuhn
  • 3
  • 2
0
votes
1 answer

Purrr map to add analysis output to df

I have asked a very similar question recently here - lapply instead of for loop for randomised hypothesis testing r But I now require a more simple output, and I'm struggling to tweak the previously suggested (and super helpful) code. So, I have…
Jamie Dunning
  • 153
  • 1
  • 9
0
votes
0 answers

Differences between ROC Curve and Confusion Matrix: R Tidymodels, XGBoost

I'm running an XGBoost binary classification model with Training 375 observation and 125 Testing observations and 19 features. Below are my arguments: Boosted Tree Model Specification (classification) Main Arguments: mtry = 13 trees = 100 …
Curtis
  • 159
  • 7
0
votes
1 answer

How to use Nest and mutate to create a model from training set and then apply it on a test data in R (tidymodels)

library(tidymodels) Train %>% nest(-Groups) %>% mutate(fit=map(data,~lm(X~Y+Z,x=.)), augmented = map(fit,augment), predict = map2(fit,Y,Z)) %>% unnest(augmented) %>% select(-data) This works perfectly…
0
votes
0 answers

extracting a cv.glmnet object from Tune_results

Hi I am using tidy models and trying to generate a plot with RMSE as a function of log lambda with number of features along the top as posted below, if you are using glmnet you simple call plot on your cv.glmnet object and it will plot, However if…
0
votes
1 answer

How to capture the names of multiple arguments (...) passed to a function?

I have a couple of models that are passed by a function, the number of models is variable. Through (...) I can pass all the models as follows: library(tidymodels) library(dplyr) model_1 = decision_tree(mode = "regression") %>% set_engine("rpart")…
0
votes
1 answer

R tidymodels recipes near zero variance filter for numeric attributes

I have troubles to use the step_nzv in R tidymodels recipes to filter out numeric attributes with small variances but continuous values. To me it seems, that the step applies only for nominal values, as it calculates the number of unique values and…
Lukas
  • 1