SoftMax: Normalize a set of continuous values using SoftMax

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/utils.R

Description

Function for normalizing the range of values of a continuous variable using the SoftMax function (Pyle, 199).

Usage

1
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).

Details

The Soft Max normalization consist in transforming the value x into

1 / [ 1+ exp( (x-AVG(x))/(LAMBDA*SD(X)/2*PI) ) ]

Value

An object with the same dimensions as x but with the values normalized

Author(s)

Luis Torgo ltorgo@dcc.fc.up.pt

References

Pyle, D. (1999). Data preparation for data mining. Morgan Kaufmann.

Torgo, L. (2010) Data Mining using R: learning with case studies, CRC Press (ISBN: 9781439810187).

http://www.dcc.fc.up.pt/~ltorgo/DataMiningWithR

See Also

scale, LinearScaling, ReScaling

Examples

1
2
3
## A simple example with the algae data set
summary(SoftMax(algae[,'NO3']))
summary(algae[,'NO3'])

Example output

Loading required package: lattice
Loading required package: grid
   Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
0.06363 0.16078 0.37630 0.44289 0.72475 1.00000       2 
   Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
  0.050   1.296   2.675   3.282   4.446  45.650       2 

DMwR documentation built on May 1, 2019, 9:17 p.m.