I don't see where you check for that case. `classes_[k]` might contain non-integer values. Hence I think your code would work even for that case (which is good!). Can you just add a test case for that please?