-
Notifications
You must be signed in to change notification settings - Fork 1
/
main_dbscan.py
39 lines (25 loc) · 1.18 KB
/
main_dbscan.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
39
import pandas as pd
from norm import *
from dbscan import *
#------------------------------- 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[:, :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)
#--------------------------------------------------------------------------------#
epsylon=2
punti_min=2
centroid=dbscan(X,epsylon,punti_min)