LeafFederatedDatasetLoader<T>

Models & Types · AiDotNet.FederatedLearning.Benchmarks.Leaf

Loads LEAF benchmark JSON files into per-client datasets suitable for federated learning simulation.

Inheritance: FederatedLearningComponentBase<T> → LeafFederatedDatasetLoader<T>

For Beginners

This loader reads one LEAF JSON file and converts it into a set of “client datasets” — one dataset per user — so federated learning trainers can run simulations.

How It Works

LEAF stores federated datasets in a JSON structure containing:

  • users: user/client IDs
  • num_samples: declared sample counts per user
  • user_data: per-user objects with x (features) and y (labels)

Constructors

Constructor Summary
LeafFederatedDatasetLoader()

Methods

Method Summary
LeafFederatedDataset<Matrix<T>, Vector<T>> LoadDatasetFromFiles(string trainFilePath, string testFilePath, LeafFederatedDatasetLoadOptions options) Loads a LEAF train dataset and optional test dataset from files.
LeafFederatedSplit<Matrix<T>, Vector<T>> LoadSplitFromFile(string filePath, LeafFederatedDatasetLoadOptions options) Loads a LEAF split (train/test) from a JSON file.
LeafFederatedSplit<Matrix<T>, Vector<T>> LoadSplitFromJson(string json, LeafFederatedDatasetLoadOptions options) Loads a LEAF split (train/test) from a JSON string.