-
Notifications
You must be signed in to change notification settings - Fork 0
Basic Usage
Raphael Constantinis edited this page Jul 23, 2025
·
1 revision
Welcome to the entropic_measurement package! This page introduces the main functionality with clear examples to help new users get started.
The entropic_measurement library provides tools for calculating entropy measures for data analysis and scientific research. It supports workflows for both simple and advanced entropy computations.
pip install entropic_measurementBelow is a basic example of how to use the library for Shannon entropy calculation:
from entropic_measurement import ShannonEntropy
data = [0.2, 0.5, 0.3]
shannon = ShannonEntropy()
result = shannon.compute(data)
print(f"Shannon Entropy: {result}")- ShannonEntropy: Computes classic Shannon entropy for a probability distribution.
- RenyiEntropy: For Renyi entropy, parameterized by the order alpha.
- TsallisEntropy: For Tsallis entropy, also with an adjustable parameter q.
from entropic_measurement import RenyiEntropy
data = [0.1, 0.4, 0.5]
renyi = RenyiEntropy(alpha=2)
result = renyi.compute(data)
print(f"Renyi Entropy (alpha=2): {result}")from entropic_measurement import TsallisEntropy
tsallis = TsallisEntropy(q=1.5)
data = [0.25, 0.25, 0.25, 0.25]
result = tsallis.compute(data)
print(f"Tsallis Entropy (q=1.5): {result}")- Input data should be valid probability distributions (sum to 1).
- Explore the API for more features like vectorized operations and custom distributions.
See also the API Reference for class details and advanced usage tips.