train_model function

Train a model across horizons and validation datasets