Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

colino & caret compatibility #10

Open
cadam00 opened this issue Mar 23, 2024 · 0 comments
Open

colino & caret compatibility #10

cadam00 opened this issue Mar 23, 2024 · 0 comments

Comments

@cadam00
Copy link

cadam00 commented Mar 23, 2024

Hi,
I observed a compatibility issue of your package function colino::step_select_boruta when using it on caret::train...
What to do?
Thanks a lot!!!!

library(caret)
library(colino)
library(doParallel)

set.seed(42)

## A dummy dataset
dataset <- mtcars
dataset$am <- as.factor(dataset$am)
levels(dataset$am) <- c("zero","one")

## Despite the colino::step_select_boruta working for a dataset
rec_boruta <-
 recipe(am ~ ., data = dataset) %>%
 colino::step_select_boruta(all_predictors(), outcome = "am")

prepped <- prep(rec_boruta)
prepped

cl <- makePSOCKcluster(detectCores())
registerDoParallel(cl)

## It is not working for caret::train
fit_model <- train(rec_boruta,
                   data = dataset,
                   method = "glm")

# Error in { : task 1 failed - "$ operator is invalid for atomic vectors"

## But caret::train is working for other step like recipes::step_corr
rec_corr <-
 recipe(am ~ ., data = dataset) %>%
 step_corr(all_predictors())

fit_model <- train(rec_corr,
                   data = dataset,
                   method = "glm")
@cadam00 cadam00 changed the title colino & caret compatibiliyu colino & caret compatibility Mar 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant