Data, Python, Machine Learning, Data Science, AI.
AgglomerativeClustering(n_clusters=3) agg_clustering.fit(df) # Plot the dendrogram children = agg_clustering.children_ distances = np.arange(children.shape[0]) n_samples = len(df.index) # Create linkage matrix linkage_matrix = np.column_stack([children, distances, n_samples -