nlpatl.sampling.clustering.nearest_mean

class nlpatl.sampling.clustering.nearest_mean.NearestMeanSampling(name='nearest_mean_sampling')[source]

Bases: nlpatl.sampling.sampling.Sampling

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

nearest data points per number of cluster.

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='139640344030608'>) –

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

Returns

Tuple of target indices and sampling values

Return type

Tuple of numpy.ndarray, numpy.ndarray