.. 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_segment_performance.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_segment_performance.py: .. _plot_tabular_segment_performance: Segment Performance ******************* .. GENERATED FROM PYTHON SOURCE LINES 10-16 Load data ========= The dataset is the adult dataset which can be downloaded from the UCI machine learning repository. Dua, D. and Graff, C. (2019). UCI Machine Learning Repository [http://archive.ics.uci.edu/ml]. Irvine, CA: University of California, School of Information and Computer Science. .. GENERATED FROM PYTHON SOURCE LINES 16-19 .. code-block:: default from deepchecks.tabular.datasets.classification import adult .. GENERATED FROM PYTHON SOURCE LINES 20-22 Create Dataset ============== .. GENERATED FROM PYTHON SOURCE LINES 22-26 .. code-block:: default train_ds, validation_ds = adult.load_data() .. GENERATED FROM PYTHON SOURCE LINES 27-29 Classification Model ==================== .. GENERATED FROM PYTHON SOURCE LINES 29-33 .. code-block:: default model = adult.load_fitted_model() model .. rst-class:: sphx-glr-script-out .. code-block:: none Pipeline(steps=[('preprocessing', ColumnTransformer(transformers=[('num', SimpleImputer(), ['age', 'capital-gain', 'capital-loss', 'education-num', 'fnlwgt', 'hours-per-week']), ('cat', Pipeline(steps=[('imputer', SimpleImputer(strategy='most_frequent')), ('encoder', OrdinalEncoder())]), ['workclass', 'education', 'marital-status', 'occupation', 'relationship', 'race', 'sex', 'native-country'])])), ('model', RandomForestClassifier(max_depth=5, n_jobs=-1, random_state=0))]) .. GENERATED FROM PYTHON SOURCE LINES 34-38 .. code-block:: default from deepchecks.tabular.checks import SegmentPerformance SegmentPerformance(feature_1='workclass', feature_2='hours-per-week').run(validation_ds, model) .. rst-class:: sphx-glr-script-out .. code-block:: none /home/runner/work/deepchecks/deepchecks/deepchecks/tabular/checks/model_evaluation/segment_performance.py:72: DeprecationWarning: The SegmentPerformance check is deprecated and will be removed in the 0.11 version. Please use the WeakSegmentsPerformance check instead. .. raw:: html
Segment Performance


.. rst-class:: sphx-glr-timing **Total running time of the script:** ( 0 minutes 5.954 seconds) .. _sphx_glr_download_checks_gallery_tabular_model_evaluation_plot_segment_performance.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_segment_performance.py ` .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_segment_performance.ipynb ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_