Generalize infogain computation to accept more categories (than F/M only)