Essential Math, Editors Pick, Mathematics, Data Science, Machine Learning.
negative logarithm function encodes the idea that a very unlikely event (probability around 0) is associated with a large quantity of information and a likely event (probability around 1) is associated with a quantity of information around 0. Since you used a base-two logarithm np.log2(), the