aif360.datasets.BankDataset

class aif360.datasets.BankDataset(label_name='y', favorable_classes=['yes'], protected_attribute_names=['age'], privileged_classes=[<function BankDataset.<lambda>>], instance_weights_name=None, categorical_features=['job', 'marital', 'education', 'default', 'housing', 'loan', 'contact', 'month', 'day_of_week', 'poutcome'], features_to_keep=[], features_to_drop=[], na_values=['unknown'], custom_preprocessing=None, metadata=None)[source]

Bank marketing Dataset.

See aif360/data/raw/bank/README.md.

See StandardDataset for a description of the arguments.

By default, this code converts the ‘age’ attribute to a binary value where privileged is 25 <= age < 60 and unprivileged is age < 25 or age >= 60 as suggested in Le Quy, Tai, et al. [1].

References

learning.” Wiley Interdisciplinary Reviews: Data Mining and Knowledge Discovery 12.3 (2022): e1452.

Methods

align_datasets

Align the other dataset features, labels and protected_attributes to this dataset.

convert_to_dataframe

Convert the StructuredDataset to a pandas.DataFrame.

copy

Convenience method to return a copy of this dataset.

export_dataset

Export the dataset and supporting attributes TODO: The preferred file format is HDF

import_dataset

Import the dataset and supporting attributes TODO: The preferred file format is HDF

split

Split this dataset into multiple partitions.

subset

Subset of dataset based on position :param indexes: iterable which contains row indexes

temporarily_ignore

Temporarily add the fields provided to ignore_fields.

validate_dataset

Error checking and type validation.

__init__(label_name='y', favorable_classes=['yes'], protected_attribute_names=['age'], privileged_classes=[<function BankDataset.<lambda>>], instance_weights_name=None, categorical_features=['job', 'marital', 'education', 'default', 'housing', 'loan', 'contact', 'month', 'day_of_week', 'poutcome'], features_to_keep=[], features_to_drop=[], na_values=['unknown'], custom_preprocessing=None, metadata=None)[source]

See StandardDataset for a description of the arguments.

By default, this code converts the ‘age’ attribute to a binary value where privileged is 25 <= age < 60 and unprivileged is age < 25 or age >= 60 as suggested in Le Quy, Tai, et al. [1].

References

learning.” Wiley Interdisciplinary Reviews: Data Mining and Knowledge Discovery 12.3 (2022): e1452.