KozachenkoLeonenkoEntropyEstimator

KozachenkoLeonenkoEntropyEstimator#

class infomeasure.estimators.entropy.KozachenkoLeonenkoEntropyEstimator(data, *, k: int = 4, noise_level=1e-10, minkowski_p=inf, base: int | float | str = 'e')[source]

Bases: RandomGeneratorMixin, EntropyEstimator

Kozachenko-Leonenko estimator for Shannon entropies.

Attributes:
dataarray_like

The data used to estimate the entropy.

kint

The number of nearest neighbors to consider.

noise_levelfloat

The standard deviation of the Gaussian noise to add to the data to avoid issues with zero distances.

minkowski_pfloat, \(1 \leq p \leq \infty\)

The power parameter for the Minkowski metric. Default is np.inf for maximum norm. Use 2 for Euclidean distance.

Raises:
ValueError

If the number of nearest neighbors is not a positive integer

ValueError

If the noise level is negative

ValueError

If the Minkowski power parameter is invalid

Notes

Changing the number of nearest neighbors k can change the outcome, but the default value of \(k=4\) is recommended by [KStogbauerG11].