mlr-org / mlr3

mlr3: Machine Learning in R - next generation
https://mlr3.mlr-org.com
GNU Lesser General Public License v3.0
927 stars 86 forks source link

feat: add print functions to data.table output #895

Closed be-marc closed 1 year ago

be-marc commented 1 year ago

Test

design = benchmark_grid(
  tasks = tsk("iris"),
  learners = lrn("classif.rpart"),
  resamplings = rsmp("cv", folds = 3)
)

bmr = benchmark(design)
bmr
bmr$score()
bmr$aggregate()

rr = resample(tsk("iris"), lrn("classif.rpart"), rsmp("cv", folds = 3))
rr
rr$score()

design

I think we can't avoid to copy the table once when printing, because the print.data.table() function has no column argument.

be-marc commented 1 year ago

Also fixes bug in as_result_data(). Predictions were stored as list of predictions but it should be list of lists of predictions e.g. list(list(test = Prediction)).