Table of Contents

Class LeafFederatedSplit<TInput, TOutput>

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

Represents a single LEAF split (train/test) as per-client datasets.

public sealed class LeafFederatedSplit<TInput, TOutput>

Type Parameters

TInput

The client feature type.

TOutput

The client label type.

Inheritance
LeafFederatedSplit<TInput, TOutput>
Inherited Members

Remarks

LEAF is a federated learning benchmark suite where each user corresponds to one client. This type preserves that structure by storing one dataset per user.

For Beginners: Instead of one big dataset for everyone, federated learning uses many small datasets — one per device or organization. This class stores that "one dataset per client" view of the data.

Constructors

LeafFederatedSplit(IReadOnlyList<string>, IReadOnlyDictionary<string, FederatedClientDataset<TInput, TOutput>>)

Initializes a new instance of the LeafFederatedSplit<TInput, TOutput> class.

public LeafFederatedSplit(IReadOnlyList<string> userIds, IReadOnlyDictionary<string, FederatedClientDataset<TInput, TOutput>> userData)

Parameters

userIds IReadOnlyList<string>

Ordered list of user IDs in this split.

userData IReadOnlyDictionary<string, FederatedClientDataset<TInput, TOutput>>

Mapping from user ID to that user's local dataset.

Properties

ClientCount

Gets the number of clients/users in this split.

public int ClientCount { get; }

Property Value

int

UserData

Gets the per-user datasets in this split.

public IReadOnlyDictionary<string, FederatedClientDataset<TInput, TOutput>> UserData { get; }

Property Value

IReadOnlyDictionary<string, FederatedClientDataset<TInput, TOutput>>

UserIds

Gets the ordered list of user IDs in this split.

public IReadOnlyList<string> UserIds { get; }

Property Value

IReadOnlyList<string>

Methods

ToClientIdDictionary(out IReadOnlyDictionary<int, string>)

Converts this split into the Dictionary<int, FederatedClientDataset> form used by trainers.

public Dictionary<int, FederatedClientDataset<TInput, TOutput>> ToClientIdDictionary(out IReadOnlyDictionary<int, string> clientIdToUserId)

Parameters

clientIdToUserId IReadOnlyDictionary<int, string>

Mapping from assigned client IDs (0..N-1) to LEAF user IDs.

Returns

Dictionary<int, FederatedClientDataset<TInput, TOutput>>

Per-client datasets keyed by stable sequential client IDs.