-
Data:
- games.csv: ~20,000 Lichess games
- games2.csv: ~20,000 Grandmaster games
- games3.csv AI-Generated Games via stockfish
-
main.ipynb: main data analysis project conducted. Polished & in-depth
-
ai_games.ipynb: processed of generating games (optimized for Mac M3, parallelized, very heavy)
-
experimental: experimental, advanced, but unpolished drafts of future work (training GPT chessbot, in-depth analysis of selected chess openings, analysis of chess moves in latent space)
This analysis examines three distinct chess datasets to understand how factors like player ratings influence game outcomes, length, and strategies. The project compares:
- Modern online games from Lichess.org
- Historical grandmaster games
- AI games generated by Stockfish
-
Player skill level strongly correlates with:
- Game length (higher-rated games tend to be longer)
- Victory conditions (higher-rated players resign more often vs. getting checkmated)
- Draw frequency (increases with player rating)
- Opening move selection (d4 and Nf3 become more common at higher ratings)
-
White maintains advantage across skill levels:
- 49.86% win rate for white
- 45.40% win rate for black
- 4.74% draw rate
-
Opening preferences:
- e4: 62.81% of games
- d4: 22.54%
- Nf3: 3.61%
- c4: 3.57%
- Lichess games dataset: Kaggle - Chess Dataset
- Grandmaster games: Kaggle - Top Players Chess Games
- AI games: Generated using Stockfish Python API
Implemented a K-Nearest Neighbors model to predict player ratings based on:
- Opening moves
- Game outcomes
- Opponent ratings
- Victory conditions
Model Performance:
- 69.9% accuracy within 100 rating points
- 85.2% accuracy within 200 rating points
- 92.7% accuracy within 300 rating points
- Median absolute error: 8.2 rating points
- Python
- Libraries: pandas, plotly, numpy, scipy.stats
- Stockfish Chess Engine API