Learn R Programming

gradDescent (version 3.0)

varianceScaling: The Variance/Standardization Feature Scaling Function

Description

A function to do feature scaling to dataset with variance/standardization scaling method .

Usage

varianceScaling(dataSet)

Arguments

dataSet

a data.frame that representing dataset to be processed. dataSet must have at leas two columns and ten rows of data that contain only numbers (integer or float). The last column to the left will be defined as output variable.

Value

a list contains feature scaled dataset and scaling parameter

Details

This function changes the value of dataset that represented by data.frame object into variance scaled value that has interval value near -1 to 1.

See Also

varianceDescaling

Examples

Run this code
# NOT RUN {
##################################
## Feature scaling with Variance Scaling Method
## load R Package data
data(gradDescentRData)
## get z-factor Data
dataSet <- gradDescentRData$CompressilbilityFactor
## do variance scaling to dataset
featureScalingResult <- varianceScaling(dataSet)
## show result
print(featureScalingResult$scaledDataSet)
print(featureScalingResult$scalingParameter)

# }

Run the code above in your browser using DataLab