Let's make this more robust checking that labs->get_num_labels() is larger than zero before making the division. Also, it seems even more reasonable to me to do this in train_machine, since the same StochasticSOSVM can be trained several times with different training data (thus, with different number of training examples).