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
TInputThe client feature type.
TOutputThe 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
userIdsIReadOnlyList<string>Ordered list of user IDs in this split.
userDataIReadOnlyDictionary<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
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
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
clientIdToUserIdIReadOnlyDictionary<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.