Given a joint probability table of shape (|X|, |Y|), with rows indexing and columns indexing , implement entropy_table(P, base=2) that returns a dict with the following keys (all as Python floats, in units of log base):
"H_X", "H_Y": the marginal entropies."H_XY": the joint entropy ."H_X_given_Y", "H_Y_given_X": the conditional entropies, e.g. ."I_XY": the mutual information ."NMI": the normalized mutual information , defined as when that minimum is .Conventions: is nonnegative; normalize it by its sum first (so raw counts also work). Use , so zero cells and zero-probability rows or columns contribute nothing and must not produce warnings. Tiny negative values from rounding (below in magnitude) should be returned as .