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

broom::tidy fails on multinomial regression

I'm trying to run a multinomial logistic regression in R using tidymodels but I can't convert my results to a tidy object. Here's a sample using the iris data set. # Multinomial ----------------------------------------------------------------- #…
kaseyzapatka
  • 149
  • 2
  • 9
3
votes
0 answers

Error with tune_bayes() about Gaussian Process being fit on no data

Description I am trying to use tune_bayes() to optimize two parameters in a decision tree but the function always crashes giving me a an error #> i Gaussian process model #> ! The Gaussian process model is being fit using 2 features but only has…
AlbertRapp
  • 408
  • 2
  • 9
3
votes
1 answer

Consistent "Error: All columns selected for the step should be numeric" in attempted LASSO model within R tidymodels

Trying to run my first LASSO model and running into a few issues. I have a medical dataset where I am trying to predict a dichotomous outcome (the disease) from about 60 predictors. I get as far as tuning the grid before I get the error "All columns…
Ryan
  • 51
  • 5
3
votes
3 answers

Error in LightGBM algorithm using tidymodels and treesnip package

I want to try the LightGBM algorithm using tidymodels and treesnip package. Some preproccessing... # remotes::install_github("curso-r/treesnip") # install.packages("titanic") library(tidymodels) library(stringr) …
Edvardoss
  • 393
  • 3
  • 8
3
votes
1 answer

Stepwise Algorithm in Tidymodels

I found that the Stepwise Algorithm for variable selection implemented natively in R with step() is not integrated in Tidymodels. I do not know if there is a reason for not using it (because of better procedures), or is it simply a lacking feature.
Marco Repetto
  • 336
  • 2
  • 15
3
votes
0 answers

Use parsnip to call glm.nb

Looking for a wrapper to call negative binomial from MASS package similar to possionreg available in the tidy models environment? Is there a way to call this.
HDX
  • 51
  • 1
3
votes
1 answer

Tidymodels Package: Visualising a random forest model using ggplot() to show the most important predictors

Overview I am following a tutorial (see below) to find the best fit models from bagged trees, random forests, boosted trees, and general linear models. Tutorial (see examples…
Alice Hobbs
  • 1,021
  • 1
  • 15
  • 31
3
votes
0 answers

Why is tidymodels with a ranger engine so much slower than ranger?

I'm taking a first look at tidymodels. My alternative for the current project would be non-tidyfied ranger. On a test run, classification random forest with tidymodels using the ranger engine is much slower than hand-held ranger (approximately ten…
lambdatau
  • 31
  • 3
3
votes
2 answers

Is there a way to group rows (especially dummy variables) in the recipes package in R (or ml3)

# Packages library(dplyr) library(recipes) # toy dataset, with A being multicolored df <- tibble(name = c("A", "A", "A", "B", "C"), color = c("green", "yellow", "purple", "green", "blue")) #> # A tibble: 5 x 2 #> name color #> …
JeromeLaurent
  • 327
  • 3
  • 10
3
votes
1 answer

How to make predictions in tidymodels R when the data has been preprocessed

Hi I am trying to make an example of a linear regression model using tidymodels, I manage to fit the model using the framework correctly and to test it within the workflow with collect_metrics() and collect_predictions(). However when I try to use…
3
votes
1 answer

Tidymodels Logistic Regression getting coefficients and standard errors

Is there a way to get the standard errors and p-values for logistic regression in tidy models? I can get the coefficients by the following code below.. but I want to calculate odds ratios for each feature and I will need the standard errors as…
Eisen
  • 1,697
  • 9
  • 27
3
votes
1 answer

How to do nested cross-validation with LASSO in caret or tidymodels?

Goal I'd like to implement a LASSO model and check its viability on a training set according to the schematic shown here. (Schematic destription: all data is split into testing and training sets. The training set is split via 5-fold cross-validation…
Shudras
  • 117
  • 2
  • 8
3
votes
1 answer

How can I get PCA cumulative proportion with Tidymodels?

I can apply PCA on the classic Iris dataset to obtain the cumulative proportion per dimension: library(tidyverse) x <- iris[,1:4] %>% as.matrix() pca <- prcomp(x) summary(pca) But I don't know how can I do that with tidymodels. My code so far…
Manu
  • 1,070
  • 10
  • 27
3
votes
0 answers

error with tune_grid function from tune r package (tidymodels) - Error: A `parameters` object has required columns

This is my very first question that I have posted on stack overflow. I have done my best to create a decent reprex using the reprex r package. Any feedback is appreciated. Here goes: I believe that the error is located at the very bottom of my…
3
votes
0 answers

library(tidymodels) not loading and not able to install rstanarm

Error received while trying to load tidymodels Error: package or namespace load failed for ‘tidymodels’ in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]): there is no package called ‘rstanarm’ Error received while…