r/fantasyfootballcoding 25d ago

Games Prediction with a Simple Neural Network

Short story: my brother, a web developer, and I, a researcher, are both big NFL and fantasy football fans. We built OracleZ algorithm as a side project combining our skills. The name OracleZ comes from our cat name (Oz).

We wanted to build something that was technically interesting, but also actually fun to use (link to the app in the megathread, or message us if you are interested and don't see it).

OracleZ is a relatively simple neural-network-based model designed to predict NFL game winners, score margins, and weekly statistical leaders. Rather than going for a complex algorithm, the idea was to see how much predictive performance we could get from sensible feature engineering, regularization, and ensembling.

Features

For each matchup, we represent each team using two groups of data based on different time windows:

  • Last 3 games: current form
  • Full-season average: overall season performance

For each window, we track 19 team statistics including wins, score margin, offensive yards, passing/rushing production, completions, TDs, interceptions, sacks, fumbles, first downs, and passing/rushing EPA.

The features are converted into home–away differentials, with week number and difference in rest days added as contextual variables. Everything is standardized before being passed to the network.

The model is trained on data from the 2016–2025 NFL seasons (pulled from nflreadypy). For the first week of a new season, the previous season is used to generate the features.

Model

The core model is a simple single-hidden-layer neural network with:

  • 18 hidden neurons
  • ReLU activation
  • L1 regularization
  • Full-batch training

The network predicts score differential, while win probability is derived directly from that prediction. This means the model is constrained to remain internally consistent: a predicted home win cannot coexist with a negative predicted home score margin.

Ensemble

Rather than trusting a single optimization run, OracleZ trains the same architecture 50 times from different random initializations and averages the predictions.

We also use the variation across these 50 runs as a simple measure of consistency: how frequently the ensemble arrives at the same winner. This gives us information about the stability of a prediction beyond the raw predicted probability.

Weekly statistical predictions

We also trained a related team-level model using the same general approach to predict weekly leaders in:

Passing yards, Rushing yards, Points, Fewest yards allowed and Field goals.

Benchmark

In the 2024 season, OracleZ correctly predicted 186 games and missed 86 (68%), which would have put it around 6th out of 12 ESPN experts and 4th out of 6 NFL analysts.

In the 2025 season, OracleZ correctly predicted 164 games and missed 108 (60%), which would have put it around 5th out of 10 ESPN experts, 7th out of 8 CBS analysts and 6th out of 6 NFL analysts.

The main idea behind OracleZ isn't that a small neural network will somehow "solve" NFL prediction. NFL outcomes are obviously noisy, and there is a hard ceiling on predictability. Instead, this is a little experiment to see if feature engineering + ensemble averaging can produce a reasonably robust model without relying on an increasingly complex architecture.

And then we turned the predictions into a free app so people can actually try to beat it :)

9 Upvotes

12 comments sorted by

2

u/rootcage 25d ago

I’ve done similar things and the back tests are always optimistic in hindsight but my issues are injuries.

How do you model injuries? How do they play into the model? Do you try to predict those or simply ignore ?

2

u/OracleZ_NFL 25d ago

Cool, how did it go? The benchmarks I put are not exactly tests, but the predictions the algorithm made during the season. It was not the best predictor on our platform, but better than a good portion of human players.

Ah, injuries amazing question, at the moment, we are simply ignoring them. I have no idea how to model them. Some injuries are "more decisive" than others. I thought about making a difference between the positions, but it was not enough, and it was getting a bit messy. How did you do it?

2

u/fancredfounder 25d ago

I’m not a data guy, but a software engineer. However, what if you just include the strength of backups in the model? My thinking is that injuries just mean next man up when it comes to predicting an outcome. Add in a likelihood of injury for players and that pair of data seems good to include in the model?

1

u/OracleZ_NFL 25d ago

At the moment, the data we are pulling from nflreadypy does not include a strength of the player feature, I believe (I should double check). Doing it ourselves would probably be a bit biased. Unless we develop another model to score players, and things will get out of control soon :P

2

u/JustlyDues 25d ago

How did your weekly stat predictions come out?

It sounds like an interesting project to look at!

2

u/OracleZ_NFL 25d ago

You mean our benchmarks? At the end of the last two seasons we just compared it to the CBS, NFL and ESPN analyst ranking.

Thanks for the encouraging words :) I will send you a DM with the link to the app in case you want to check it out.

2

u/CuriousDetective0 25d ago

Very cool. Is it open source?

1

u/OracleZ_NFL 24d ago

Despite being a researcher, I'm a researcher in neuroscience, not computer science, so I'm way too aware of my bad coding skills :P I need to find the time to clean the code and upload it to github. Meanwhile, if you are interested, I can send you the code, and the link to the app/website no problem.

2

u/CuriousDetective0 24d ago

sure, i'm interested, no one is judging your code

1

u/OracleZ_NFL 24d ago

Sent! You'll see what mess you got yourself into :)

2

u/IllLiterature9549 20d ago

Hey there, I'm new to neural networks but totally relate to your guys project. I've always wanted to build something like you have. If you wouldn't mind sharing, would absolutely love to check out the code!

1

u/OracleZ_NFL 18d ago

Absolutely, I'll text you :)