MCPcopy Create free account
hub / github.com/AssemblyAI-Community/Machine-Learning-From-Scratch / plot

Method plot

10 KMeans/kmeans.py:89–99  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

87 return sum(distances) == 0
88
89 def plot(self):
90 fig, ax = plt.subplots(figsize=(12, 8))
91
92 for i, index in enumerate(self.clusters):
93 point = self.X[index].T
94 ax.scatter(*point)
95
96 for point in self.centroids:
97 ax.scatter(*point, marker="x", color="black", linewidth=2)
98
99 plt.show()
100
101
102# Testing

Callers 5

predictMethod · 0.95
visualize_svmFunction · 0.80
train.pyFile · 0.80
perceptron.pyFile · 0.80
kmeans.pyFile · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected