MCPcopy Index your code
hub / github.com/TheAlgorithms/Python / plot_heterogeneity

Function plot_heterogeneity

machine_learning/k_means_clust.py:125–132  ·  view source on GitHub ↗
(heterogeneity, k)

Source from the content-addressed store, hash-verified

123
124
125def plot_heterogeneity(heterogeneity, k):
126 plt.figure(figsize=(7, 4))
127 plt.plot(heterogeneity, linewidth=4)
128 plt.xlabel("# Iterations")
129 plt.ylabel("Heterogeneity")
130 plt.title(f"Heterogeneity of clustering over time, K={k:d}")
131 plt.rcParams.update({"font.size": 16})
132 plt.show()
133
134
135def plot_kmeans(data, centroids, cluster_assignment):

Callers 1

k_means_clust.pyFile · 0.85

Calls 3

plotMethod · 0.80
showMethod · 0.80
updateMethod · 0.45

Tested by

no test coverage detected