Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Bug in predictions due to recent change in data.table #2578

@danielhorn

Description

@danielhorn

data.table changed its behaviour wrt. rbind by name/position. Recent version issue a message about this, e.g. if you run this code:

set.seed(123)
lrn = makeLearner("classif.svm", predict.type = "prob")
task = iris.task
ctrl = makeTuneControlRandom(maxit = 2)
ps = makeParamSet(makeNumericParam("cost", lower = 0.01, upper = 0.1))
lrn = makeTuneWrapper(lrn, cv3, par.set = ps, control = ctrl)
resample(lrn, task, cv3)

This leads to errors down the analysis, where probabilites are not joint corretly together in prediction objects. I.e., probabiltites for the first class where rbinded to the column for the 2nd class, and vice versa. See

rbindlist(lapply(seq_along(pr.te), function(X) cbind(pr.te[[X]]$data, iter = X, set = "test"))),
.

To turn the message into an error, you can set the option options(datatable.rbindlist.check="error").

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions