Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Make algorithm='auto' default to using 'full' instead of 'elkan' - #21735

Merged
glemaitre merged 5 commits into
scikit-learn:mainfrom
ageron:kmeans_algo_default_full
Nov 25, 2021
Merged

Make algorithm='auto' default to using 'full' instead of 'elkan'#21735
glemaitre merged 5 commits into
scikit-learn:mainfrom
ageron:kmeans_algo_default_full

Conversation

@ageron

@ageron ageron commented Nov 21, 2021

Copy link
Copy Markdown
Contributor

Reference Issues/PRs

Fixes #21729

What does this implement/fix? Explain your changes.

In sklearn.cluster.KMeans, the default algorithm="auto" now uses the full classical EM-style algorithm (as with algorithm="full") instead of Elkan's algorithm, as the former is often faster in practice.

Any other comments?

This does not affect the result of clustering, and the default parameter remains "auto", so this should only affect performance.

@ogrisel ogrisel left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for the quick PR, overall it looks good to me. Just a few comments:

Comment thread doc/whats_new/v1.1.rst
Comment thread doc/whats_new/v1.1.rst Outdated
Comment thread sklearn/cluster/tests/test_k_means.py
@ageron

ageron commented Nov 22, 2021

Copy link
Copy Markdown
Contributor Author

Thanks for the review @ogrisel , I'll take care of this today.

@ageron

ageron commented Nov 22, 2021

Copy link
Copy Markdown
Contributor Author

Done

@glemaitre glemaitre left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM. Only a small nitpick.

Comment thread doc/whats_new/v1.1.rst Outdated
@glemaitre
glemaitre merged commit bacc91c into scikit-learn:main Nov 25, 2021
@glemaitre

Copy link
Copy Markdown
Member

I merge my small nitpick to go ahead.

@glemaitre

Copy link
Copy Markdown
Member

Thanks @ageron

@ageron
ageron deleted the kmeans_algo_default_full branch November 25, 2021 18:56
glemaitre added a commit to glemaitre/scikit-learn that referenced this pull request Nov 29, 2021
samronsin pushed a commit to samronsin/scikit-learn that referenced this pull request Nov 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

KMeans Elkan algorithm (the default) is generally slower than Full

3 participants