When applying CPO
s 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.
clearRI(data)
data | [ |
---|
[data.frame
| Task
| WrappedModel
] the
data
after stripping all retrafo
and inverter
attributes.
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()
# without clearRI transformed = iris.task %>>% cpoPca() transformed2 = transformed %>>% cpoScale() retrafo(transformed2) # [RETRAFO pca]=>[RETRAFO scale]#> CPO Retrafo chain #> [RETRAFO pca(center = TRUE, scale = FALSE)] => #> [RETRAFO scale(center = TRUE, scale = TRUE)]transformed = iris.task %>>% cpoPca() transformed2 = clearRI(transformed) %>>% cpoScale() retrafo(transformed2) # [RETRAFO scale]#> CPO Retrafo chain #> [RETRAFO scale(center = TRUE, scale = TRUE)]