Skip to content

Instantly share code, notes, and snippets.

@Joelfranklin96
Last active November 19, 2019 01:24
Show Gist options
  • Save Joelfranklin96/33b8bc578c220637db25193e81d09e5e to your computer and use it in GitHub Desktop.
Save Joelfranklin96/33b8bc578c220637db25193e81d09e5e to your computer and use it in GitHub Desktop.
elbow method of K-Means clustering 2
k = list(range(2,6)) # Range of 'k'
plt.figure(figsize=(20,10)) # Size of figure is adjusted.
plt.xticks(fontsize=20) # Size of number labels on x-axis is adjusted.
plt.yticks(fontsize=20) # Size of number labels on y-axis is adjusted.
plt.plot(k,epsilon,'go--', linewidth=1.5, markersize=4) # Graph is plotted.
plt.xlabel('Value of k',fontsize = 25) # x-axis is labelled.
plt.ylabel('Value of Epsilon',fontsize = 25) # y-axis is labelled.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment