nlpatl.sampling.uncertainty.margin

class nlpatl.sampling.uncertainty.margin.MarginSampling(name='margin_sampling')[source]

Bases: nlpatl.sampling.sampling.Sampling

Sampling data points according to the margin confidence. Pick the lowest

probabilies difference between the highest class and second higest class.

Parameters

name (str) – Name of this sampling

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

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

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

Returns

Tuple of target indices and sampling values

Return type

Tuple of numpy.ndarray, numpy.ndarray