Skip to content

Commit 7ae7051

Browse files
authored
Add files via upload
1 parent a5ae7eb commit 7ae7051

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

data_scaling.py

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
"@Author: @learn.machinelearning"
2+
3+
from sklearn import preprocessing
4+
import numpy as np
5+
6+
# Python code for Normalization, Standardization and MinMaxScaler
7+
# Theory https://www.instagram.com/p/BtQ4csDH083/
8+
9+
vector_A = np.array([[1, 181, 2, 32], [4, 100, 6, 18]])
10+
#Normalization values
11+
normalized_X = preprocessing.normalize(vector_A)
12+
13+
#Standardization value
14+
standardized_X = preprocessing.scale(vector_A)
15+
16+
#MinMaxScaler value
17+
minmax_X = preprocessing.MinMaxScaler().fit_transform(vector_A)
18+
print("original data: ", vector_A)
19+
print("Normalization: ", normalized_X)
20+
print("Standardization: ", standardized_X)
21+
print("MinMaxScaler: ", minmax_X)

0 commit comments

Comments
 (0)