Skip to content
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

fix(docs): Add screenshot of cross-validation plot #634

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions examples/plot_03_cross_validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,18 @@
cv_results = cross_validate(lasso, X, y, cv=3, project=my_project_gs)

my_project_gs.get_item("cross_validation").plot

# %%
# Because Plotly graphs currently do not yet properly render in our docs engine due to `a bug in Plotly <https://github.com/plotly/plotly.py/issues/4828>`_,
# we also show a screenshot below.
# Alternatively, if you zoom in or out in your browser window, the Plotly graph should display properly again.

import matplotlib.pyplot as plt
import matplotlib.image as mpimg

img = mpimg.imread("plot_03_cross_validate_plot_screenshot.png")
fig, ax = plt.subplots()
# fig.tight_layout(pad=0.01)
fig.subplots_adjust(left=0.01, right=0.99, bottom=0.01, top=0.99)
ax.axis("off")
ax.imshow(img)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.