Analysis of the factors that influence chess improvement by combining online behavior from Lichess, official over-the-board rating history from FIDE, and a small verified survey sample.
The project investigates two complementary questions:
- The dark side of online play: can highly repetitive fast-paced online play be associated with weaker long-term improvement in official FIDE rating?
- The virtuous side of online practice: which online behaviors are associated with stable improvement, better move quality, resilience, and deliberate practice?
The work was developed as a Business Intelligence and data analysis project for the 2024-25 academic year.
View the full project presentation (PDF)
Chess produces a rare mix of structured behavioral data and long-term skill measurements. Online platforms such as Lichess expose large-scale activity, game metadata, openings, clocks, engine evaluations, and puzzle activity. FIDE provides official over-the-board rating histories, which are a stronger proxy for classical chess improvement.
This project connects those two worlds:
- Extract active Lichess users from public PGN dumps.
- Filter users by account age and game activity.
- Integrate verified users from a Google Forms survey.
- Match Lichess users to FIDE identities using real names and FIDE public data.
- Scrape FIDE rating history for matched users.
- Download Lichess activity and analyzed games from 2023 onward.
- Build analytical datasets for compulsivity, rating growth, move quality, openings, time management, puzzle solving, and resilience.
- Visualize results through Power BI and Tableau dashboards.
- Lichess public game dumps: used to extract active usernames from recent PGN files.
- Lichess API: used to collect user profiles, rating histories, activity, and analyzed game details.
- FIDE XML player database: used for matching Lichess real names to FIDE IDs.
- FIDE profile pages: scraped to retrieve rating history and player metadata.
- Google Forms survey: used to add verified Lichess usernames and real-name information where available.
The first analysis studies whether a highly fast-paced online playing style correlates with FIDE rating change.
The project defines a Compulsivity Index (CI) between 0 and 1:
CI = 0.5 * frequency + 0.5 * fast_quality
Where:
frequencymeasures annual intensity of UltraBullet, Bullet, and Blitz games normalized against the sample maximum.fast_qualitymeasures the weighted share of faster time controls:
fast_quality = (1.00 * UltraBullet + 0.60 * Bullet + 0.30 * Blitz) / total_games
FIDE rating changes are computed monthly and annually. Missing months are filled with the last known rating and marked as inactive, so rating plateaus caused by inactivity can be separated from active periods with no rating gain.
The project also corrects the FIDE March 2024 rating reform for ratings below 2000. When needed, post-reform ratings are mapped back to the pre-reform scale:
elo_pre = (elo_post - 800) / 0.60
The second analysis focuses on online behaviors associated with stable improvement on Lichess.
Metrics include:
- Rating growth by game type and rating band.
- Puzzle volume.
- Average centipawn loss (ACPL).
- Accuracy.
- Inaccuracies, mistakes, and blunders.
- Opening variety through ECO codes.
- Deviation from theoretical opening lines.
- Average time spent in opening, middlegame, and endgame.
- Rating difference against opponents.
- Wins and draws from disadvantaged positions.
- Resign rate.
These features are aggregated globally and monthly, then compared across improvement quartiles.
config/
secrets/ Local secrets such as Lichess API tokens
data/
raw/ Original input files
interim/ Intermediate JSONL, GZ, ZIP, and AWS outputs
processed/ Final analysis tables and processed assets
dashboards/
source/ Power BI and Tableau source files
exports/ Dashboard images and PDF exports
extensions/ Dashboard extensions
docs/
presentation/ Project presentation
survey/ Survey text and related material
src/
data_collection/ Lichess and FIDE collection scripts
matching/ Lichess-FIDE matching scripts
analysis/ Compulsivity, virtuous-pattern, and Elo analyses
aws/ AWS Glue jobs and helper scripts
utilities/ Utility scripts for splitting, merging, and reading files
Create a virtual environment and install the local dependencies:
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txtFor AWS helper scripts, install the AWS-specific requirements:
pip install -r requirements-aws.txtAWS Glue jobs also require the awsglue Python modules provided by the AWS Glue runtime. They are not part of the standard local requirements.txt.
Lichess API tokens are expected in:
config/secrets/TOKEN.txt
Use one token per line. This file must not be committed to GitHub.
The main local pipeline is organized as follows:
-
src/data_collection/lichess/00_a_lichess_get_users.py
Extract unique usernames from Lichess PGN dumps. -
src/data_collection/lichess/00_b_lichess_get_users_filtered.py
Filter users by account age and rated game count. -
src/data_collection/lichess/00_c_lichess_survey_integration.py
Integrate additional users from the survey. -
src/data_collection/lichess/01_a_lichess_users.py
Collect Lichess profile data, rating histories, and performance data. -
src/matching/02_lichess_fide_match.py
Match Lichess users to FIDE records. -
src/data_collection/fide/03_fide_scraping_users.py
Scrape FIDE rating history for matched users. -
src/matching/04_lichess_get_matched.py
Create the final matched-user list for downstream Lichess game collection. -
src/data_collection/lichess/01_b_lichess_activity_jsonl.py
Collect activity data for matched users. -
src/data_collection/lichess/01_b_lichess_games_jsonl.py
Collect analyzed game details for matched users. -
src/analysis/compulsivity/andsrc/analysis/virtuous_patterns/
Build final analytical datasets.
The project includes Power BI and Tableau dashboards:
dashboards/source/powerbi/dashboards/source/tableau/
Exported dashboard views are available under:
dashboards/exports/
Some files in data/interim/ are large and are better handled with Git LFS, external storage, or regenerated from the pipeline rather than committed directly to GitHub.
The project also contains survey-derived and identity-matching data. Before publishing the repository, sensitive or personally identifiable information should be anonymized or excluded.
The analysis scripts that compute game-level statistics expect:
data/interim/lichess_games/lichess_games_matched.jsonl
The current repository snapshot contains:
data/interim/lichess_games/lichess_games_matched.zip
If the JSONL is not present, extract it from the ZIP or regenerate it with the game collection script before running those analyses.