The Wayback Machine - https://web.archive.org/web/20250521225624/https://github.com/scikit-learn/scikit-learn/pull/19507
Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

EXA Set random_state=0 in AffinityPropagation example #19507

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

thomasjpfan
Copy link
Member

To prevent the deprecation warning when running the examples with AffinityPropagation

if random_state == 'warn':
warnings.warn(
"'random_state' has been introduced in 0.23. It will be set to "
"None starting from 1.0 (renaming of 0.25) which means that "
"results will differ at every function call. Set 'random_state' "
"to None to silence this warning, or to 0 to keep the behavior of "
"versions <0.23.",
FutureWarning
)
random_state = 0
random_state = check_random_state(random_state)

@rth rth changed the title DOC Sets random_state=0 to prevent warning in AffinityPropagation examples EXA Set random_state=0 in AffinityPropagation example Jun 17, 2021
@rth rth merged commit d44c7ae into scikit-learn:main Jun 17, 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.

2 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.