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

updated the fit function to conform to the upstream changes #1

Merged
merged 1 commit into from
Jan 21, 2022

Conversation

NightMachinery
Copy link
Contributor

No description provided.

@NightMachinery
Copy link
Contributor Author

PS: How is it that this algorithm is faster than the vanilla one? Aren't we calling super().fit(X)? So shouldn't this algorithm be strictly slower than the vanilla version?

Copy link
Owner

@gittar gittar left a comment

Choose a reason for hiding this comment

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

makes sense. Thx

@gittar gittar merged commit d78bb2a into gittar:main Jan 21, 2022
@gittar
Copy link
Owner

gittar commented Jan 21, 2022

The reason that breathing k-means in this implementation is not strictly slower than the vanilla version (i.e. scikit-learn's k-means++) is the default value n_init=1 (scikit-learn uses n_init=10). This gives an initial running time reduction of about 90% for the initialization (including the initlal run of Lloyd's algorithm). However, this advantage is reduced (possibly even turned into a disadvantage) by the time it takes to execute the breathing steps. In effect breathing k-means can indeed be faster than the employed k-means++ algorithm. It depends on the data set used and the value of k (n_clusters). The running time is also positively correlated to the parameter m ("breathing depth").

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.

2 participants