Open larry77 opened 8 months ago
I would like to add that this happens also with the (much simpler)
use_glmnet(body_mass_g ~ ., data = penguins)
Unlike what shown in the example here
Any reaction on this? It actually affects every model in the package.
Please @larry77, give a .csv as input instead. I can't reproduce your example (I use 0.2.0.9000 version)
library(tidymodels)
library(usemodels)
df_train <- tibble(
close = c(71.37752, 72.92498),
high = c(73.50968, 73.35770)
)
use_glmnet(close ~ ., data = df_train)
glmnet_recipe <-
# recipe(formula = close ~ ., data = df_train) %>%
# step_zv(all_predictors()) %>%
# step_normalize(all_numeric_predictors())
# glmnet_spec <-
# linear_reg(penalty = tune(), mixture = tune()) %>%
# set_mode("regression") %>%
# set_engine("glmnet")
# glmnet_workflow <-
# workflow() %>%
# add_recipe(glmnet_recipe) %>%
# add_model(glmnet_spec)
# glmnet_grid <- tidyr::crossing(penalty = 10^seq(-6, -1, length.out = 20), mixture = c(0.05,
# 0.2, 0.4, 0.6, 0.8, 1))
# glmnet_tune <-
# tune_grid(glmnet_workflow, resamples = stop("add your rsample object"), grid = glmnet_grid)
Hi! Indeed I think I now understand the situation. Just refer to the palmerpenguin example at
https://usemodels.tidymodels.org/index.html
1) if I use the cran version of usemodels (0.2.0), then the issue I mentioned persists, i.e. a regression problem is handled as a classification problem. 2) with the development version of usemodels (the one with the same version number as you mention), everything works fine.
Apparently there is a bug in the cran package which has been fixed in the development version. It would have been nice to have a word from the developers during the > 6 months since I opened this issue.
Please look at the reprex at the end of this issue. You can download the input data from
https://e.pcloud.link/publink/show?code=XZWXInZ683FG2Squ0bLeLRNaGnzxukG1Le7
(nothing dangerous).
I try to set up tidymodels + glmnet to predict a continuous, numerical variable ("close"), so why does usemodels give me a boilerplate for a classification model?
Created on 2024-03-06 with reprex v2.1.0