mmnorm: Min-max normalization

Description Usage Arguments Details Value Author(s) References Examples

Description

This is a function to apply min-max normalization to a matrix or dataframe.

Usage

1
mmnorm(data,minval=0,maxval=1)

Arguments

data

The dataset to be normalized, including classes

minval

The minimun value of the transformed range

maxval

The maximum value of the transformed range

Details

Min-max normalization subtracts the minimum value of an attribute from each value of the attribute and then divides the difference by the range of the attribute. These new values are multiplied by the new range of the attribute and finally added to the new minimum value of the attribute. These operations transform the data into a new range, generally [0,1]. The function removes classes (assuming they are in last column) before normalization, and returns a normalized data set, complete with classes. Uses the function scale from the base package.

Value

zdata3

The normalized dataset

Author(s)

Caroline Rodriguez and Edgar Acuna

References

Hann, J., Kamber, M. (2000). Data Mining: Concepts and Techniques. Morgan Kaufman Publishers.

Examples

1
2
3
4
5
6
7
#---- Min-Max Normalization----
data(ionosphere)
ionos.minmax=mmnorm(ionosphere)
op=par(mfrow=c(2,1))
plot(ionosphere[,1])
plot(ionos.minmax[,1])
par(op)

Example output

Warning messages:
1: In rgl.init(initValue, onlyNULL) : RGL: unable to open X11 display
2: 'rgl_init' failed, running with rgl.useNULL = TRUE 
3: .onUnload failed in unloadNamespace() for 'rgl', details:
  call: fun(...)
  error: object 'rgl_quit' not found 

dprep documentation built on May 29, 2017, 11:01 a.m.