peal.data.tabular_datasets.CompassDataset¶
- class peal.data.tabular_datasets.CompassDataset[source]¶
Bases:
SymbolicDatasetProPublica COMPAS recidivism dataset (FairML preprocessed csv).
On first use the csv is fetched from the DataResponsibly/fairDAGs GitHub mirror,
Two_yr_RecidivismbecomesTarget,African_Americanis copied to anis_blackcolumn (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_sizeis set from the csv header.- Parameters:
mode (
str) – Split to load.config (
DataConfig) – Dataset configuration;dataset_pathis the directory ofdata.csv.**kwargs – Forwarded to
SymbolicDataset.
Methods
Outlier scores of a batch; tabular data has none, so all zeros.
Attributes
- __init__(mode, config, **kwargs)[source]¶
Download/convert
data.csvif 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: