Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/lazyprogrammer/machine_learning_examples
/ cost
Function
cost
unsupervised_class/kmeans_visualize.py:19–24 ·
view source on GitHub ↗
(X, R, M)
Source
from the content-addressed store, hash-verified
17
18
19
def
cost(X, R, M):
20
cost = 0
21
for
k in range(len(M)):
22
for
n in range(len(X)):
23
cost += R[n,k]*d(M[k], X[n])
24
return
cost
25
26
27
def
plot_k_means(X, K, max_iter=20, beta=1.0):
Callers
1
plot_k_means
Function · 0.70
Calls
1
d
Function · 0.70
Tested by
no test coverage detected