`np.arange(n_classes, dtype=np.int)` could be called only once.