diff --git a/examples/release_highlights/plot_release_highlights_1_2_0.py b/examples/release_highlights/plot_release_highlights_1_2_0.py index e46c821f1f9e9..be44e0465f13c 100644 --- a/examples/release_highlights/plot_release_highlights_1_2_0.py +++ b/examples/release_highlights/plot_release_highlights_1_2_0.py @@ -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` # -----------------------------------------------