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
4
votes
3 answers

Cannot run ANOVA to Compare Random Forest Models

I am using tidymodels to fit multiple Random Forest models. I then followed along with this tutorial to compare the model results. The problem is that I get the error: Error in UseMethod("anova") : no applicable method for 'anova' applied to an…
Adam_G
  • 7,337
  • 20
  • 86
  • 148
4
votes
1 answer

ggparty and tidymodels, cannot plot final node graphs, no data attached to model(?)

I am playing with tidymodels workflow for ctree with new bonsai package, an extension for modeling with partykit, here is my code: pacman::p_load(tidymodels, bonsai, modeldata, finetune) data(penguins) doParallel::registerDoParallel() split <-…
Jacek Kotowski
  • 620
  • 16
  • 49
4
votes
2 answers

Using purrr to fit many models using tidymodels

Still getting used to stackoverflow so apologies if this isn't posted correctly. Recently, I've found myself having to run many models with slightly different predictors to gauge model performance (I'm sure there's a more elegant way of doing this)…
Tony
  • 85
  • 6
4
votes
1 answer

Why does deploying a tidymodel with vetiver throw a error when there's a variable with role as ID?

I'm unable to deploy a tidymodel with vetiver and get a prediction when the model includes a variable with role as ID in the recipe. See the following error in the image: { "error": "500 - Internal server error", "message": "Error: The following…
4
votes
1 answer

PCA, TidyModels; how to change rotation method in step_pca?

I'm trying to preform PCA (principal component analysis) using TidyModels. I have created a recipe but I don't know how can I change the default rotation used in `step_pca() method (such as changing it to say Varimax rotation). any ideas? this is my…
4
votes
1 answer

How to set the parameters grids correctly when tuning the workflowset with tidymodels?

I try to use tidymodels to tune the workflow with recipe and model parameters. When tuning a single workflow there is no problem. But when tuning a workflowsets with several workflows it always fails. Here is my codes: # read the training data train…
Kim.L
  • 121
  • 10
4
votes
1 answer

Tidymodels - Get predictions and metrics on training data using workflow/recipe

The code below works correctly and has no errors that I know of, but I want to add more to it. The two things I want to add are: 1 - Predictions of the model on the training data to the final plot. I want to run collect_predictions() on the model…
Indescribled
  • 320
  • 1
  • 10
4
votes
1 answer

Tidymodels: Classify as TRUE only if the probability is 75% or higher

I have a binary classification problem and used a random forest and a logistic regression. From the results of conf_mat, the collect_metrics() and collect_predictions I want to change my models to classify as TRUE only if the model is "sure" say 75%…
Mischa
  • 137
  • 8
4
votes
2 answers

Tidymodels: Creating an rsplit object from training and testing data

I’m trying to make the jump from Scikit-Learn to Tidymodels and most of the time it has been relatively painless thanks to the tutorials from Julia Silge and Andrew Couch. However, now I’m stuck. Normally I would use initial_split(df, strata = x) to…
Economist
  • 173
  • 8
4
votes
1 answer

How to extract GLMNET coefficients produced by Tidymodels

I estimated a glmnet logistic regression using tidymodels. But I couldn't figure out 2 things, which are closely related, in tidymodels: a) how to extract the estimated coefficients b) save the estimated model for future production use. Below are…
nyk
  • 670
  • 5
  • 11
4
votes
2 answers

Implementing loo_cv from rsample in tidymodels

I'm new to tidymodels syntax and would like to implement leave one out cross validation using loo_cv from rsample in a tidymodel framework. However, the implementation seems different from vfold_cv and I can't find any helpful examples that…
Jordan
  • 614
  • 1
  • 7
  • 20
4
votes
1 answer

Error with tune_grid function from R package tidymodels

I've been reproducing Julia Silge's code from his Youtube video of Sentiment Analysis with tidymodels for Animal Crossing user reviews (https://www.youtube.com/watch?v=whE85O1XCkg&t=1300s). In minute 25, she uses tune_grid(), and when I try to use…
4
votes
2 answers

Predict with step_naomit and retain ID using tidymodels

I am trying to retain an ID on the row when predicting using a Random Forest model to merge back on to the original dataframe. I am using step_naomit in the recipe that removes the rows with missing data when I bake the training data, but also…
R_User123456789
  • 650
  • 7
  • 9
3
votes
0 answers

Custom metrics that relies on additional features in training data

How can I implement a custom metric that relies on additional features in training data? Below is an example for within R Squared with additional code reproduce the core issue. The implementation uses an additional argument called group for the name…
user2503795
  • 4,035
  • 2
  • 34
  • 49
3
votes
2 answers

Memory issues when obtaining TF-IDF data

Intro I am struggling with text classification of a big dataset of tweets and I would be thankful if someone could point me in the right direction. The big picture is that I need to train a classifier that would distinguish between two classes on a…
1
2
3
40 41