llama (version 0.9.2)

normalize: Normalize features

Description

Normalize input data so that the values for all features cover the same range -1 to 1.

Usage

normalize(rawfeatures, meta = NULL)

Arguments

rawfeatures

data frame with the feature values to normalize.

meta

meta data to use for the normalization. If supplied should be a list with members minValues that contains the minimum values for all features and maxValues that contains the maximum values for all features. Will be computed if not supplied.

Value

features

the normalized feature vectors.

meta

the minimum and maximum values for each feature before normalization. Can be used in subsequent calls to normalize for new data.

Details

normalize subtracts the minimum (supplied or computed) from all values of a feature, divides by the difference between maximum and minimum, multiplies by 2 and subtracts 1. The range of the values for all features will be -1 to 1.

Examples

Run this code
# NOT RUN {
if(Sys.getenv("RUN_EXPENSIVE") == "true") {
data(satsolvers)
folds = cvFolds(satsolvers)

cluster(clusterer=makeLearner("cluster.XMeans"), data=folds, pre=normalize)
}
# }

Run the code above in your browser using DataCamp Workspace