getCPOPredictType {mlrCPO}R Documentation

Get the CPO predict.type

Description

Get the possible predict.types a CPO is able to handle.

The concept of a predict.type originates from predict.WrappedModel, which allows the estimation of different aspects of a prediction. This is, currently:

“response”

A best estimate of the actual target value

“prob”

An estimate of probabilities of different target values

“se”

An estimate of the target value, together with an estimate of the standard error of this first estimation

A Target Operation CPO is able to change the type of a Task, but it can also enhance the type of predictions that a Learner can make for it. Thus a CPO that converts a binary classification into a regression task can use a regression learner to not only predict the “response” class, but also the estimated probability (“prob”) distribution over the two classes. For this, the CPO declares

  1. what predict.types a Learner, when attached to it, can provide, and

  2. what predict.type the Learner, in each case, must be capable of.

This information is provided in the form of a named character, where the names are the provided predict type capabilities, and the values are the predict type that the underlying Learner must provide for this.

The CPO converting classification to regression mentioned above would thus have the predict.type of:

c(response = "response", prob = "response")

Another example would be a CPO that converts a multiclass classification problem into an ordinary classification problem, but uses the “prob” prediction of the underlying learner to make both the “response” and “prob” predictions. It would have the predict.type of:

c(response = "prob", prob = "prob")

If this second CPO is attached to a Learner that does not have the “prob” property (see LearnerProperties), an error is given.

CPOs that are not Target Operating always have the predict.type of:

c(response = "response", prob = "prob", se = "se")

Usage

getCPOPredictType(cpo)

## S3 method for class 'CPOTrained'
getCPOPredictType(cpo)

Arguments

cpo

[CPO]
The cpo.

Value

[character]. A named character that maps potential predict types that a CPO may provide to the required predict type of an underlying learner.

See Also

Other getters and setters: CPO, getCPOAffect(), getCPOClass(), getCPOConstructor(), getCPOId(), getCPOName(), getCPOOperatingType(), getCPOProperties(), getCPOTrainedCPO(), getCPOTrainedCapability(), setCPOId()

Other retrafo related: CPOTrained, NULLCPO, %>>%(), applyCPO(), as.list.CPO, clearRI(), getCPOClass(), getCPOName(), getCPOOperatingType(), getCPOProperties(), getCPOTrainedCPO(), getCPOTrainedCapability(), getCPOTrainedState(), is.retrafo(), makeCPOTrainedFromState(), pipeCPO(), print.CPOConstructor()

Other inverter related: CPOTrained, NULLCPO, %>>%(), applyCPO(), as.list.CPO, clearRI(), getCPOClass(), getCPOName(), getCPOOperatingType(), getCPOProperties(), getCPOTrainedCPO(), getCPOTrainedCapability(), getCPOTrainedState(), is.inverter(), makeCPOTrainedFromState(), pipeCPO(), print.CPOConstructor()


[Package mlrCPO version 0.3.7-7 Index]