Add support for numbers of samples to train