clearRI: Clear Retrafo and Inverter Attributes

Description Usage Arguments Value See Also Examples

View source: R/attributes.R

Description

When applying CPOs to data, the operation entails saving the CPOTrained information that gets generated to an attribute of the resulting object. This is a useful solution to the problem that applying multiple CPOs should also lead to a retrafo object that performs the same multiple operations. However, sometimes this may lead to surprising and unwanted results when a CPO is applied and not meant to be part of a trafo-retrafo machine learning pipeline, e.g. for dropping columns that occur in training but not in prediction data. In that case, it is necessary to reset the retrafo and possibly inverter attributes of the data being used. This can be done either by using retrafo(data) <- NULL, or by using clearRI. clearRI clears both retrafo and inverter attributes.

Usage

1

Arguments

data

[data.frame | Task | WrappedModel]
The result of a CPO applied to a data set.

Value

[data.frame | Task | WrappedModel] the data after stripping all retrafo and inverter attributes.

See Also

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

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

Examples

1
2
3
4
5
6
7
8
# without clearRI
transformed = iris.task %>>% cpoPca()
transformed2 = transformed %>>% cpoScale()
retrafo(transformed2)  # [RETRAFO pca]=>[RETRAFO scale]

transformed = iris.task %>>% cpoPca()
transformed2 = clearRI(transformed) %>>% cpoScale()
retrafo(transformed2)  # [RETRAFO scale]

mlr-org/mlrCPO documentation built on May 28, 2019, 8:45 a.m.