Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test.join aggregation does not join probabilities #625

Open
berndbischl opened this issue Dec 19, 2015 · 6 comments
Open

test.join aggregation does not join probabilities #625

berndbischl opened this issue Dec 19, 2015 · 6 comments

Comments

@berndbischl
Copy link
Member

berndbischl commented Dec 19, 2015

task = sonar.task
lrn = makeLearner("classif.rpart", predict.type = "prob")

rin = makeResampleDesc("Holdout")
mm = setAggregation(auc, test.join)
r = resample(lrn, task, rin, measures = mm)

This leads to
Error in getPredictionProbabilities(pred, cl = levs) :
Trying to get probabilities for nonexistant classes: M,R

It is also obvious from the source code.
NB: we have potentially more columns we need to join like se and the stuff from survival...

@mllg as you pushed this some time ago

@berndbischl berndbischl modified the milestones: v2.9, v2.8 Dec 19, 2015
@mllg mllg modified the milestone: v2.10 Jun 14, 2016
larskotthoff pushed a commit that referenced this issue Oct 13, 2016
* Issue #625: solve aggregation issue for test.join with probs

* extend tests
@larskotthoff
Copy link
Member

Did the PR solve this completely or should we leave this open?

@giuseppec
Copy link
Contributor

The part

NB: we have potentially more columns we need to join like se and the stuff from survival...

was not addressed in the PR, therefore we could leave this open.

@jakob-r
Copy link
Member

jakob-r commented Nov 10, 2016

This error still prevails

task = wpbc.task
lrn = makeLearner("surv.rpart")
rin = makeResampleDesc("Holdout")
mm = setAggregation(cindex, test.join)
r = resample(lrn, task, rin, measures = mm)
#[Resample] holdout iter: 1
#Error in FUN(X[[i]], ...) : 
#  You need to have 'truth.time' and 'truth.event' columns in your pred object for measure cindex!

@jakob-r
Copy link
Member

jakob-r commented Nov 10, 2016

And

task = yeast.task
lrn = makeLearner("multilabel.cforest")
rin = makeResampleDesc("Holdout")
mm = setAggregation(multilabel.acc, test.join)
r = resample(lrn, task, rin, measures = mm)
#[Resample] holdout iter: 1
#Error in `row.names<-.data.frame`(`*tmp*`, value = value) : 
#  invalid 'row.names' length

@jakob-r
Copy link
Member

jakob-r commented Nov 10, 2016

In other words: We should not write custom code for every task class in test.join but find a generalized solution.

@pat-s
Copy link
Member

pat-s commented Dec 31, 2019

library(mlr)
#> Loading required package: ParamHelpers

task = wpbc.task
lrn = makeLearner("surv.rpart")
rin = makeResampleDesc("Holdout")
mm = setAggregation(cindex, test.join)
r = resample(lrn, task, rin, measures = mm)
#> Resampling: holdout
#> Measures:             cindex
#> [Resample] iter 1:    0.6156373
#> Error in FUN(X[[i]], ...): You need to have 'truth.time' and 'truth.event' columns in your pred object for measure cindex!

Created on 2019-12-31 by the reprex package (v0.3.0)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants