entropy module

class datumaro.plugins.sampler.algorithm.entropy.SampleEntropy(data, inference)[source]

Bases: datumaro.plugins.sampler.algorithm.algorithm.InferenceResultAnalyzer

Entropy is a class that inherits an Sampler, calculates an uncertainty score based on an entropy, and get samples based on that score.

get_sample(method: str, k: int, n: int = 3) pandas.core.frame.DataFrame[source]

A function that extracts sample data and returns it. :param method:

  • ‘topk’: It extracts the k sample data with the

    highest uncertainty.

  • ‘lowk’: It extracts the k sample data with the

    lowest uncertainty.

  • ‘randomk’: Extract and return random k sample data.

Parameters
  • k – number of sample data

  • n – Parameters to be used in the randtopk method, Variable to first extract data of multiple n of k.

Returns

pd.DataFrame

Return type

Extracted sample data