Enable builder pattern, and split `train()` into two functions, one for classification and the other for regression