nlpatl.sampling.clustering.farthest

class nlpatl.sampling.clustering.farthest.FarthestSampling(name='farthest_sampling')[source]

Bases: nlpatl.sampling.sampling.Sampling

Sampling data points according to the distances of cluster centriod. Picking n

farthest data points per number of cluster. http://zhaoshuyang.com/static/documents/MAL2.pdf

Parameters

name (str) – Name of this sampling

sample(data, groups, num_sample)[source]
Parameters
  • x – Values of determine the sampling

  • num_sample (int) – Total number of sample for labeling

  • data (<MagicMock id='139640344151520'>) –

  • groups (<MagicMock id='139640344171664'>) –

Returns

Tuple of target indices and sampling values

Return type

Tuple of numpy.ndarray, numpy.ndarray