-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ml] Fix un-initialized centroids bug (k-means) #4570
Conversation
How about putting the for-loop inside |
Thank you for your feedback. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Should we make a issue about creating a unit test? |
Thank you for your PR approval. |
You are missing:
In the end of the test file. |
And you can uses the short spdx version of the copyright:
beside the small changes, its looking good! |
Looking good. Lets wait for CI's and @mvieth review on the unit test. Then we have one commit with correction and one with the addition of unit test. |
OK! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just two minor suggestions:
- Switch the Case1/2 and Kmeans_computeCentroids. Usually it goes from general to specififc
- We could also e.g. test if the number of computed centroids is as requested, i.e. 9 and 1.
Thank you for your suggestion and review. @larshg @mvieth
Please check my commit. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice, thanks again.
@larshg do you want to have a last look at the changes?
Looks ready 🚀 |
I added a function that initializes centroids in kmeans.