nip.utils.maths.entropy_numpy

Contents

nip.utils.maths.entropy_numpy#

nip.utils.maths.entropy_numpy(labels: ndarray, bins: int | str = 'auto') ndarray[source]#

Compute the entropy of a set of labels, binned automatically.

Parameters:
  • labels (np.ndarray) – The labels. Should be a 1D array

  • bins (int | str, default='auto') – The number of bins to use for the histogram. If ‘auto’, the number of bins is determined automatically.

Returns:

np.ndarray – The entropy of the labels.