aif360.datasets.Dataset

class aif360.datasets.Dataset(**kwargs)[source]

Abstract base class for datasets.

Methods

copy Convenience method to return a copy of this dataset.
export_dataset Save this Dataset to disk.
split Split this dataset into multiple partitions.
validate_dataset Error checking and type validation.
copy(deepcopy=False)[source]

Convenience method to return a copy of this dataset.

Parameters:deepcopy (bool, optional) – deepcopy() this dataset if True, shallow copy otherwise.
Returns:Dataset – A new dataset with fields copied from this object and metadata set accordingly.
export_dataset()[source]

Save this Dataset to disk.

split(num_or_size_splits, shuffle=False)[source]

Split this dataset into multiple partitions.

Parameters:
  • num_or_size_splits (array or int) – If num_or_size_splits is an int, k, the value is the number of equal-sized folds to make (if k does not evenly divide the dataset these folds are approximately equal-sized). If num_or_size_splits is an array of type int, the values are taken as the indices at which to split the dataset. If the values are floats (< 1.), they are considered to be fractional proportions of the dataset at which to split.
  • shuffle (bool, optional) – Randomly shuffle the dataset before splitting.
Returns:

list(Dataset) – Splits. Contains k or len(num_or_size_splits) + 1 datasets depending on num_or_size_splits.

validate_dataset()[source]

Error checking and type validation.