Table of Contents

Class LeafShakespeareFederatedDatasetLoader

Namespace
AiDotNet.FederatedLearning.Benchmarks.Leaf
Assembly
AiDotNet.dll

Loads the LEAF Shakespeare benchmark JSON files into per-client datasets.

public sealed class LeafShakespeareFederatedDatasetLoader
Inheritance
LeafShakespeareFederatedDatasetLoader
Inherited Members

Remarks

Shakespeare is a federated next-character prediction benchmark. LEAF stores each sample as a fixed-length character window (x) and the next character (y).

For Beginners: This loader reads LEAF JSON and returns one dataset per user so federated learning simulations match the benchmark's per-user partitioning.

Methods

LoadDatasetFromFiles(string, string?, LeafFederatedDatasetLoadOptions?)

Loads a LEAF Shakespeare train dataset and optional test dataset from files.

public LeafFederatedDataset<string[], string[]> LoadDatasetFromFiles(string trainFilePath, string? testFilePath = null, LeafFederatedDatasetLoadOptions? options = null)

Parameters

trainFilePath string
testFilePath string
options LeafFederatedDatasetLoadOptions

Returns

LeafFederatedDataset<string[], string[]>

LoadSplitFromFile(string, LeafFederatedDatasetLoadOptions?)

Loads a LEAF Shakespeare split (train/test) from a JSON file.

public LeafFederatedSplit<string[], string[]> LoadSplitFromFile(string filePath, LeafFederatedDatasetLoadOptions? options = null)

Parameters

filePath string
options LeafFederatedDatasetLoadOptions

Returns

LeafFederatedSplit<string[], string[]>

LoadSplitFromJson(string, LeafFederatedDatasetLoadOptions?)

Loads a LEAF Shakespeare split (train/test) from a JSON string.

public LeafFederatedSplit<string[], string[]> LoadSplitFromJson(string json, LeafFederatedDatasetLoadOptions? options = null)

Parameters

json string
options LeafFederatedDatasetLoadOptions

Returns

LeafFederatedSplit<string[], string[]>