HADI MOUMENI

P4P

In the UFC, there’s a champ per each division, followed by 15 ranked fighters, and a pool of unranked fighters below that. I find that most of the time I really don’t agree with the rankings or the matchmaking. These rankings are voted on by the media and it shows. P4P is an algorithm that ranks fighters holistically based off the level of opponents and performance in the octagon. The idea of a UFC elo engine isn’t originally mine, I got it from this really cool YouTube video. That engine functions more as a “greatest of all time” list, whereas this is an active reflection on the sport. It also re-runs itself every week after each event.

Highlights

  • A Glicko-2 rating engine paired with a per-fight performance layer. Wins and how that victory happened matters. Finishes, title fights, historical data, and the quality of the opponent all move the number differently.
  • Generates rankings per weight class; men’s and women’s + pound-for-pound, with recency decay and inactivity penalties built in.
  • Disagreements flags where the data diverges from the official UFC rankings.
  • Pick any two fighters and get a win probability plus how the fight most likely ends (KO, submission, decision), all from leakage-free pre-fight features.
  • Robbery section scores the decisions the judges most likely got wrong and ranks the worst offenders. It independently surfaced Condit-Lawler, a famously bad call, near the top.
  • Every recent prediction the model made against what actually happened, with a running hit rate.

Tech Stack

  • Python, Polars - Data pipeline
  • BeautifulSoup - Scraping
  • scikit-learn, XGBoost - Calibrated ensemble for matchup and method predictions
  • FastAPI - Serves rankings, predictions, detectors
  • D3.js - Charts and profiles
  • Fly.io - Hosting and cron job

Notes

  • Narratives are pushed a lot in MMA. Personality matters and how marketable a fighter is. The contrast in narratives v performance is the point.
  • Adding the performance layer was the call that made it feel like MMA since a grind-out decision and a 30-second head-kick KO shouldn’t move a rating the same way.
  • The predictor lands around 63% on held-out fights. That’s close to the honest ceiling for this sport because it’s impossible to consistently predict, and I’d rather it stay calibrated than overclaim. (Styles make fights)
  • Keeping predictions leakage-free was more annoying than expected. Every fight is scored on what was known before it happened, which is the only way a track record actually means anything.
  • It’s live now and updates on its own every week.

Check it out: P4P