Skip to content

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

Description

@kapsner

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)])

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions