Skip to content

Fix Unit Tests for tuning SSM, tune_on_folds & nonignorable #221

Open
@PhilippBach

Description

@PhilippBach

Currently, I can't see why the unit tests for tuning SSM models if setting tune_on_folds=TRUE and score="nonignorable" are failing. Errors are produced when calling initiate_learner` and the error comes from

doubleml-for-r/R/helper.R

Lines 240 to 262 in c7edeb2

initiate_learner = function(learner, task_type, params, return_train_preds = FALSE) {
valid_task_type = c("regr", "classif")
assertChoice(task_type, valid_task_type)
ml_learner = learner$clone()
if (!is.null(params)) {
ml_learner$param_set$values = insert_named(
ml_learner$param_set$values,
params)
} # else if (is.null(params) | length(params) == 0) {
# message("No parameters provided for learners. Default values are used.")
# }
if (task_type == "classif") {
ml_learner$predict_type = "prob"
}
if (return_train_preds) {
ml_learner$predict_sets = c("test", "train")
}
return(ml_learner)
}

The error message is

Error in insert_named(ml_learner$param_set$values, params) : 
  Assertion on 'names(y)' failed: Must have names.

see #217

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions