+
Skip to content

LearnerClassifLightGBM makes invalid prob-predictions when callr-encapsulated #1331

Open
@mb706

Description

@mb706

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载