Learn R Programming

mlr (version 2.8)

normalizeFeatures: Normalize features.

Description

Normalize features by different methods. Internally normalize is used for every feature column. Non numerical features will be left untouched and passed to the result. For constant features most methods fail, special behaviour for this case is implemented.

Usage

normalizeFeatures(task, method = "standardize", exclude = character(0L), range = c(0, 1), on.constant = "quiet")

Arguments

task
[Task] The task.
method
[character(1)] Normalizing method. Available are: “center”: Subtract mean. “scale”: Divide by standard deviation. “standardize”: Center and scale. “range”: Scale to a given range.
exclude
[character] Names of the columns to exclude. The target does not have to be included here. Default is none.
range
[numeric(2)] Range for method “range”. Default is c(0,1).
on.constant
[character(1)] How should constant vectors be treated? Only used, of “method != center”, since this methods does not fail for constant vectors. Possible actions are: “quiet”: Depending on the method, treat them quietly: “scale”: No division by standard deviation is done, input values. will be returned untouched. “standardize”: Only the mean is subtracted, no division is done. “range”: All values are mapped to the mean of the given range. “warn”: Same behaviour as “quiet”, but print a warning message. “stop”: Stop with an error.

Value

[Task].

See Also

normalize

Other eda_and_preprocess: capLargeValues, createDummyFeatures, dropFeatures, mergeSmallFactorLevels, removeConstantFeatures, summarizeColumns