NonIIDClientSplitter<T>

Models & Types · AiDotNet.Preprocessing.DataPreparation.Splitting.FederatedLearning

Non-IID (non-Independent and Identically Distributed) client splitter for federated learning.

Inheritance: DataSplitterBase<T> → NonIIDClientSplitter<T>

For Beginners

In real-world federated learning, data on different clients is often NOT identically distributed. For example, users’ photos on different phones reflect their individual preferences. This splitter simulates such heterogeneous distributions.

How It Works

Heterogeneity Types:

  • Label skew: Each client has only some classes
  • Quantity skew: Clients have different amounts of data
  • Feature skew: Clients have different feature distributions

When to Use:

  • Realistic federated learning experiments
  • Testing robustness to heterogeneous data
  • Simulating domain adaptation scenarios

Constructors

Constructor Summary
NonIIDClientSplitter(int numClients, int classesPerClient, double testRatio, bool allowOverlap, bool shuffle, int randomSeed) Creates a new Non-IID client splitter.

Properties

Property Summary
bool RequiresLabels { get; }
int NumSplits { get; }
string Description { get; }

Methods

Method Summary
DataSplitResult<T> Split(Matrix<T> X, Vector<T> y)
IEnumerable<DataSplitResult<T>> GetSplits(Matrix<T> X, Vector<T> y)