concatenate_divisions#

concatenate_divisions(partitioner: Partitioner, partition_division: List[float] | Tuple[float, ...] | Dict[str, float], division_id: int | str) Dataset[source]#

Create a dataset by concatenation of all partitions in the same division.

The divisions are created based on the partition_division and accessed based on the division_id. It can be used to create e.g. centralized dataset from federated on-edge test sets.

Parameters:
  • partitioner (Partitioner) – Partitioner object with assigned dataset.

  • partition_division (Union[List[float], Tuple[float, ...], Dict[str, float]]) – Fractions specifying the division of the partitions of a partitioner. You can think of this as on-edge division of the data into multiple divisions (e.g. into train and validation). E.g. [0.8, 0.2] or {“partition_train”: 0.8, “partition_test”: 0.2}.

  • division_id (Union[int, str]) – The way to access the division (from a List or DatasetDict). If your partition_division is specified as a list, then division_id represents an index to an element in that list. If partition_division is passed as a Dict, then division_id is a key of such dictionary.

Returns:

concatenated_divisions – A dataset created as concatenation of the divisions from all partitions.

Return type:

Dataset