Last active
November 20, 2020 04:50
-
-
Save isaacarroyov/70d6fbdf00a66fa0e926b88acdfa6f59 to your computer and use it in GitHub Desktop.
application of elbow method
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from sklearn.cluster import KMeans | |
#create a list for the wcss parameter | |
wcss = [] | |
#test with 14 clusters | |
for i in range(1, 15): | |
kmeans = KMeans(n_clusters = i, init = 'k-means++', random_state = 11) | |
kmeans.fit(df_standardized) | |
wcss.append(kmeans.inertia_) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment