Closed dglmoore closed 7 years ago
Inform added conditional entropy in the v0.0.5 release. The next release of PyInform should include a wrapper for conditional entropy.
def conditional_entropy(xs, ys, bx=0, by=0, base=2.0, local=False):
from pyinform.conditionalentropy import conditional_entropy xs = [0,0,1,1,1,1,0,0,0] ys = [1,0,0,1,0,0,1,0,0] conditional_entropy(xs, ys) # == 0.899985 conditional_entropy(ys, xs) # == 0.972765 conditional_entropy(xs, ys, local=True) # == [1.322, 0.737, 0.415, 2.000, 0.415, 0.415, 1.322, 0.737, 0.737] conditional_entropy(ys, xs, local=True) # == [0.585, 1.000, 1.000, 1.585, 1.000, 1.000, 0.585, 1.000, 1.000]
Inform added conditional entropy in the v0.0.5 release. The next release of PyInform should include a wrapper for conditional entropy.
Proposed API
Example Usage