← Back to portfolio

Final-year project · Web development, data & machine learning

Pitch Rivals

A multiplayer football game inspired by Fantasy leagues where you select cards of players using performance predictions and compete on the results of real matches.

Period
Jan–Jul 2026
Team
Individual project
Context
Bachelor’s thesis at the University of Seville · Grade: 9.4/10.
My role
Requirements engineering, design and full development of the application

My contribution

I built the complete project: data processing, predictive models, game rules, API, web interface, automated opponent and deployment.

  • React
  • TypeScript
  • Python
  • FastAPI
  • PostgreSQL
  • XGBoost
  • Pandas
  • Optuna
  • SQLAlchemy
  • Docker
Sign-in screen for Pitch Rivals
Sign-in screen for Pitch Rivals.
  • Final-year project · 9.4/10
  • 18 accepted predictive targets
  • 75 backend tests

How a matchweek works

Create a league or join with a code. Each matchweek you compete with other participants and the Scavenger, an automated opponent that uses your discarded cards. Everything uses Scouting Points (SP), a virtual currency with no real money involved.

  1. Pick 3 of 5 cards

    Each card pairs a footballer with a target, such as scoring a goal. Compare probability and reward, optionally spend SP to reroll the market, then lock three cards. The other two enter the league’s discard pool.

  2. Face the Scavenger

    When the draft closes, the automated opponent selects discarded cards by expected value. You can spend SP to take a virtual position against one of its predictions coming true: a short.

  3. Real matches take place

    Decisions lock when the matchweek goes live. Outcomes depend on the footballers’ actual performance, not a match simulation.

  4. Review results and standings

    Real match statistics are then imported, targets and shorts are settled, and balances and the league leaderboard are updated.

Face-Off showing the Scavenger’s cards and options to open short positions
Face-Off: the Scavenger’s targets, short costs and potential returns before the matches start.

Evaluating models without future information

I built an ETL pipeline using LaLiga data from the 2020/21 to 2024/25 seasons and created historical and recent-form features. Statistics are shifted over time so each prediction only uses information available before the match.

I trained XGBoost models and tuned their parameters with Optuna. Evaluation used a temporal holdout of 1,431 records, separate from training. Eighteen of the nineteen binary targets exceeded the 0.65 AUC threshold; the yellow-card target was rejected.

I also compared isotonic and sigmoid calibration. Since they did not improve results overall, I retained the models’ original probabilities.

Reliability diagrams for taking at least one shot: original probabilities, isotonic and sigmoid calibration
Reliability diagram for taking at least one shot: original probabilities versus isotonic and sigmoid calibration. Closer to the diagonal means better agreement between predicted probability and observed frequency. For this target, the original model achieves lower Brier and Log Loss scores than both alternatives.

Rules, interfaces and consistent results

  • FastAPI backend and PostgreSQL storage with data models and database migrations.
  • React and TypeScript interfaces for leagues, drafting, matchups, results and the leaderboard.
  • 'The Scavenger' automated opponent, selection changes and risk-based mechanics using virtual economy.
  • Settlement from actual match statistics and 75 backend tests documented in the thesis.
League standings showing human participants and the Scavenger
The league leaderboard: human participants and the Scavenger compete using the same virtual economy.

What this project demonstrates

This is my most comprehensive individual project: preparing data, evaluating models, deciding how to explain them on screen and turning them into game rules. The thesis received a grade of 9.4/10.

The January–July period includes research, development, the written thesis and its defence. The repository history mainly covers implementation.

See the project in action

3:03
Full final-year project demo. Virtual currency only; no real-money betting.
What the video shows

The recording covers leagues, player and target selection, matchups, results and the leaderboard. Predicted probabilities inform risk and Scouting Points (virtual currency) rewards; actual match statistics settle the targets.

Source code and documentation available.