SpatialSplitter<T>

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

Spatial splitter for geographic or coordinate-based data.

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

For Beginners

When working with geographic data (like weather stations, property prices by location, or ecological surveys), spatial autocorrelation means nearby points are often similar. Random splitting would cause data leakage.

How It Works

How It Works:

  1. Divide the spatial domain into grid blocks
  2. Randomly assign entire blocks to train or test
  3. All samples within a block stay together

When to Use:

  • Remote sensing and satellite imagery
  • Environmental and ecological modeling
  • Real estate price prediction
  • Any geospatial machine learning task

Constructors

Constructor Summary
SpatialSplitter(double testSize, int nBlocksX, int nBlocksY, int xColumn, int yColumn, bool shuffle, int randomSeed) Creates a new spatial splitter.

Properties

Property Summary
string Description { get; }

Methods

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