Prediction
Abstract Prediction Object
This is the abstract base class for task objects like PredictionClassif or PredictionRegr.
Prediction objects store the following information:
The row ids of the test set
The corresponding true (observed) response.
The corresponding predicted response.
Additional predictions based on the class and
predict_type
. E.g., the class probabilities for classification or the estimated standard error for regression.
- Keywords
- datasets
Format
R6::R6Class object.
Construction
This object is constructed via a derived classes, e.g. PredictionClassif or PredictionRegr.
Fields
row_ids
:: (integer()
|character()
) Vector of row ids for which predictions are stored.truth
::any
True (observed) outcome.task_type
::character(1)
Stores the type of the Task.predict_types
::character()
Vector of predict types this object stores.missing
::logical()
Returnsrow_ids
for which the predictions are missing or incomplete.
Methods
score(measures = NULL, task = NULL, learner = NULL)
(list()
of Measure, Task, Learner) -> Prediction Calculates the performance for all provided measures 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). Task and Learner may beNULL
for many measures, but some measures need to extract information from these objects.
S3 Methods
as.data.table(rr)
Prediction ->data.table::data.table()
Converts the data to adata.table::data.table()
.c(..., keep_duplicates = TRUE)
(Prediction, Prediction, ...) -> Prediction Combines multiplePrediction
s to a singlePrediction
. Ifkeep_duplicates
isFALSE
and there are duplicated row ids, the data of the former passed objects get overwritten by the data of the later passed objects.
See Also
Other Prediction: PredictionClassif
,
PredictionRegr