CPO objects are created by calling CPOConstructors, which are
R functions that have some parameters in common, use a convenient print.CPOConstructor generic,
and always return a CPO object. The mlrCPO package provides many CPOConstructor
functions, which can be listed using listCPO. It is also possible to
create custom CPOConstructors using makeCPO, makeCPORetrafoless,
link{makeCPOTargetOp}, and makeCPOExtendedTrafo.
| id | [ |
||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| export | [
Default is “export.default”. |
||||||||||||||
| affect.type | [ |
||||||||||||||
| affect.index | [ |
||||||||||||||
| affect.names | [ |
||||||||||||||
| affect.pattern | [ |
||||||||||||||
| affect.invert | [ |
||||||||||||||
| affect.pattern.ignore.case | [ |
||||||||||||||
| affect.pattern.perl | [ |
||||||||||||||
| affect.pattern.fixed | [ |
[CPO] the constructed CPO.
CPOConstructors can be called like any R function, with any parameters given. Besides parameters that are
common to most CPOConstructors (listed below), it is possible to set CPO-specific hyperparameters in the
construction. Parameters that are being exported can also be modified later using the CPO
object, see the documentation there.
affect.* parametersWhen creating a CPO, it is possible to choose which columns of the given data the CPO operates
on, and which columns it will ignore. This is done using the affect.* parameters. It is possible to
choose columns by types, indices, names, or a regular expression matching names.
print.CPOConstructor for possibly verbose printing.
Other CPO lifecycle related:
CPOLearner,
CPOTrained,
CPO,
NULLCPO,
%>>%(),
attachCPO(),
composeCPO(),
getCPOClass(),
getCPOConstructor(),
getCPOTrainedCPO(),
identicalCPO(),
makeCPO()
Other CPOConstructor related:
getCPOClass(),
getCPOConstructor(),
getCPOName(),
identicalCPO(),
makeCPO(),
print.CPOConstructor()
#> [1] "CPOConstructor" "function"#> <<CPO pca(center = TRUE, scale = FALSE, tol = <NULL>, rank = <NULL>)>>#> <<CPO pca(center = TRUE, scale = FALSE, tol = <NULL>, rank = <NULL>)>> #> #> cpo.trafo: #> function (center = TRUE, scale = FALSE, tol = NULL, rank = NULL, #> data, target) #> { #> if (!ncol(data)) { #> emat = matrix(data = numeric(0), nrow = 0, ncol = 0) #> control = list(rotation = emat, scale = numeric(0), center = numeric(0)) #> return(data) #> } #> pcr = prcomp(as.matrix(data), center = center, scale. = scale, #> tol = tol, rank = rank) #> control = pcr[c("rotation", "scale", "center")] #> pcr$x #> } #> <environment: namespace:mlrCPO> #> #> cpo.retrafo: #> function (center = TRUE, scale = FALSE, tol = NULL, rank = NULL, #> data, control) #> { #> scale(as.matrix(data), center = control$center, scale = control$scale) %*% #> control$rotation #> } #> <environment: namespace:mlrCPO>cpoPca() # creating a CPO#> pca(center = TRUE, scale = FALSE)[not exp'd: tol = <NULL>, rank = <NULL>]#> [1] "CPOPrimitive" "CPO"