Skip to content
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

fix: increase ckmeans performance #521

Merged
merged 1 commit into from
Oct 31, 2020
Merged

fix: increase ckmeans performance #521

merged 1 commit into from
Oct 31, 2020

Conversation

marcelgerber
Copy link
Contributor

Fixes #520.

I don't know what I'm doing, but this way around it's closer to what the reference implementation does, and the tests still pass 🙃

And it's way faster: Results using @breck7's test code from #520 (comment):

Before (without this fix):

kSize,nSize,time
5,1000,22
5,2000,33
5,10000,180
5,20000,820
5,100000,37749
5,200000,201173

After (with this fix):

kSize,nSize,time
5,1000,15
5,2000,29
5,10000,32
5,20000,52
5,100000,125
5,200000,324

cc @schnerd for review if you find the time, and this may be something you want to fix in your own ckmeans packages, too.

Copy link
Member

@tmcw tmcw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow, yep, looks like a typo that just survived because it was over-checking rather than under!

@tmcw tmcw merged commit af279ee into simple-statistics:master Oct 31, 2020
@marcelgerber
Copy link
Contributor Author

Thanks for the quick merge and release, very much appreciated!

@yyx990805
Copy link

who else got here from https://www.youtube.com/watch?v=KRD5jiYUOhk ? :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ckmeans is not O(kn log(n))?
3 participants