Predicting Win Probabilities In-Game I'm looking to predict the probability of a team winning a game in basketball so that I can create something close to this: 
If you can't see the picture, it's a graph with time remaining on the x-axis and the probability of winning on the y-axis.
I've tried looking at similar projects online but all of them either do not show their code or only show how they created the model and none of their data. I have every possession from the 2000-01 season with the seconds remaining in the game and the score differential. I originally had it formatted so that each possession had the probability the team would win the game, before the game started, and a 0/1 representing whether or not the team had won the game. Shown by a smaller mock dataset here:
I realized that doesn't make sense because each possession isn't associated with a 0/1 or the starting probability, rather the entire game is. What would be the best way to format my data so that I can obtain the probability a team will win the game after each possession?

*

*The definition of a possession per the NBA: A team is in possession when a player is holding, dribbling or passing the ball. Team possession ends when the defensive team gains possession or the ball hits the rim of the
offensive team.

 A: Not a sports modeler here, so anyone with a better idea would be more than welcome.
It looks like you have both time-varying and non-varying predictors. You can feed both into your model by having a large design matrix with one row per second, where the non-varying predictors will simply be constant throughout a game. You will then stack the design matrix for each game on top of each other. I don't know basketball from Alpha Centauri, but my guess for reasonable predictors would be:

*

*a binary predictor indicating who is in possession

*a numerical predictor giving the score differential

*a numerical predictor indicating the number of seconds left

*possibly multiple predictors for characteristics or quality indicators of the players at each position, for both teams - perhaps categorical predictors giving the players' names would be enough

*a numerical predictor giving how many time outs each team has left

The target value would again be a time-constant vector, and it would be binary (for classification), or numerical (for predicting the score differential).
If you run a ML model, that should do it, those account for nonlinearities and interactions automatically. If you feed this into a classical statistical model, you might want to include transformations of time remaining (e.g., using splines), perhaps interaction terms.
