Questions tagged [r-recipes]

recipes is an R package by Max Kuhn and Hadley Wickham for creating and preprocessing design matrices.

recipes is an R package by Max Kuhn and Hadley Wickham for creating and preprocessing design matrices.

131 questions
0
votes
1 answer

What is the purpose of standardization after one-hot encoding?

I was reading a tutorial for tidymodels and came across the following code block: lr_recipe <- recipe(children ~ ., data = hotel_other) %>% step_date(arrival_date) %>% step_holiday(arrival_date, holidays = holidays) %>% …
0
votes
1 answer

Multi-label support Tidy models and recipes in r

Is there support for multi-label data in the tidymodels ecosystem? I don't seem to be able to specify the model formula to include the various columns that we need to train/predict. Some classifiers seem ok with a string but most seem to want one…
rwhit
  • 45
  • 6
0
votes
1 answer

Use select function and row sum in a recipe with Tidymodels in R

I have a dataframe where I want to divide a specific set of predictors by the number of predictors larger than zero (also from that specific set). When I try to include this operation in a recipe, it seems to divide by the total number of predictors…
ThePhil
  • 11
  • 2
0
votes
1 answer

Can't update role of mutated variables

Background I'm using the R package {recipes} for data preprocessing. Assume that I would like to transform some variable and then declare the transformed variable as the outcome variable for modeling. Problem and minimal example: However, an error…
Sebastian Sauer
  • 1,555
  • 15
  • 24
0
votes
0 answers

Including a step STM in textrecipes

How can I use STM in textrecipes? (tidymodels workflow) I need this for my master's degree where I use textrecipes as the main package. The link https://www.tidymodels.org/learn/develop/recipes/ shows how to create a new step in my recipe, but I…
0
votes
1 answer

Error in step_fourier from timetk package

I have the following error when using the step_fourier function. This error only occurs when I use time_series_split split with my data to convert paneled time series into training and testing sets. When I input the dataset directly, the error does…
0
votes
1 answer

Only keep interaction term in recipe formula

I'm trying to create a formula that has a variable interacted with another variable in the final formula, but not the main effects of the variable on its own. I can't figure out how to do this with recipes. In base R I can specify which interactions…
Declan
  • 3
  • 2
0
votes
1 answer

R Tidymodels/Embed recipe "step_woe" not working

I'm trying to add a "step_woe" step to a recipe, where previously i added a "step_discretize_xgb" but i keep getting an error message because of the variables types i need to transform with the step_woe. Here's a short example of my code, with only…
Filipa
  • 50
  • 6
0
votes
1 answer

step_downsample - I am having trouble using the function despite installing packages, copy code from online

I am working on preprocessing and using the step_downsample from recipe on my training set to reduce imbalances between nominal variables. I am using a version of the Fair's Affairs dataset. The first step I have taken is intial split, train and…
ZRC
  • 1
0
votes
1 answer

What is causing the loss function to be nan in the tidymodels specification?

I'm tackling a problem for this dataset. I am trying to build a model to predict Japan sales from every other predictor (except Rank, Name and Global Sales which is too correlated with the outcome variable). So, I did: vgames <-…
0
votes
1 answer

What models currently support multivariate regression in tidymodels?

I was checking tidymodels for multivariate regression and saw this example here: https://www.tidymodels.org/learn/models/pls/ This covers multivariate for Partial Least Squares model. Is there a page that states what models currently support…
0
votes
2 answers

Same Recipe and Model with Different Outcomes

I have a dataset with multiple columns for the outcome variables that I would like to predict with the same preprocessing steps and models. Is there a way to run the same recipe and models (with tuning - I'm using workflow_map()) on multiple outcome…
nrjenkins
  • 13
  • 3
0
votes
1 answer

Feature elimination to screen for multiple models using tidymodels

I am currently performing regression modeling, with a dataset that has number of features (p) higher than observations (n). Typically p = 10000 and n = 30. Furthermore, I'd like to test many models and find the best one. What I'm doing now is first…
littleworth
  • 4,781
  • 6
  • 42
  • 76
0
votes
1 answer

Error in UseMethod("filter") : no applicable method for 'filter' applied to an object of class "NULL"

I am actually using Tidymodels package on R to study a multi-class classification problem. I have trained several models using Workflow sets, and in my recipe I added a step taken there to replace NA values with a constant. The models that I…
0
votes
2 answers

How to deal with a column with only one value?

How to add a step to remove a column with constant value? I am facing a related problem so referencing the previous article above. I used step_zv() in my recipe but I still get the following error- Error in bake(), Only one factor in Column 'X33':…
1 2 3
8 9