Skip to content

About

Collection of up-to-date UFC datasets of fighters/fights scraped from the web, with ML pipelines for predicting fight outcomes.

Resources

Stars

5 stars

Watchers

1 watching

Forks

Repository files navigation

UFC-Almanac

UFC Almanac

A collection of datasets of UFC fight results, fight stats (both updated weekly) and fighter data (updated monthly), containing the data for all UFC fights since 2010. Also contains pipelines for transforming the data into formats for training machine learning models, and training scripts for a variety of deep learning models.

Next UFC Event Predictions

Event date: October 3, 2026

Fight Win Loss Draw
OverallKOSubDec OverallKOSubDec
Natalia Silva vs Wang Cong58.8%9.8%6.1%42.9%40.7%7.7%3.1%29.9%0.3%
Deiveson Figueiredo vs Payton Talbott33.4%6.4%7.4%19.6%66.1%27.5%7.0%31.6%0.6%
King Green vs Esteban Ribovics39.6%7.8%5.6%26.2%59.9%25.7%3.7%30.5%0.6%
Ateba Gautier vs Roman Kopylov67.4%31.2%7.4%28.8%32.2%15.0%4.0%13.2%0.6%
Imanol Rodriguez vs Alden Coria47.9%7.4%5.8%34.7%51.8%7.5%6.0%38.3%0.4%
Damian Pinas vs Andrey Pulyaev49.9%23.1%11.1%15.7%49.6%21.9%8.7%19.0%0.6%
Marcus McGhee vs Benardo Sopaj37.8%10.6%4.0%23.2%61.8%12.2%10.1%39.5%0.4%
Johnny Walker vs Mick Parkin30.8%16.0%4.3%10.5%68.7%38.3%8.1%22.3%0.5%
Rafael Dos Anjos vs Alexander Hernandez44.9%4.9%7.5%32.5%54.7%11.9%3.1%39.7%0.4%
Marvin Vettori vs Ismail Naurdiev38.2%4.7%5.0%28.5%61.2%4.8%4.3%52.1%0.5%
Court McGee vs Eric Nolan51.8%3.1%28.0%20.7%47.5%19.0%1.7%26.8%0.6%

The model used for these predictions is a models/transformer_model.py trained using the following command:

ufc-train --model transformer --path artifacts/core/transformer_model.pt --epochs 75 --dropout 0.5 --num-layers 2 --restarts 10 --d-model 32 --learning-rate 1e-4 --weight-decay 1e-4

Disclaimer: These predictions are generated by a machine learning model and reflect estimated probabilities, not certainties. They are provided for informational and entertainment purposes only and should not be used as betting or financial advice.

Setup

pip install -e ".[all]"

To scrape data, install the Playwright browser:

playwright install chromium

Usage

After installing the project, you can run commands either via the console scripts or the scripts/ entrypoints.

Scrape data (into data/*.csv files)

# Scrape fight results and stats
ufc-scrape-fights
# or
python scripts/scrape_fights.py

# Scrape fighter profiles
ufc-scrape-fighters
# or
python scripts/scrape_fighters.py

Training

ufc-train --model transformer --rebuild-data
# or
python scripts/train.py --model transformer

Parameters

Flag Description Default
--model Model architecture (linear, mlp, or transformer) linear
--epochs Number of training epochs 40
--batch-size Training batch size 256
--learning-rate Adam learning rate 3e-5
--val-fraction Fraction of the most recent samples held out for validation 0.1
--weight-decay L2 regularization strength for Adam 3e-5
--dropout Dropout probability 0.5
--d-model Transformer hidden dimension (transformer only) 128
--num-layers Number of transformer encoder layers (transformer only) 4
--max-fights Past fights per fighter / sequence length (transformer only) 8
--path Path to save trained model weights <ModelName>.pt
--rebuild-data Regenerate training data from CSV files off
--optimize-temp Optimize temp scaling on the val set off
--restarts Number of independent training runs 1
--brier-weighting Weight on val Brier vs loss when selecting checkpoints 2

Use --rebuild-data when the underlying CSV data has been updated. Changing --max-fights also regenerates transformer training data when it does not match the saved tensors.

Inference (predict fight outcomes)

Interactive CLI:

ufc-predict --model linear
# or
python scripts/predict.py --model mlp

Enter two fighter names when prompted. Type exit, quit, or q to stop.

Parameters

Flag Description Default
--model Model architecture to load: linear, mlp, or transformer linear
--path Path to trained model weights <ModelName>.pt

The predictor loads trained weights and normalization stats from artifacts/checkpoints/ for the selected model by default. Train a model first with ufc-train, or pass --path to load a custom checkpoint.

Automated data updates

GitHub Actions workflows scrape new fight data weekly and fighter data monthly, adding new data to the csv files in the data/ directory.

About

Collection of up-to-date UFC datasets of fighters/fights scraped from the web, with ML pipelines for predicting fight outcomes.

Resources

Stars

5 stars

Watchers

1 watching

Forks

Contributors

Languages