tabular
logo
  • Getting Started
  • User Guide
  • Tabular Checks
  • Vision Checks
  • API Reference
Report a problem Show Source
On this page
  • Imports
  • Running identifier_leakage check
  • Using the IdentifierLeakage check class

Note

Click here to download the full example code

Identifier Leakage#

Imports#

import matplotlib.pyplot as plt
import numpy as np
import pandas as pd

from deepchecks.tabular import Dataset
from deepchecks.tabular.checks import IdentifierLeakage

Generating Data

np.random.seed(42)
df = pd.DataFrame(np.random.randn(100, 3), columns=['x1', 'x2', 'x3'])
df['x4'] = df['x1'] * 0.05 + df['x2']
df['x5'] = df['x2']*121 + 0.01 * df['x1']
df['label'] = df['x5'].apply(lambda x: 0 if x < 0 else 1)
dataset = Dataset(df, label='label', index_name='x1', datetime_name='x2')

Out:

It is recommended to initialize Dataset with categorical features by doing "Dataset(df, cat_features=categorical_list)". No categorical features were passed, therefore heuristically inferring categorical features in the data.
0 categorical features were inferred

Running identifier_leakage check#

IdentifierLeakage().run(dataset)
Identifier Leakage


Using the IdentifierLeakage check class#

my_check = IdentifierLeakage(ppscore_params={'sample': 10})
my_check.run(dataset=dataset)
Identifier Leakage


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

Download Python source code: plot_identifier_leakage.py

Download Jupyter notebook: plot_identifier_leakage.ipynb

Gallery generated by Sphinx-Gallery

previous

Feature Label Correlation Change

next

Index Leakage

© Copyright 2021-2022, Deepchecks.

Created using Sphinx 4.5.0.