Min-Max normalization performs on original data a linear transformation. Let (X1, X2) be a min and max attribute boundary and (Y1, Y2) be the new scale at which we are standardizing, then the standardized value Ui is given for Vi of the attribute as,

The special thing about the min-max normalization is that preserves the relationship between the original data values. If in the future the input values come to be beyond the limit of normalization, then it will encounter an error known as “out-of-bound error.”

V_{i}=300,000

X_{1}= 125,000

X_{2}= 925,000

Y_{1}= 0

Y_{2}= 1

Therefore the normalized value U_{i} will be 0.21875.

Here is an example to scale a toy data matrix to the

`[0, 1]`

range:```
from sklearn import preprocessing
import numpy as np
X_train = np.array([[ 1., -1., 2.],
[ 2., 0., 0.],
[ 0., 1., -1.]])
min_max_scaler = preprocessing.MinMaxScaler()
X_train_minmax = min_max_scaler.fit_transform(X_train)
print(X_train_minmax)
```

output:

[[0.5 0. 1. ]

[1. 0.5 0.33333333]

[0. 1. 0. ]]

To read more about Normalization visit here.

Post a Comment

No Comments