diff --git a/kMedoids.py b/kMedoids.py index a6a422a..38227b3 100644 --- a/kMedoids.py +++ b/kMedoids.py @@ -5,7 +5,7 @@ import seaborn as sns from numpy.random import choice, seed from sklearn.decomposition import PCA -from sklearn.preprocessing import Normalizer +from sklearn.preprocessing import StandardScaler seed(42) @@ -44,7 +44,7 @@ def is_finished(old_medoids, new_medoids): def kmedoids(num_samples, num_clusters): df = pd.read_csv('CC GENERAL.csv', index_col='CUST_ID') df = df[:num_samples].fillna(0) - df_scaled = pd.DataFrame(Normalizer().fit_transform(df)) + df_scaled = pd.DataFrame(StandardScaler().fit_transform(df)) # initialize medoids (at random) medoids = initialize_medoids(num_medoids=num_clusters, data=df_scaled)