SoftMax:
Normalize a set of continuous values using SoftMax
Description
Function for normalizing the range of values of a continuous variable
using the SoftMax function (Pyle, 199).
Usage
SoftMax(x, lambda = 2, avg = mean(x, na.rm = T), std = sd(x, na.rm = T))
Arguments
x
A vector with numeric values
lambda
A numeric value entering the formula of the soft max function (see
Details). Defaults to 2.
avg
The statistic of centrality of the continuous variable being normalized
(defaults to the mean of the values in x
).
std
The statistic of spread of the continuous variable being normalized
(defaults to the standard deviation of the values in x
). Value
An object with the same dimensions as x
but with the values normalized
Details
The Soft Max normalization consist in transforming the value x into 1 / [ 1+ exp( (x-AVG(x))/(LAMBDA*SD(X)/2*PI) ) ]
References
Pyle, D. (1999). Data preparation for data mining. Morgan Kaufmann.Torgo, L. (2016) Data Mining using R: learning with case studies,
second edition,
Chapman & Hall/CRC (ISBN-13: 978-1482234893).
http://ltorgo.github.io/DMwR2
Examples
Run this code## A simple example with the iris data set
data(iris)
summary(SoftMax(iris[["Petal.Length"]]))
summary(iris[["Petal.Length"]])
Run the code above in your browser using DataLab