Mutual information measures how much knowing a feature reduces uncertainty about the label. Unlike correlation, it catches non-linear relationships.
For discrete arrays: (in nats), using empirical frequencies and skipping zero cells.
Implement:
entropy(x): mutual_information(x, y)select_k_best(X, y, k): the indices of the k columns with the highest MI with y, best first (ties: lower index)