There was an error while loading. Please reload this page.
1 parent 34bfe69 commit 8103be1Copy full SHA for 8103be1
1 file changed
maths/entropy.py
@@ -1,8 +1,3 @@
1
-from __future__ import annotations
2
-
3
-import math
4
-from collections import Counter
5
6
"""
7
In information theory, entropy is a measure of the uncertainty or randomness of a
8
source of data. It quantifies the expected amount of information contained in each
@@ -18,6 +13,10 @@
18
13
19
14
Reference: https://en.wikipedia.org/wiki/Entropy_(information_theory)
20
15
16
+from __future__ import annotations
17
+
+import math
+from collections import Counter
21
22
23
def shannon_entropy(probabilities: list[float]) -> float:
0 commit comments