-
-
Notifications
You must be signed in to change notification settings - Fork 25.9k
DOC Fix FutureWarning in cluster/plot_kmeans_assumptions.html #24928
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
DOC Fix FutureWarning in cluster/plot_kmeans_assumptions.html #24928
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note to reviewer: we need to be careful to not change the output of the algorithm.
y_pred = KMeans(n_clusters=3, n_init="auto", random_state=random_state).fit_predict( | ||
X_filtered | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
y_pred = KMeans(n_clusters=3, n_init="auto", random_state=random_state).fit_predict( | |
X_filtered | |
) | |
y_pred = KMeans(n_clusters=3, n_init=5, random_state=random_state).fit_predict( | |
X_filtered | |
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking at the results, we were not lucky with the initialization and we obtain a result that is not in line with the comment.
I propose to make 3 individual init and check that the result does not change compared to the version in main
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I set n_init=10
for the two cases where the plot was different to the one in main. I left the other two with n_init="auto"
. Is that fine, or should I also set them to a specific value?
The plot now looks exactly like the one in main
I checked locally and we are good. I think that we should revisit this example because with pinging @ArturoAmorQ on this last point ;) since this example could be "tutorialized" in this regards. |
Reference Issues/PRs
Fix towards #24876 .
What does this implement/fix? Explain your changes.
Fixed future warning
The default value of n_init will change from 10 to auto in 1.4. Set the value of n_init explicitly to suppress the warning
in plot_kmeans_assumptions.html.