def updateWeights(weight_arr, C):
denom = np.zeros(n)
for i in range(n_clusters):
dist = (X.iloc[:,:].values - centers[i])**2
dist = np.sum(dist, axis=1)
dist = np.sqrt(dist)
dist = np.power(dist, 2) # I think this line is missing
denom = denom + np.power(1/dist, 1/(m-1))
for i in range(n_clusters):
dist = (X.iloc[:,:].values - centers[i])**2
dist = np.sum(dist, axis=1)
dist = np.sqrt(dist) # Up to here is the euclidean distance but for the equation for update the weights now squares the dist
dist = np.power(dist, 2) # I think this line is missing
weight_arr[:,i] = np.divide(np.power(1/dist, 1/(m-1)), denom)
return weight_arr
I can't see your cell which has the equation for the computing the new weights - I'm not sure what is needed to fix that, I've never created an equation in a notebook cell....