mlr-org / mlr3pipelines

Dataflow Programming for Machine Learning in R
https://mlr3pipelines.mlr-org.com/
GNU Lesser General Public License v3.0
140 stars 25 forks source link

Fix fallback of predict_type in GraphLearner #633

Closed mllg closed 2 years ago

mllg commented 2 years ago

If the heuristic in GraphLearner cannot determine the predict_type, it defaults to all available predict types stored in mlr_reflections for the first predict type setting. In mlr3proba this leads to predict_type being a character(4) instead of character(1) which leads to further problems down the line.

library(mlr3proba)
as_learner(mlr3pipelines::ppl("distrcompositor", learner = lrn("surv.coxph")))$predict_type

This PR fixes this behavior, setting the predict_type to the first predict type setting.

mllg commented 2 years ago

ping @mb706