.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "checks_gallery/tabular/model_evaluation/plot_regression_error_distribution.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note Click :ref:`here ` to download the full example code .. rst-class:: sphx-glr-example-title .. _sphx_glr_checks_gallery_tabular_model_evaluation_plot_regression_error_distribution.py: .. _plot_tabular_regression_error_distribution: Regression Error Distribution ***************************** .. GENERATED FROM PYTHON SOURCE LINES 10-12 Imports ======= .. GENERATED FROM PYTHON SOURCE LINES 12-20 .. code-block:: default from sklearn.datasets import load_diabetes from sklearn.ensemble import GradientBoostingRegressor from sklearn.model_selection import train_test_split from deepchecks.tabular import Dataset from deepchecks.tabular.checks import RegressionErrorDistribution .. GENERATED FROM PYTHON SOURCE LINES 21-23 Generating data =============== .. GENERATED FROM PYTHON SOURCE LINES 23-33 .. code-block:: default diabetes_df = load_diabetes(return_X_y=False, as_frame=True).frame train_df, test_df = train_test_split(diabetes_df, test_size=0.33, random_state=42) train = Dataset(train_df, label='target', cat_features=['sex']) test = Dataset(test_df, label='target', cat_features=['sex']) clf = GradientBoostingRegressor(random_state=0) _ = clf.fit(train.data[train.features], train.data[train.label_name]) .. GENERATED FROM PYTHON SOURCE LINES 34-36 Running RegressionErrorDistribution check (normal distribution) =============================================================== .. GENERATED FROM PYTHON SOURCE LINES 36-39 .. code-block:: default check = RegressionErrorDistribution() .. GENERATED FROM PYTHON SOURCE LINES 40-43 .. code-block:: default check.run(test, clf) .. raw:: html
Regression Error Distribution


.. GENERATED FROM PYTHON SOURCE LINES 44-46 Skewing the data ---------------- .. GENERATED FROM PYTHON SOURCE LINES 46-49 .. code-block:: default test.data[test.label_name] = 150 .. GENERATED FROM PYTHON SOURCE LINES 50-52 Running RegressionErrorDistribution check (abnormal distribution) ================================================================= .. GENERATED FROM PYTHON SOURCE LINES 52-55 .. code-block:: default check = RegressionErrorDistribution() .. GENERATED FROM PYTHON SOURCE LINES 56-58 .. code-block:: default check.run(test, clf) .. raw:: html
Regression Error Distribution


.. rst-class:: sphx-glr-timing **Total running time of the script:** ( 0 minutes 0.288 seconds) .. _sphx_glr_download_checks_gallery_tabular_model_evaluation_plot_regression_error_distribution.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_regression_error_distribution.py ` .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_regression_error_distribution.ipynb ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_