Update visualization.py

This commit is contained in:
jlevine18 2018-12-20 22:01:28 -06:00 committed by GitHub
parent 18fdd6e7c2
commit ad8e3cc4e5

View File

@ -125,6 +125,7 @@ def kmeans(data, num_clusters):
#Spectral Clustering- Seems to work really well #Spectral Clustering- Seems to work really well
def spectral(data, num_clusters): def spectral(data, num_clusters):
td_norm=StandardScaler().fit_transform(data) td_norm=StandardScaler().fit_transform(data)
db = SpectralClustering(n_clusters=num_clusters).fit(td) db = SpectralClustering(n_clusters=num_clusters, eigen_solver='arpack',
affinity="nearest_neighbors").fit(td)
y=db.labels_.astype(np.int) y=db.labels_.astype(np.int)
return y return y