You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, just a friendly note but I think it should be:
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....
The text was updated successfully, but these errors were encountered:
raymondj-pace
changed the title
I don't think you are calculating the distances for updating the weights correctly
I don't think you are calculating the distances for updating the weights incorrectly
Apr 11, 2022
Hi, just a friendly note but I think it should be:
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....
(1 / (dist)^2)^(1/ (m-1)) / SUM(1 / (dist)^2)^(1/ (m-1))
The text was updated successfully, but these errors were encountered: