Machine Learning, Entropy, Information Theory, Python.
plist=[(event.count(i)/event_space) for i in event_set] # Logarithmic scale wted_logplist=[j*log2(j) for j in plist] ent=sum(wted_logplist) if ent!=0: return -ent else: return ent It is good idea to always test our code so we will test with our earlier example of picking blue and green balls from 3