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

coxph: cat_vars not working, when specifying via set_data #2

Open
kapsner opened this issue Jul 20, 2024 · 0 comments
Open

coxph: cat_vars not working, when specifying via set_data #2

kapsner opened this issue Jul 20, 2024 · 0 comments
Assignees

Comments

@kapsner
Copy link
Owner

kapsner commented Jul 20, 2024

cat_vars are not respected when specifying via set_data:

coxph_validator <- mlexperiments::MLCrossValidation$new(
  learner = mlsurvlrnrs::LearnerSurvCoxPHCox$new(),
  fold_list = validation_fold_list,
  seed = seed,
  ncores = n_cores,
  return_models = TRUE
)
coxph_validator$performance_metric <- mlsurvlrnrs::c_index
coxph_validator$set_data(
  x = train_x[, which(colnames(train_x) %in% cox_feature_cols)],
  y = train_y,
  cat_vars = ml_cat_vars[which(ml_cat_vars %in% cox_feature_cols)]
)
res_coxph <- coxph_validator$execute()

However, when setting them with learner_args, everything works fine:

coxph_validator$learner_args <- list(cat_vars = ml_cat_vars[which(ml_cat_vars %in% cox_feature_cols)])
@kapsner kapsner self-assigned this Jul 20, 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