Segment Performance#

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.

from deepchecks.tabular.datasets.classification import adult

Create Dataset#

Classification Model#

model = adult.load_fitted_model()
model
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))])
from deepchecks.tabular.checks import SegmentPerformance

SegmentPerformance(feature_1='workclass', feature_2='hours-per-week').run(validation_ds, model)
/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.
Segment Performance


Total running time of the script: ( 0 minutes 5.954 seconds)

Gallery generated by Sphinx-Gallery