This repository contains tools and scripts to download, select, and process games from Lichess using Stockfish. We aim to analyze approximately 27,000 games based on different player ELO ratings and time controls.
- Chess Data Analysis with Stockfish
- Ubuntu (preferably the latest version)
- Python (Version 3.x)
- Stockfish Engine
- Julia and the
PyCallpackage - Internet connection for downloading games from Lichess
# Update and upgrade packages
sudo apt-get update
sudo apt-get upgrade
# Install necessary tools
sudo apt-get install python3 python3-pip- Clone the Stockfish Repository:
git clone https://github.com/official-stockfish/Stockfish.git- Navigate to the Stockfish Source Directory:
cd Stockfish/src- Compile Stockfish: For most modern CPUs on 64-bit systems:
make -j profile-build ARCH=x86-64-avx2If unsure about your architecture or the right target, refer to Stockfish's official documentation for guidance.
- Linux:
sudo apt-get update
wget https://julialang-s3.julialang.org/bin/linux/x64/1.9/julia-1.9.3-linux-x86_64.tar.gz
tar zxvf julia-1.9.3-linux-x86_64.tar.gz
export PATH="$PATH:/path/to/<Julia directory>/bin"Start Julia by typing julia in your terminal.
using Pkg
Pkg.add("PyCall")Set the PYTHON environment variable in Julia if needed:
ENV["PYTHON"] = "/path_to_desired_python"
using Pkg
Pkg.build("PyCall")Pkg.add("DataFrames")
Pkg.add("Plots")using PyCall
np = pyimport("numpy")Pkg.add("IJulia")# Clone the repository
git clone https://github.com/LZDXN/Chess-Research-2023-Fall.git
# Navigate to the repository
cd Chess-Research-2023-Fall/
# Install required Julia libraries
julia install.jl
# Install required Python libraries
pip3 install -r requirements.txt- Data Source:
- Download the data from Lichess September 2023 dataset.
- Data Collection:
- Focus on specific time controls and ELO ranges as detailed in the instructions.
- Data Processing:
- Use Stockfish to evaluate each position in the selected games.
- Retrieve evaluations for the move played in the game and the top 5 recommended moves by Stockfish.