fair_forge.datasets¶
Classes
|
|
|
|
|
A dataset containing features, labels, and groups. |
Functions
|
Create slices for feature grouping based on column prefixes. |
|
Load the Adult dataset with specified group information. |
|
Load a dummy dataset for testing purposes, based on a mixture of 2 2D Gaussians. |
|
Load the EthicML toy dataset. |
- class fair_forge.datasets.GroupDataset(data: ndarray[tuple[Any, ...], dtype[float32]], target: ndarray[tuple[Any, ...], dtype[int32]], groups: ndarray[tuple[Any, ...], dtype[int32]], name: str, feature_grouping: list[slice], feature_names: list[str])[source]¶
Bases:
NamedTuple
A dataset containing features, labels, and groups.
- Parameters:
data – Features of the dataset.
target – Labels of the dataset.
groups – Groups of the dataset.
name – Name of the dataset.
feature_grouping – Slices indicating groups of features.
feature_names – Names of the features in the dataset.
- fair_forge.datasets.grouping_by_prefix(*, columns: list[str], prefixes: list[str]) list[slice] [source]¶
Create slices for feature grouping based on column prefixes.
- fair_forge.datasets.load_adult(group: AdultGroup, *, group_in_features: bool = False, binarize_nationality: bool = False, binarize_race: bool = False) GroupDataset [source]¶
Load the Adult dataset with specified group information.
- Parameters:
group – The group to use for the dataset.
- Returns:
A Dataset object containing the Adult dataset.
- fair_forge.datasets.load_dummy_dataset(seed: int) GroupDataset [source]¶
Load a dummy dataset for testing purposes, based on a mixture of 2 2D Gaussians.
The groups are random.
- Parameters:
seed – Random seed for reproducibility.
- fair_forge.datasets.load_ethicml_toy(group_in_features: bool = False) GroupDataset [source]¶
Load the EthicML toy dataset.