I have a large horse racing database that I am trying to create a model for. Currently I am training the model based on the whole database - however, in horse racing, I need to train the model in the context of a race - using historic race results.
How is it possible to train a model, with the data grouped by race? i.e. I would need it to predict the performance of a horse in a race, compared to the other horses in that race - not every other horse in the database.