This project is my first attempt at analyzing a real dataset and developing a prediction model for it -- specifically, a classification model -- using supervised learning techniques.
The goal was to develop a prediction model that was able to predict the outcome of any given chess match played on Lichess (a free, open-source online chess server), with a minimum precision of 80%.
Three classification algorithms were tested and compared, of which that with the best performance was chosen to build the final prediction model:
- Decision Tree;
- Multi-Class Logistic Regression;
- Random Forest.
The dataset used in this project can be found here, at Kaggle (an online data science community). It contains the data collected from just over 20,000 chess matches played on Lichess.
In the analysis.ipynb notebook file, you will find the whole process I went through:
- assessment of the dataset's integrity;
- data cleaning;
- exploratory analysis;
- choice of classification algorithm;
- model building and training;
- and model testing.
The analysis was performed in the Google Colab environment using Python as the programming language of choice, along with some of its well-known libraries: Matplotlib, NumPy, Pandas, Scikit-Learn and SciPy.
Keep in mind that this was a very extensive analysis, so it is a long read. If you are interested, grab a cup of coffee or tea of your choice and take it easy. ;)
The activity required us to analyze a dataset, seeking to solve a prediction problem -- both of our choice --, and to produce an A3-size poster about the process and our findings. This poster is what you will find in the poster_pt-br.pdf PDF file.
Of the three candidate algorithms, the Random Forest classifier achieved the best performance, with a precision of 80,7%.
The final prediction model achieved a precision of 80.1%, which is very close to the minimum precision expected for it.
| Real | Predicted | |||
|---|---|---|---|---|
black |
draw |
white |
Total | |
black |
1,308 | 0 | 314 | 1,622 |
draw |
66 | 16 | 72 | 154 |
white |
286 | 0 | 1,497 | 1,783 |
| Total | 1,660 | 16 | 1,883 | 3,559 |
Unfortunately, the model did not fare well predicting the outcome for matches that ended in a draw. Further analysis on the patterns that lead to a tied game are required.