Fuses a base learner with a preprocessing method. Creates a learner object, which can be used like any other learner object, but which internally preprocesses the data as requested. If the train or predict function is called on data / a task, the preprocessing is always performed automatically.
Usage
makePreprocWrapper(
learner,
train,
predict,
par.set = makeParamSet(),
par.vals = list()
)
Arguments
- learner
(Learner |
character(1)
)
The learner. If you pass a string the learner will be created via makeLearner.- train
(
function(data, target, args)
)
Function to preprocess the data before training.target
is a string and denotes the target variable indata
.args
is a list of further arguments and parameters to influence the preprocessing. Must return alist(data, control)
, wheredata
is the preprocessed data andcontrol
stores all information necessary to do the preprocessing before predictions.- predict
(
function(data, target, args, control)
)
Function to preprocess the data before prediction.target
is a string and denotes the target variable indata
.args
are the args that were passed totrain
.control
is the object you returned intrain
. Must return the processed data.- par.set
(ParamHelpers::ParamSet)
Parameter set of ParamHelpers::LearnerParam objects to describe the parameters inargs
. Default is empty set.- par.vals
(list)
Named list of default values for params inargs
respectivelypar.set
. Default is empty list.
Value
(Learner).
See also
Other wrapper:
makeBaggingWrapper()
,
makeClassificationViaRegressionWrapper()
,
makeConstantClassWrapper()
,
makeCostSensClassifWrapper()
,
makeCostSensRegrWrapper()
,
makeDownsampleWrapper()
,
makeDummyFeaturesWrapper()
,
makeExtractFDAFeatsWrapper()
,
makeFeatSelWrapper()
,
makeFilterWrapper()
,
makeImputeWrapper()
,
makeMulticlassWrapper()
,
makeMultilabelBinaryRelevanceWrapper()
,
makeMultilabelClassifierChainsWrapper()
,
makeMultilabelDBRWrapper()
,
makeMultilabelNestedStackingWrapper()
,
makeMultilabelStackingWrapper()
,
makeOverBaggingWrapper()
,
makePreprocWrapperCaret()
,
makeRemoveConstantFeaturesWrapper()
,
makeSMOTEWrapper()
,
makeTuneWrapper()
,
makeUndersampleWrapper()
,
makeWeightedClassesWrapper()