| cpoMakeCols | R Documentation |
This is a CPOConstructor to be used to create a
CPO. It is called like any R function and returns
the created CPO.
Create columns from expressions and the incoming data.
When cpoMakeCols or cpoAddCols are called as
cpoMakeCols( <newcolname> = <expression>, ... ), a new column
with the name <newcolname containing the result of
<expression> is created. The
expressions need to be vectorising R expressions
and may refer to any feature columns in the data (excluding the
target) and any other values. The names should be valid data.frame
column names and may not clash with the target column name.
cpoMakeCols replaces existing cols by the newly created
ones, cpoAddCols adds them to the data already present.
cpoMakeCols(..., .make.factors = TRUE)
cpoAddCols(..., .make.factors = TRUE)
... |
[any] |
.make.factors |
[ |
[CPO].
The created state is empty.
This function creates a CPO object, which can be applied to
Tasks, data.frames, link[mlr]{Learner}s
and other CPO objects using the %>>% operator.
The parameters of this object can be changed after creation
using the function setHyperPars. The other
hyper-parameter manipulating functins, getHyperPars
and getParamSet similarly work as one expects.
If the “id” parameter is given, the hyperparameters will have this id as aprefix; this will, however, not change the parameters of the creator function.
CPOConstructorCPO constructor functions are called with optional values of parameters, and additional “special” optional values.
The special optional values are the id parameter, and the affect.* parameters. The affect.* parameters
enable the user to control which subset of a given dataset is affected. If no affect.* parameters are given, all
data features are affected by default.
Other CPOs:
cpoApplyFun(),
cpoApplyFunRegrTarget(),
cpoAsNumeric(),
cpoCache(),
cpoCbind(),
cpoCollapseFact(),
cpoDropConstants(),
cpoDropMostlyConstants(),
cpoDummyEncode(),
cpoFilterAnova(),
cpoFilterCarscore(),
cpoFilterChiSquared(),
cpoFilterFeatures(),
cpoFilterGainRatio(),
cpoFilterInformationGain(),
cpoFilterKruskal(),
cpoFilterLinearCorrelation(),
cpoFilterMrmr(),
cpoFilterOneR(),
cpoFilterPermutationImportance(),
cpoFilterRankCorrelation(),
cpoFilterRelief(),
cpoFilterRfCImportance(),
cpoFilterRfImportance(),
cpoFilterRfSRCImportance(),
cpoFilterSymmetricalUncertainty(),
cpoFilterUnivariate(),
cpoFilterVariance(),
cpoFixFactors(),
cpoIca(),
cpoImpactEncodeClassif(),
cpoImpactEncodeRegr(),
cpoImpute(),
cpoImputeConstant(),
cpoImputeHist(),
cpoImputeLearner(),
cpoImputeMax(),
cpoImputeMean(),
cpoImputeMedian(),
cpoImputeMin(),
cpoImputeMode(),
cpoImputeNormal(),
cpoImputeUniform(),
cpoLogTrafoRegr(),
cpoMissingIndicators(),
cpoModelMatrix(),
cpoOversample(),
cpoPca(),
cpoProbEncode(),
cpoQuantileBinNumerics(),
cpoRegrResiduals(),
cpoResponseFromSE(),
cpoSample(),
cpoScale(),
cpoScaleMaxAbs(),
cpoScaleRange(),
cpoSelect(),
cpoSmote(),
cpoSpatialSign(),
cpoTransformParams(),
cpoWrap(),
makeCPOCase(),
makeCPOMultiplex()
res = pid.task %>>% cpoAddCols(gpi = glucose * pressure * insulin, pm = pregnant * mass)
head(getTaskData(res))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.