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
{{ message }}
This repository has been archived by the owner on Sep 26, 2023. It is now read-only.
I'd love to give more details . movement is always true... (inside the loop it ofcourse false, but then changes to true)...
not sure how to fix it, really problematic.
help is needed.
It might be because of a local minima point. I've added an iterations limit to the while, so while(movement && (iterations < max_iteratoins)){ ... }
this isn't a good solution obviously, but im not familiar with the algorithm http://blog.endava.com/k-means-clustering-algorithm
" However, in this form, there is a risk to get stuck in a local minima. By local minima I mean the local minima of the cost function:"
The text was updated successfully, but these errors were encountered:
Could you please elaborate more, with code concerning the "max limit based on the number of items"? what items? points? different k as in different k random points right? or different k as in different number of clusters?
tnx
P.S. if you'll notice in the code i've linked above, he has 2 guards, one uses epsilon , the other he iterates 100 the whole process , just not to fall into a minima.
Sorry, just came across this again! I meant k as in number of clusters, should have specified. The limit would be on the number of iterations. In the k-means algorithm there are iterations, in each iteration, every point finds the best cluster for it, and this process stops when there's an iteration with no movement.
I've found that if any of the points are undefined, the process stops in an endless loop, maybe this was what happened here. It could be solved by doing a check for undefined in distance.js:
total += Math.pow(v2[i] || 0 - v1[i] || 0 , 2);
instead of
total += Math.pow(v2[i] - v1[i] , 2);
and the same for manhattan and max.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I'd love to give more details . movement is always true... (inside the loop it ofcourse false, but then changes to true)...
not sure how to fix it, really problematic.
help is needed.
It might be because of a local minima point. I've added an iterations limit to the while, so while(movement && (iterations < max_iteratoins)){ ... }
this isn't a good solution obviously, but im not familiar with the algorithm
http://blog.endava.com/k-means-clustering-algorithm
" However, in this form, there is a risk to get stuck in a local minima. By local minima I mean the local minima of the cost function:"
The text was updated successfully, but these errors were encountered: