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

Academic regression tables in the tidymodels workflow?

Is there any way to create a stargazer::stargazer() style (or something close to it) coef table using a broom::tidy() object? I have tried gt() but it doesn't seem tailored for publication-ready LaTeX/Rmd tables.
Rob Lytle
  • 5
  • 2
0
votes
1 answer

Removing strata variable from predictions results

I built a prediction model using logistic regression which works well. But when I analyze the estimates calculated on the test dataset, I can see the variable I used to stratify the split comes up when I want it to be excluded of the model as a…
0
votes
1 answer

`Augment()`ing `coxph()` output in a tidymodels workflow?

I'm trying to find an efficient way to create a dataset that contains the original data, coefficient estimates, model fit, and fitted observations from a coxph() survival model. Currently, my code looks like this: ex_model <- lung%>% #lung dataset…
Rob Lytle
  • 5
  • 2
0
votes
3 answers

Fit a model on each group and evaluate it using data from all rows not in this group, R

I want to fit a model using data from each group in a dataframe. Then I want to use this model to predict it to all data in the dataframe that was not in the group and compute a metric like the RMSE. I have some issues to wrap my head around how I…
Lenn
  • 1,283
  • 7
  • 20
0
votes
1 answer

How to plot a tree with xgboost and decision_tree in r?

I am trying to plot a decision tree in R after using tidymodels workflow but I have trouble finding the good function to use and/or the good model. After a code like this, how do you code a plot? xgboost_spec <- boost_tree(trees = tune(), min_n =…
RCchelsie
  • 111
  • 6
0
votes
0 answers

Error using tidymodels and stacks: Location 3 doesn't exists

While using tidymodels and stacks, got the exact same error as FatBertLee trying to predict: Error: Can't subset columns that don't exist. x Location 3 doesn't exist. i There are only 2 columns. Run `rlang::last_error()` to see where the error…
0
votes
1 answer

How can I extract my classifier's predictions on individual data points under the tidymodels framework?

I'm working on a text classification project, and I've been doing everything under the tidymodels framework. Right now, I'm trying to investigate whether or not particular data points are being consistently mislabeled across the board. To do this, I…
0
votes
1 answer

Error in rmse(., truth = variable, estimate = .pred) : unused arguments (truth = , estimate = .pred) in R Tidymodels (yardstick)

I am Fitting a regression tree model, using this Tidymodels tutorial. # Create a specification tree_spec <- decision_tree() %>% set_engine("rpart") # Create an engine reg_tree_spec <- tree_spec %>% set_mode("regression") # Fit the…
Anakin Skywalker
  • 2,400
  • 5
  • 35
  • 63
0
votes
1 answer

How to view cross validated resample data in r?

I am new to tidymodels & fairly new to R as well. I created a recipe using tidymodels which worked well on train data but is giving an error on cross validated resamples. So I would like to view the resamples but they are not in simple df…
ViSa
  • 1,563
  • 8
  • 30
0
votes
0 answers

Getting error when trying to apply tidymodels recipe from train data to resamples in r?

I am new to tidymodels and somewhat new in R as well. I am trying to replicate code of David Robinson from Youtube tidytuesday/Sliced Customer churn data but facing issues in applying recipe changes on cross validated data / resamples. Issue: When I…
ViSa
  • 1,563
  • 8
  • 30
0
votes
1 answer

In tidymodel autoplot getting error: Error in pset$object[[which(pset$id == x_col)]] : attempt to select less than one element in get1index

I am new to tidymodels & was trying code from David Robinson Sliced Customer Churn episode but getting some errors. Issue: When I try to do autoplot() after creating a model then I get this error: Error in pset$object[[which(pset$id == x_col)]] :…
ViSa
  • 1,563
  • 8
  • 30
0
votes
1 answer

Tidymodels - How to correctly use verbose = TRUE in control = control_grid

I am trying to use verbose = TRUE to see the progress of the tuning grid. It does not seem to work for me, do I have it in the wrong spot or am I using it incorrectly? At the bottom is a screenshot of what I want and below is reproducible code that…
Indescribled
  • 320
  • 1
  • 10
0
votes
1 answer

How can I get coefficients of a parsnip multinomial logistic regression model with vfold_cv?

I do resamples_fit with work_flow() and V-Fold Cross-Validation. My model is logistic regression. How can I get coefficients of a parsnip logistic regression model with V-Fold Cross-Validation? If my V-Fold Cross-Validation v=5, I want to get the 5…
Ken
  • 1
0
votes
1 answer

Error: The first argument to [fit_resamples()] should be either a model or workflow

Problem: I'm following a tutorial from Julia Silge (link here) on using tidymodels and recipes. I can get most of the way through without a problem but when I come to calling the fit_resamples() function I get the error: Error: The first argument to…
C.Robin
  • 1,085
  • 1
  • 10
  • 23
0
votes
1 answer

How to use different engine parameters for each fold with tidymodels during crossvalidation?

I would like to use tidymodels to tune a ranger random forest in a crossvalidated setup. My dataset is unbalanced. Because of that I would like to use the ranger parameter class.weights. However, each fold can have different weights. How can I pass…
user2894356
  • 141
  • 1
  • 10