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,EntropyEstimatorKozachenko-Leonenko estimator for Shannon entropies.
- Attributes:
- *dataarray_like
The data used to estimate the entropy.
- k
int The number of nearest neighbors to consider.
- noise_level
float The standard deviation of the Gaussian noise to add to the data to avoid issues with zero distances.
- minkowski_p
float, \(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:
ValueErrorIf the number of nearest neighbors is not a positive integer
ValueErrorIf the noise level is negative
ValueErrorIf the Minkowski power parameter is invalid
Notes
Changing the number of nearest neighbors
kcan change the outcome, but the default value of \(k=4\) is recommended by [KStogbauerG11].