Update visualization.py

This commit is contained in:
jlevine18 2018-12-20 22:01:28 -06:00 committed by GitHub
parent 2140ea8f77
commit cc6a7697cf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -125,6 +125,7 @@ def kmeans(data, num_clusters):
#Spectral Clustering- Seems to work really well
def spectral(data, num_clusters):
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)
return y