blazefl.utils.FilteredDataset#
- class blazefl.utils.FilteredDataset(indices: list[int], original_data: list, original_targets: list | None = None, transform: Callable | None = None, target_transform: Callable | None = None)[source]#
Bases:
Dataset
A dataset wrapper that filters and transforms a subset of the original dataset.
This class allows selecting specific data points by their indices and applying optional transformations to the data and targets.
- data#
The filtered subset of the original dataset.
- Type:
list
- targets#
The filtered subset of targets, if provided.
- Type:
list | None
- transform#
A function to apply transformations to the data.
- Type:
Callable | None
- target_transform#
A function to apply
- Type:
Callable | None
- transformations to the targets.
- __init__(indices: list[int], original_data: list, original_targets: list | None = None, transform: Callable | None = None, target_transform: Callable | None = None) None [source]#
Initialize the FilteredDataset.
- Parameters:
indices (list[int]) – Indices of the data points to include in the dataset.
original_data (list) – The original dataset.
original_targets (list | None) – The original targets, if available.
transform (Callable | None) – Transformation function for the data.
target_transform (Callable | None) – Transformation function for the targets.
Methods
__init__
(indices, original_data[, ...])Initialize the FilteredDataset.