resample()
This is the result container object returned by resample()
.
Note that all stored objects are accessed by reference. Do not modify any object without cloning it first.
R6::R6Class object.
rr = ResampleResult$new(data)
data
:: data.table::data.table()
Table with data for one resampling iteration per row:
Task, Learner, Resampling, iteration (integer(1)
), and Prediction.
data
:: data.table::data.table()
Internal data storage.
We discourage users to directly work with this field.
task
:: Task
The task resample()
operated on.
learners
:: list of Learner
List of trained learners, sorted by resampling iteration.
resampling
:: Resampling
Instantiated Resampling object which stores the splits into training and test.
predictions
:: list of Prediction
List of prediction objects, sorted by resampling iteration.
prediction
:: Prediction
Combined Prediction of all individual resampling iterations.
Note that the performance of measures is not calculated on this object,
but instead on each iterations separately and then combined with an aggregate function.
warnings
:: data.table::data.table()
Returns a table with all warning messages.
Column names are "iteration"
and "msg"
.
Note that there can be multiple rows per resampling iteration if multiple warnings have been recorded.
errors
:: data.table::data.table()
Returns a table with all error messages.
Column names are "iteration"
and "msg"
.
Note that there can be multiple rows per resampling iteration if multiple errors have been recorded.
hash
:: character(1)
Hash (unique identifier) for this object.
combine(rr)
ResampleResult -> BenchmarkResult
Takes a second ResampleResult and combines both ResampleResults to a BenchmarkResult.
performance(measures = NULL, ids = TRUE)
(list()
of Measure, logical(1)
) -> data.table::data.table()
Returns a table with one row for each resampling iteration, including all involved objects.
Additionally calculates the provided performance measures and binds the performance as extra column.
If no measure is provided, defaults to the measure defined in mlr_reflections$default_measures
(mlr_measures_classif.ce for classification and mlr_measures_regr.mse for regression).
If ids
is TRUE
, character column of id names are added to the table for convenient filtering.
aggregate(measures = NULL)
list()
of Measure -> named numeric()
Calculates and aggregates performance values for all provided measures.
See Measure for the aggregation function.
as.data.table(rr)
ResampleResult -> data.table::data.table()
Returns a copy of the internal data.
# NOT RUN {
rr = resample("iris", "classif.featureless", "cv3")
rr$warnings
rr$errors
# }
Run the code above in your browser using DataLab