By the way, I was wondering, does this also work when labels are not in [0..n_classes-1]? In particular, does this work with string labels? If so, can you add tests for that.