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 ifTrue
, shallow copy otherwise.Returns: Dataset – A new dataset with fields copied from this object and metadata set accordingly.
-
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). Ifnum_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 onnum_or_size_splits
.- num_or_size_splits (array or int) – If
-