peal.data.tabular_datasets.CompassDataset

class peal.data.tabular_datasets.CompassDataset[source]

Bases: SymbolicDataset

ProPublica COMPAS recidivism dataset (FairML preprocessed csv).

On first use the csv is fetched from the DataResponsibly/fairDAGs GitHub mirror, Two_yr_Recidivism becomes Target, African_American is copied to an is_black column (the confounder the teachers look at), categorical columns are integer-coded and everything is cast to float before writing <dataset_path>/data.csv. config.input_size is set from the csv header.

Parameters:
  • mode (str) – Split to load.

  • config (DataConfig) – Dataset configuration; dataset_path is the directory of data.csv.

  • **kwargs – Forwarded to SymbolicDataset.

Methods

calculate_outlier_score

Outlier scores of a batch; tabular data has none, so all zeros.

Attributes

__init__(mode, config, **kwargs)[source]

Download/convert data.csv if missing, then build the dataset.

calculate_outlier_score(x)[source]

Outlier scores of a batch; tabular data has none, so all zeros.

Parameters:

x (torch.Tensor) – Batch of samples [B, ...].

Returns:

{"absolute": zeros[B], "relative": zeros[B]}.

Return type:

dict