Implement generalized get_infogain