Skip to content

Commit

Permalink
DOC add displays in highlights (#25042)
Browse files Browse the repository at this point in the history
  • Loading branch information
glemaitre committed Nov 25, 2022
1 parent 40d7d88 commit 1912ae5
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions examples/release_highlights/plot_release_highlights_1_2_0.py
Expand Up @@ -68,6 +68,31 @@
)
hist_no_interact.fit(X, y)

# %%
# New and enhanced displays
# -------------------------
# :class:`~metrics.PredictionErrorDisplay` provides a way to analyze regression
# models in a qualitative manner.
import matplotlib.pyplot as plt
from sklearn.metrics import PredictionErrorDisplay

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]
)

# %%
# :class:`~model_selection.LearningCurveDisplay` is now available to plot
# 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)
)

# %%
# Faster parser in :func:`~datasets.fetch_openml`
# -----------------------------------------------
Expand Down

0 comments on commit 1912ae5

Please sign in to comment.