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
0 answers

How to make tidymodels or workflow results work with DALEX explain?

I want to use modelStudio and for that I need to make explainer using DALEX::explain() that takes model object as an argument. I should, but I am not sure how to provide the entire reproducible example code with data here! When I use the following…
Geet
  • 2,515
  • 2
  • 19
  • 42
2
votes
1 answer

Tuning ridge regression with tidymodel using nested resampling

I want to tune a ridge regression using tidymodels. I have looked at this nested sampling tutorial, but not sure how to increase the tuning from one to two hyperparameters. Please see example below: Example data: library("mlbench") sim_data <-…
John
  • 309
  • 3
  • 12
2
votes
1 answer

Configuring XGBoost poisson regression with offset in Parsnip

I am trying to use parsnip to specify a recipe to fit an xgboost poisson regression model with a log offset. To set-up a poisson regression I can specify an option in set_engine, which works nicely: # Specify recipe my_recipe <- recipe(training_df,…
Anthony W
  • 1,289
  • 2
  • 15
  • 28
2
votes
1 answer

Tidymodels recipes - add a step that just applies a feature engineering function?

A lot of feature engineering steps are transforms that do not need to be 'trained' on a dataset, for example, creating a new column x2 as x2=2*x1. These 'static transforms' are different are 'trainable' transforms such as demean and rescale. Instead…
2
votes
1 answer

Integration of Variable importance plots within the tidy modelling framework

Could somebody show me how to generate permutation-based variable implots within the tidy modelling framework? Currently, I have this: library(tidymodels) # variable importance final_fit_train %>% pull_workflow_fit() %>% vip(geom = "point", …
2
votes
1 answer

Map Tidymodels process to a list/group by or nest

I REALLY like tidymodels, but I'm unclear how I could fit that model workflow on something like a nested group by. As an example, tidyr outlines a simple nest on something like cylinder from mtcars, and then fits a unique linear reg model to each…
ben87
  • 65
  • 5
2
votes
2 answers

Large standard error of prediction from parsnip vs base R

It seems like predict is producing a standard error that is too large. I get 0.820 with a parsnip model but 0.194 with a base R model. 0.194 for a standard error seems more reasonable since about 2*0.195 above and below my prediction are the ends of…
Levi Baguley
  • 646
  • 1
  • 11
  • 18
2
votes
1 answer

How to de-normalize data with tidy-models in r

With tidymodels as the new workflow for developing models in R, how do I denormalize/Invert Power transformation data using tidymodels. dd <- data.frame(x1=1:5,x2 = 11:15,y=6:10). Now using the tidy model framework: model_recipe <- recipe(y ~ .,…
Azam Yahya
  • 646
  • 1
  • 7
  • 10
2
votes
2 answers

Computing importance measure using VIP package on a parsnip model

I am trying to compute feature importance using vi_firm() on a logistic regression model made in parsnip. For regex, I will use the iris dataset and try to predict whether an observation is setosa or not. iris1 <- iris %>% mutate(class =…
Anthony
  • 105
  • 7
2
votes
0 answers

Mixed effects machine learning regression models

I wanted to ask you if it is possible to use machine learning in data with longitudinal structure (mixed effects) when the package is in R tidymodels? Thank you.
2
votes
1 answer

Issues after installing tidymodel and dependent packages in R

I was trying to use tidymodels and while installing this package it also installed certain dependent packages I would assume. Post that I have been getting this error whenever I run some dplyr based standalone code or my shiny app which was working…
SNT
  • 1,283
  • 3
  • 32
  • 78
2
votes
1 answer

Why does an "id variable" in tidymodels/recipes play a predictor role?

This is the same issue as Predict with step_naomit and retain ID using tidymodels , but even though there is an accepted answer, the OP's last comment states the issue the "id variable" is being used as a predictor, as can be seen when looking at…
ap53
  • 783
  • 2
  • 8
  • 19
2
votes
1 answer

How to apply update_role (or a step) function from recipes to multiple columns

I'm using the recipes package from tidymodels. I'm trying to update_role for a few columns at the same time. Example: library(recipes) library(dplyr) cols_to_update = list() cols_to_update[["a"]] <- c("mpg", "cyl") mtcars %>% recipe() %>% …
mihagazvoda
  • 1,057
  • 13
  • 23
2
votes
2 answers

Nonlinear mixed effect models with self-starting function and purrr

I have used nlme to fit and compare nonlinear models in the past. I would now like to use it to fit models to data that are grouped by more than one identifier. It would be great if I could integrate dplyr, purrr, and nlme. One of the nice things…
Nazer
  • 3,654
  • 8
  • 33
  • 47
2
votes
2 answers

yardstick::rmse on grouped data returns error and incorrect results

I wanted to evaluate the performance of several regression model and used the yardstick package to calculate the RMSE. Here is some example data model obs pred 1 A 1 1 2 B 1 2 3 C 1 3 When I run the following…
markus
  • 25,843
  • 5
  • 39
  • 58