Skip to content

Repository files navigation

Predicting Chess Puzzle Difficulty

A machine learning project to predict the difficulty/ranking of chess puzzles using various chess position features and puzzle characteristics.

🎯 Project Overview

This project aims to predict chess puzzle difficulty ratings based on puzzle characteristics and chess position analysis. The project uses machine learning techniques, specifically XGBoost regression, to model puzzle difficulty from features extracted from chess positions and puzzle metadata.

Competition: KnowledgePit - Predicting Chess Puzzle Difficulty

For detailed methodology, analysis, and results, refer to report.pdf included in the repository.

🚀 Getting Started

Prerequisites

  • Python 3.7+
  • Jupyter Notebook or JupyterLab

Installation

  1. Clone the repository:
git clone https://github.com/adambiel22/predicting-chess-puzzle-difficulty.git
cd predicting-chess-puzzle-difficulty
  1. Install the required packages:
pip install -r requirements.txt

📊 Workflow

1. Feature Creation (create_features.ipynb)

This notebook handles feature engineering from raw chess puzzle data:

  • Chess Position Analysis: Extracts features from FEN (Forsyth-Edwards Notation) positions
  • Material Evaluation: Calculates material balance and piece values
  • Move Analysis: Analyzes puzzle moves and piece interactions
  • Strategic Features: Identifies checks, captures, and tactical patterns

2. Model Training (train_and_evaluate.ipynb)

This notebook focuses on model development and evaluation:

  • Data Preprocessing: Handles categorical variables and data splitting
  • Model Training: Uses XGBoost regression to predict puzzle rankings
  • Evaluation: Assesses model performance using metrics like MSE and R²
  • Visualization: Creates plots for data distribution and model performance analysis
  • Feature Importance: Analyzes which features contribute most to predictions

3. Prediction Generation (predict.ipynb)

This notebook generates final predictions:

  • Model Loading: Loads the trained XGBoost model
  • Batch Prediction: Applies the model to test datasets
  • Output Generation: Creates submission-ready prediction files

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages