Skip to content

Conversation

selmanozleyen
Copy link
Member

Fixes: #1035

def _entropy(
xx: NDArrayA,
) -> float:
"""Get entropy of an array."""
Copy link
Member

@flying-sheep flying-sheep Oct 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is what that does right?

Suggested change
"""Get entropy of an array."""
"""Compute Shannon entropy of an array of probability values (in nats)."""

Nats instead of Shannons, because you use the natural logarithm instead of log2.

Maybe also quote why the result is 0 if the sum is 0? https://stats.stackexchange.com/a/433096

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

sepal numba compilation options changes the results significantly
2 participants