DensityWeightedSampling<T>

Models & Types · AiDotNet.ActiveLearning

Implements density-weighted sampling for active learning.

Implements: IActiveLearningStrategy<T>

For Beginners

Density-weighted sampling combines uncertainty with density weighting to avoid selecting outliers. Even if a sample is uncertain, it may not be informative if it’s an outlier that doesn’t represent the data distribution.

How It Works

Formula: Score(x) = Uncertainty(x) × Density(x)^β

where Density(x) is computed using average distance to k nearest neighbors.

Parameters:

Advantages:

Reference: Settles, B. & Craven, M. (2008). “An Analysis of Active Learning Strategies for Sequence Labeling Tasks.”

Constructors

Constructor Summary
DensityWeightedSampling(double beta, int kNeighbors) Initializes a new instance of the DensityWeightedSampling class.

Properties

Property Summary
bool UseBatchDiversity { get; set; }
string Name { get; }

Methods

Method Summary
Dictionary<string, T> GetSelectionStatistics()
Vector<T> ComputeInformativenessScores(IFullModel<T, Tensor<T>, Tensor<T>> model, Tensor<T> unlabeledPool)
int[] SelectSamples(IFullModel<T, Tensor<T>, Tensor<T>> model, Tensor<T> unlabeledPool, int batchSize)