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

DOC add displays in highlights #25042

Merged
merged 2 commits into from Nov 25, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
26 changes: 26 additions & 0 deletions examples/release_highlights/plot_release_highlights_1_2_0.py
Expand Up @@ -82,6 +82,32 @@
)
X.head()

# %%
# New and enhanced displays
# -------------------------
# The :class:`~metrics.PredictionErrorDisplay` provides a one way to analyze
# regression models in a qualitative manner.
glemaitre marked this conversation as resolved.
Show resolved Hide resolved
glemaitre marked this conversation as resolved.
Show resolved Hide resolved
import matplotlib.pyplot as plt
from sklearn.metrics import PredictionErrorDisplay

X, y = load_diabetes(return_X_y=True, as_frame=True)
glemaitre marked this conversation as resolved.
Show resolved Hide resolved
fig, axs = plt.subplots(nrows=1, ncols=2, figsize=(12, 5))
PredictionErrorDisplay.from_estimator(
hist_no_interact, X, y, kind="actual_vs_predicted", ax=axs[0]
)
PredictionErrorDisplay.from_estimator(
hist_no_interact, X, y, kind="residual_vs_predicted", ax=axs[1]
)

# %%
# The :class:`~model_selection.LearningCurveDisplay` is now available to plot
glemaitre marked this conversation as resolved.
Show resolved Hide resolved
# results from :func:`~model_selection.learning_curve`.
from sklearn.model_selection import LearningCurveDisplay

LearningCurveDisplay.from_estimator(
hist_no_interact, X, y, cv=5, n_jobs=2, train_sizes=np.linspace(0.1, 1, 5)
)

# %%
# Experimental Array API support in :class:`~discriminant_analysis.LinearDiscriminantAnalysis`
# --------------------------------------------------------------------------------------------
Expand Down