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

Can tidymodels stacks cover models with differing features and missing values?

I've tried running this tidymodels workflow to see if I can combine two models, with different features and missing values. Being able to combine different data sources to model the same outcomes would be very handy for real world data, just not…
mkrasmus
  • 133
  • 11
0
votes
1 answer

Error when using initial_time_split with drake

Learning how to use drake with tidymodels. Something about using rsample's initial_time_split(), rather than just initial_split(), is giving me an error, when I run make(plan). I get the following: #> > target data #> > target split_data #> Error in…
0
votes
1 answer

Fastest way to extract a model object from fit_resamples() results

This question if for tidymodels user, and if you are lazy, just skip the entire text and jump right to the bold question below Im looking for the most efficient way to extract my parsnip model object from fitted resamples…
user12967444
0
votes
1 answer

R Subset Inner Levels Nested Dataframe

While using rsample, tidymodels, I create the resamples with the following code (see below). Though I don't want to assess the model with all horizon positions, in the presented case from 1 to 5. Let's say I want to assess the model only for 4 and 5…
oprick
  • 21
  • 4
0
votes
0 answers

Tidymodels error with fit. Error: `x` and `y` must have same types and lengths

I have the following code: library(tidymodels) library(tidyverse) rps <- tribble( ~estado, ~comp_move, ~move, "gana", "piedra", "papel", "pierde", "papel", "piedra", "pierde", "papel",…
0
votes
1 answer

Models failing while trying to tune xgboost hyperparameters in R Tidymodels

I am not sure where I am going wrong. When I run the following the models within the tuning grid are failing. I get this Warning message: 'All models failed in tune_grid()'. Any help will be very much appreciated. # PREPROCESSING -- RECIPE…
landrower
  • 475
  • 6
  • 11
0
votes
1 answer

set max depth for tuning ranger in random forest tidymodels r

I would like to tune the depth of my random forest to avoid overfitting. I am using tidymodels and this is my model code. rf_model <- rand_forest(mtry = tune(), trees = tune(), max.depth = tune())…
Moshee
  • 544
  • 1
  • 3
  • 16
0
votes
1 answer

Tidymodels Recipe Package Use step_normalize On List Of Variables

I want to normalize only an arbitrary selection of variables using step_normalize from the recipe package (tidymodels). Unfortunately I can't find a selection function that seems to work within the step_normalize which selects a list of…
tover
  • 535
  • 4
  • 11
0
votes
1 answer

purrr: Group by (nest) and bootstrap

I calculated the mean of bootstrap samples for mpg variable from mtcars dataset. My code looks like this (Please, let me know if there's a "better practice" to do it.): mean_mpg <- function(x) { rsample::analysis(x) %>% pull(mpg) %>% …
mihagazvoda
  • 1,057
  • 13
  • 23
0
votes
1 answer

Multinomial (nnet) does not work using parsnip and broom

I'm trying to run a multinomial (nnet) using tidymodel, but it shows me the next result: Error: object of type 'closure' is not subsettable data(iris) ml<-multinom_reg() %>% set_engine("nnet") %>% set_mode("classification") %>% …
0
votes
1 answer

tidymodels recipe: Using all_of to select variables stored in a vector

I would like to use a vector with column names for a variety of step functions in the tidymodels recipe package. My intuition was simply to use (the prep and juice just used here for…
Moritz Schwarz
  • 2,019
  • 2
  • 15
  • 33
0
votes
1 answer

Unable to train Poisson glmnet with categorical predictors using tidymodels package

My goal is to fit a Poisson glmnet using the tidymodels package. For this purpose, I use the recipes package to preprocess the data, parsnip to fit the model, workflows to bundle the model with the preprocessor and poissonreg to be able to use…
0
votes
1 answer

step_num2factor() Usage -- Tidymodel (Recipe Package)

Well, I've read the function reference for step_num2factor and didn't figured it out how to use it properly, honestly. temp_names <- as.character(unique(sort(all_raw$MSSubClass))) price_recipe <- recipe(SalePrice ~ . , data = train_raw)…
0
votes
1 answer

Tidy a object of class _lm

Reference : Get Started With TidyModels I can not tidy a model of class _lm to tidy. The exact code of the new tidymodel.org Get Started site is used and generates an error. My guess is that there is some package update I need. Error: No tidy…
Harlan Nelson
  • 1,394
  • 1
  • 10
  • 22
0
votes
1 answer

Update model parameters using parsnip without re-specifying arguments for the fit function

I'm experimenting with the parsnip package using the Titanic dataset. library(titanic) library(dplyr) library(tidymodels) library(rattle) library(rpart.plot) library(RColorBrewer) train <- titanic_train %>% mutate(Survived = factor(Survived), …
Willy
  • 497
  • 3
  • 10
1 2 3
40
41