-
Notifications
You must be signed in to change notification settings - Fork 1
/
main_silhouette.py
38 lines (23 loc) · 1.14 KB
/
main_silhouette.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
from norm import *
from Silhouette import *
import pandas as pd
#------------------------------- IMPORT CSV + MODIFICHE DATASET -------------------------------#
#Importiamo il csv e lo trasformiamo in una matrice
data = pd.read_csv("candy_1.csv", sep = ",", header=None)
data = data.as_matrix()
#Creiamo la matrice x
X = data[:, 0:data.shape[1]-1]
#------------------------------------ NORMALIZAZZIONE FEATURE ---------------------------------#
#------------------------------------- ZSCORE -----------------------------------#
mu, sigma = muSigma(X)
X = zScore(X, mu, sigma)
#--------------------------------------------------------------------------------#
#------------------------------------ MINMAX ------------------------------------#
# min, diff, max = minmax(X)
# X = Min_Max(X, min, diff)
#--------------------------------------------------------------------------------#
#-------------------------------- FEATURE SCALING -------------------------------#
# min, diff, max = minmax(X)
# X = Feat_Scaling(X, max)
#--------------------------------------------------------------------------------#
silouette(X)