-
-
Notifications
You must be signed in to change notification settings - Fork 25.9k
[MRG] improving plot_digits_pipe.py by adjusting parameters and making the graph more clear #14346
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
Conversation
thanks for the PR, then run time of this example is <10s, so we don't need to make it faster. |
I'll respectfully re-open: this example was listed as "needs speed up" in the original issue #13383. A small speed-up is always useful, especially when it comes from a new sprint attendee. In addition to the proposed changes, I'd like to suggest a few more to improve the example:
@Timsaur would you be able to handle these? Feel free to ask for help. |
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.
LGTM if all goes green, thanks @Timsaur!
examples/compose/plot_digits_pipe.py
Outdated
@@ -56,8 +56,8 @@ | |||
pca.fit(X_digits) | |||
|
|||
fig, (ax0, ax1) = plt.subplots(nrows=2, sharex=True, figsize=(6, 6)) | |||
ax0.plot(pca.explained_variance_ratio_, linewidth=2) | |||
ax0.set_ylabel('PCA explained variance') | |||
ax0.plot(1 + np.arange(64), pca.explained_variance_ratio_, '+', linewidth=2) |
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.
ax0.plot(1 + np.arange(64), pca.explained_variance_ratio_, '+', linewidth=2) | |
ax0.plot(np.arange(1, 65), pca.explained_variance_ratio_, '+', linewidth=2) |
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.
np.arange(1, pca.n_components_ + 1)
?
@Timsaur could you please resolve the merge conflicts? |
@Timsaur don't hesitate to ask if you need help with conflict resolution |
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.
Reference Issues/PRs
What does this implement/fix? Explain your changes.
changed hyperparameters from:
to:
Any other comments?
the outputs for the original hyperparameters:
after changes: