AntiClusteringSplitter<T>

Models & Types ยท AiDotNet.Preprocessing.DataPreparation.Splitting.Specialized

Anti-clustering splitter that maximizes diversity within each split.

Inheritance: DataSplitterBase<T> โ†’ AntiClusteringSplitter<T>

For Beginners

While clustering groups similar items together, anti-clustering does the opposite - it ensures each group (train/test) contains a diverse mix of samples covering the entire data space.

How It Works

How It Works:

  1. Compute pairwise distances between all samples
  2. Iteratively assign samples to train/test sets
  3. At each step, maximize the diversity within each set

When to Use:

  • When you want both train and test to be representative
  • Survey sampling where you want diverse groups
  • A/B testing to ensure comparable groups

Constructors

Constructor Summary
AntiClusteringSplitter(double testSize, bool shuffle, int randomSeed) Creates a new anti-clustering splitter.

Properties

Property Summary
string Description { get; }

Methods

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