Skip to content

Instantly share code, notes, and snippets.

@quantra-go-algo
Created December 27, 2023 07:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save quantra-go-algo/6884240a0882cab06603e49c6e66df12 to your computer and use it in GitHub Desktop.
Save quantra-go-algo/6884240a0882cab06603e49c6e66df12 to your computer and use it in GitHub Desktop.
import scipy.cluster.hierarchy as sc
# Plot dendrogram
plt.figure(figsize=(20, 7))
plt.title("Dendrograms")
# Create dendrogram
sc.dendrogram(sc.linkage(iris_X, method='ward'))
plt.title('Dendrogram')
plt.xlabel('Sample index')
plt.ylabel('Euclidean distance')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment