mlr-org / mlr3learners

Recommended learners for mlr3
https://mlr3learners.mlr-org.com
GNU Lesser General Public License v3.0
91 stars 15 forks source link

[BUGLRN] Bugs in learner qda: Error in qda.default(x, grouping, ...) : rank deficiency in group good #231

Closed MislavSag closed 2 years ago

MislavSag commented 2 years ago

Expected Behaviour

Learner works as expected.

Actual Behaviour

Training the learner retirns an error:

Error in qda.default(x, grouping, ...) : rank deficiency in group good

Reprex

task_ = tsk("german_credit")
task_$task_type
learner = lrn("classif.qda")
learner$predict_sets = c("train", "test")
learner$predict_type = "prob"
fm = learner$train(task_)
sebffischer commented 2 years ago

Also does not seem to be a mlr3 bug to me

mllg commented 2 years ago

Same problem as in #230, and same solution:

library(mlr3pipelines)
learner = as_learner(ppl("robustify") %>>% lrn("classif.qda"))
learner$param_set$values$encode.method = "treatment"
learner$train(task)
learner$predict(task)