You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
calc::entropy_bits() is not calculating the entropy correctly. Fortunately, it works for the current use case, but should somebody else use it to calculate the entropy of a list with repeated elements the result would be totally wrong. Example:
>>>entropy_bits(list('abcabcabcabc')) # repeated elements, problem6.339850002884623# should be 1.5849625007211559>>>entropy_bits(list('abcdefghijkl')) # no element repetition, ok3.584962500721156# correct
The problem is not taking into consideration the number of times an element is repeated in the list. The fix is quite easy:
calc::entropy_bits() is not calculating the entropy correctly. Fortunately, it works for the current use case, but should somebody else use it to calculate the entropy of a list with repeated elements the result would be totally wrong.
Example:
The problem is not taking into consideration the number of times an element is repeated in the list. The fix is quite easy:
Note that
len(probs) == len(counts)
and are respectively ordered.The text was updated successfully, but these errors were encountered: