composeCPO: CPO Composition

View source: R/operators.R

composeCPOR Documentation

CPO Composition


Composes CPO or CPOTrained objects. The %>>% operator can be used synonymously to compose CPO objects.

Composition of operators is one of the main features they provide: this makes it possible for complex operations to be represented by single objects. Compound operators represent the operation of applying both its constituent operations in succession. Compound operators can themselves be composed to form arbitrarily long chains of operators.

Compound objects behave, in most ways, like primitive objects. Some exceptions are:

  • Compound CPOs do not have an ID, so getCPOId and setCPOId will not work on them.

  • Compound CPOs have no 'affect' property, so getCPOAffect will not work.

While CPOTrained operators can be composed just as CPO operators, this is only recommended in cases where the same primitive CPOTrained objects where retrieved using as.list.CPOTrained. This is because CPOTrained are closely related to the data that was used to create it, and therefore on their original position in the CPO pipeline during training.


composeCPO(cpo1, cpo2)



[CPO | CPOTrained]
The operation to perform first.


[CPO | CPOTrained]
The operation to perform second, must have the same class as cpo1.


[CPO | CPOTrained]. The operation representing the application of cpo1 followed by the application of cpo2.

See Also

Other operators: CPO, %>>%(), applyCPO(), as.list.CPO, attachCPO(), pipeCPO()

Other CPO lifecycle related: CPOConstructor, CPOLearner, CPOTrained, CPO, NULLCPO, %>>%(), attachCPO(), getCPOClass(), getCPOConstructor(), getCPOTrainedCPO(), identicalCPO(), makeCPO()

mlrCPO documentation built on Nov. 18, 2022, 1:05 a.m.