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

Tidymodels Workflow working with add_formula() or add_variables() but not with add_recipe()

I encountered some weird behavior using a recipe and a workflow to descriminate spam from valid texts using a naiveBayes classifier. I was trying to replicate using tidymodels and a workflow the results the 4th chapter of the book Machine learning…
Alix TC
  • 57
  • 6
2
votes
0 answers

How do you use more available cores when using DoParallel to tune models on tidymodel

I'm tuning some random forest models using ranger in tidymodels. I have a fairly large dataset with many columns. As a result, I set up a digital ocean droplet for tuning/trainng using instructions from Danny Foster's article: R on Digital Ocean.…
Mutuelinvestor
  • 3,384
  • 10
  • 44
  • 75
2
votes
2 answers

how to add custom step in recipe

I want to transform my features for a machine learning model using a custom transformation. my function is : step_customFunc <- function(x){ 1/(max(x+1) -x)} Is there a way to add this in the pipeline of transformation using recipe and tidymodels…
2
votes
0 answers

Shap values for xgboost model in tidymodels

I have trained an XGBoost model through the tidymodels metapackage. I would like some assistance in calculating SHAP values for the model or on how to use the SHAP/fastSHAP packages with the model TNX M
2
votes
1 answer

why should the models used by modeltime_table be adjusted on the training data when applying modeltime_fit_resamples ?( modeltime )

When working with time series through the modeltime / tidymodels framework, the following workflow is presented to verify the performance of the models with cross…
2
votes
1 answer

GLM Family using tidymodels

I am trying to use the tidymodels package for a GLM and want to use the Gamma or Poisson distribution. Using glm I would use something like the following # using glm mdl <- glm(data = data, y ~ x, family = Gamma(link = "inverse")) mdl <- glm(data =…
David
  • 9,216
  • 4
  • 45
  • 78
2
votes
1 answer

Tidymodels(Fitting a random forest with fit_samples()): Fold01: internal: Error: Must group by variables found in `.data`

Overview I have produced a random forest regression model, and, my aim is to fit the model using the function fit_samples() function, and then tune the hyperparameters. However, I am experiencing this error message below: Error Message: ! Fold01:…
Alice Hobbs
  • 1,021
  • 1
  • 15
  • 31
2
votes
1 answer

Add (or override) fill aesthetic to a ggplot2 autoplot function

I would like to add a fill aesthetic to an autoplot function. Specifically, to the autoplot.conf_mat function from the yardstick package. library(tidyverse) library(tidymodels) data("hpc_cv") cm <- hpc_cv %>% filter(Resample == "Fold01") %>% …
JasonAizkalns
  • 20,243
  • 8
  • 57
  • 116
2
votes
1 answer

In R recipe with condition to update roles does not work

If variable_names contains names I want to update the role of those to become Not_predictors; whereas if variable_names is NA I want to skip this step within a function. However, when adding the condition I get and error. Please see repex code…
Oscar Kjell
  • 1,599
  • 10
  • 32
2
votes
2 answers

In r with tidymodels: Warning message: "All models failed in [fit_resamples()]. See the `.notes` column." internal: Error: In metric: `roc_auc`

I am new in R and trying to learn tidymodels. I am getting this error only with glm for iris dataset and if I change dataset & recipe then glm is running fine but then I start to get this error in kknn. Warning message: "All models failed in…
ViSa
  • 1,563
  • 8
  • 30
2
votes
1 answer

Selecting only ordered factors in recipes for tidymodels

I need to create a recipe using the recipes package from tidymodels. In one of the steps, I need to convert ordered factors to their ordinal score. But there seems to be no function that I can use in order to select all ordered factors. I know that…
tikysal
  • 21
  • 1
2
votes
1 answer

How to figure out which column names are illegal in ranger?

Here is a ranger call: rf_fit <- rf_mod %>% fit(my_outcome_factor ~ ., data = data_train) and the output: Error in parse.formula(formula, data, env = parent.frame()) : Error: Illegal column names in formula interface. Fix column names or…
dfrankow
  • 20,191
  • 41
  • 152
  • 214
2
votes
1 answer

tidymodels metric_set:Error: All inputs to `metric_set()` must be functions. These inputs are not: (2)

I have used recipe()function in tidymodels packages for imputation missing values and fixing imbalanced data. here is my data; mer_df <- mer2 %>% filter(!is.na(laststagestatus2)) %>% select(Id, Age_Range__c, Gender__c, numberoflead,…
Ozgur Alptekın
  • 505
  • 6
  • 19
2
votes
1 answer

tidymodel recipe and `step_lag()`: Error when using `predict()`

This may be a usage misunderstanding, but I expect the following toy example to work. I want to have a lagged predictor in my recipe, but once I include it in the recipe, and try to predict on the same data using a workflow with the recipe, it…
mpettis
  • 3,222
  • 4
  • 28
  • 35
2
votes
0 answers

Tidypredict does not incorporate Recipes

I fit a model with logistic regression by tidymodels. The function tidypredict_fit extract the formula but I note that it does not incorporate the preprocess in the recipes. How can I extract the model formula with the necessary preprocess? …