8000 DOC remove FutureWarnings for plot_release_highlights_0_23_0.py by edenies · Pull Request #24937 · scikit-learn/scikit-learn · GitHub
[go: up one dir, main page]

Skip to content

DOC remove FutureWarnings for plot_release_highlights_0_23_0.py #24937

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

Merged

Conversation

edenies
Copy link
Contributor
@edenies edenies commented Nov 15, 2022

Reference Issues/PRs

Fixes the task release_highlights/plot_release_highlights_0_23_0.html of the issue #24876 .

What does this implement/fix? Explain your changes.

This PR fixes the FutureWarning linked to usage of KMeans without n_init explicitly defined. Therefore I added n_init=10 (previous default value) making the Depreciation Warning go away.

Any other comments?

@@ -105,7 +105,7 @@
X, y = make_blobs(random_state=rng)
X = scipy.sparse.csr_matrix(X)
X_train, X_test, _, y_test = train_test_split(X, y, random_state=rng)
kmeans = KMeans(algorithm="elkan").fit(X_train)
kmeans = KMeans(algorithm="elkan", n_init=10).fit(X_train)
Copy link
Member

Choose a reason for hiding this comment

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

We can use the current default for algorithm and the future default for n_init.

Suggested change
kmeans = KMeans(algorithm="elkan", n_init=10).fit(X_train)
kmeans = KMeans(n_init="auto").fit(X_train)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to ot 8000 hers. Learn more.

Done! Thanks

@glemaitre glemaitre merged commit 790c7df into scikit-learn:main Nov 15, 2022
@glemaitre
Copy link
Member

Thanks. The linting error has been solved in main.

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.

2 participants
0