PredictionData {mlr3} | R Documentation |
Convert to PredictionData
Description
Objects of type PredictionData
serve as a intermediate representation for objects of type Prediction.
It is an internal data structure, implemented to optimize runtime and solve some issues emerging while serializing R6 objects.
End-users typically do not need to worry about the details, package developers are advised to continue reading for some technical information.
Unlike most other mlr3 objects, PredictionData
relies on the S3 class system.
The following operations must be supported to extend mlr3 for new task types:
-
as_prediction_data()
converts objects to classPredictionData
, e.g. objects of type Prediction. -
as_prediction()
converts objects to class Prediction, e.g. objects of typePredictionData
. -
check_prediction_data()
is called on the return value of the predict method of a Learner to perform assertions and type conversions. Returns an update object of classPredictionData
. -
is_missing_prediction_data()
is used for the fallback learner (see Learner) to impute missing predictions. Returns vector with row ids which need imputation.
Usage
check_prediction_data(pdata, ...)
is_missing_prediction_data(pdata, ...)
filter_prediction_data(pdata, row_ids, ...)
## S3 method for class 'PredictionDataClassif'
check_prediction_data(pdata, train_task, ...)
## S3 method for class 'PredictionDataClassif'
is_missing_prediction_data(pdata, ...)
## S3 method for class 'PredictionDataClassif'
c(..., keep_duplicates = TRUE)
## S3 method for class 'PredictionDataRegr'
check_prediction_data(pdata, ...)
## S3 method for class 'PredictionDataRegr'
is_missing_prediction_data(pdata, ...)
## S3 method for class 'PredictionDataRegr'
c(..., keep_duplicates = TRUE)
Arguments
pdata |
(PredictionData) |
... |
(one or more PredictionData objects). |
row_ids |
|
train_task |
(Task) |
keep_duplicates |
( |