peal.data.tabular_datasets.GermanDataset

class peal.data.tabular_datasets.GermanDataset[source]

Bases: SymbolicDataset

German Credit dataset (OpenML credit-g).

On first use the frame is fetched with sklearn.datasets.fetch_openml, class is mapped to Target (good=1, bad=0), a binary sex column is derived from personal_status as the confounder, categorical columns are integer-coded and everything is cast to float before writing <dataset_path>/data.csv. config.input_size is set from the 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