train_models function

makes a model object using the specified algorithms.