Stepwise optimality, split in training and validation set