Open
Description
This works:
lrn("classif.lightgbm", predict_type = "prob") -> lr
lr$train(tsk("iris"))$predict(tsk("iris"))
#> <PredictionClassif> for 150 observations:
#> row_ids truth response prob.setosa prob.versicolor prob.virginica
#> 1 setosa setosa 9.999852e-01 1.382390e-05 9.720637e-07
#> 2 setosa setosa 9.999263e-01 6.613751e-05 7.548791e-06
#> 3 setosa setosa 9.999859e-01 1.261789e-05 1.494298e-06
#> --- --- --- --- --- ---
#> 148 virginica virginica 2.707061e-06 3.682518e-05 9.999605e-01
#> 149 virginica virginica 2.201095e-05 1.046058e-04 9.998734e-01
#> 150 virginica virginica 4.883481e-05 4.620961e-03 9.953302e-01
but this does not:
lrn("classif.lightgbm", predict_type = "prob") -> lr
lr$encapsulate("callr", lrn("classif.featureless", predict_type = "prob"))
lr$train(tsk("iris"))$predict(tsk("iris"))
#> INFO [16:56:38.218] [mlr3] Calling train method of fallback 'classif.featureless' on task 'iris' with 150 observations {learner: <LearnerClassifFeatureless/LearnerClassif/Learner/R6>}
#> <PredictionClassif> for 150 observations:
#> row_ids truth response prob.setosa prob.versicolor prob.virginica
#> 1 setosa setosa 0 0 0
#> 2 setosa setosa 0 0 0
#> 3 setosa versicolor 0 0 0
#> --- --- --- --- --- ---
#> 148 virginica virginica 0 0 0
#> 149 virginica setosa 0 0 0
#> 150 virginica virginica 0 0 0
Maybe something goes wrong here where something should have been marshalled?
Also, why does the constructor of the PredictionClassif
not notice that the row-sums don't add up to 1 here?