All Projects → gjgd → should-i-play-f6

gjgd / should-i-play-f6

Licence: MIT license
Chess project to analyze the statistical effect of playing f3 (as white) or f6 (as black) on the outcome of the game.

Programming Languages

javascript
184084 projects - #8 most used programming language
python
139335 projects - #7 most used programming language
HTML
75241 projects
shell
77523 projects

Projects that are alternatives of or similar to should-i-play-f6

liground
A free, open-source and modern Chess Variant Analysis GUI for the 21st century
Stars: ✭ 41 (+173.33%)
Mutual labels:  chess, analysis, lichess
chessground
Chessground React Wrapper
Stars: ✭ 15 (+0%)
Mutual labels:  chess, lichess
bot-o-tron
Try out lichess' bot interface
Stars: ✭ 36 (+140%)
Mutual labels:  chess, lichess
liPGN
This program uses the lichess REST API to retrieve all the games of a user and transform them into a big PGN file that you can then import into your favourite game analysis tool (ie. scid)
Stars: ✭ 14 (-6.67%)
Mutual labels:  chess, lichess
stockfish.js
The strong open source chess engine Stockfish compiled to JavaScript and WebAssembly using Emscripten
Stars: ✭ 140 (+833.33%)
Mutual labels:  chess, lichess
pgn-tactics-generator
Generate chess puzzles / tactics from a pgn file
Stars: ✭ 83 (+453.33%)
Mutual labels:  chess, lichess
Lila
♞ lichess.org: the forever free, adless and open source chess server ♞
Stars: ✭ 10,315 (+68666.67%)
Mutual labels:  chess, lichess
chessops
Chess and chess variant rules and operations in TypeScript
Stars: ✭ 66 (+340%)
Mutual labels:  chess, lichess
chess-openings
An aggregated data set of chess opening names
Stars: ✭ 223 (+1386.67%)
Mutual labels:  chess, lichess
lila-openingexplorer
Opening explorer for lichess.org that can handle all the variants and billions of unique positions
Stars: ✭ 89 (+493.33%)
Mutual labels:  chess, lichess
lila-tablebase
Tablebase server
Stars: ✭ 51 (+240%)
Mutual labels:  chess, lichess
lila-gif
Webservice to render Gifs of chess positions and games, and stream them frame by frame
Stars: ✭ 63 (+320%)
Mutual labels:  chess, lichess
volkscv
A Python toolbox for computer vision research and project
Stars: ✭ 58 (+286.67%)
Mutual labels:  analysis
stockfish-chess-web-gui
Responsive chess web GUI to play against the Stockfish 10 chess engine. Multiple web GUI implementations have also been included.
Stars: ✭ 21 (+40%)
Mutual labels:  chess
hypothetical
Hypothesis and statistical testing in Python
Stars: ✭ 49 (+226.67%)
Mutual labels:  analysis
story-generator
Budget Visualization Tool to explore and analyse major fiscal indicators across various states in India
Stars: ✭ 17 (+13.33%)
Mutual labels:  analysis
SqlServer.Rules
SQL Server static code analysis rules for SSDT database projects
Stars: ✭ 20 (+33.33%)
Mutual labels:  analysis
Minic
A simple chess engine to learn and play with
Stars: ✭ 65 (+333.33%)
Mutual labels:  chess
covid19analysis
COVID-10 Analysis
Stars: ✭ 16 (+6.67%)
Mutual labels:  analysis
pathpy
pathpy is an OpenSource python package for the modeling and analysis of pathways and temporal networks using higher-order and multi-order graphical models
Stars: ✭ 124 (+726.67%)
Mutual labels:  analysis

Should I play f6 ?

GM Ben Finegold notoriously says "Never play f6 [as black, or f3 as white]"

Is this good advice from a statistical perspective? In this project, we analyze 70.315.588 games from the Lichess online database in order to find out:

https://should-i-play-f6.gjgd.xyz/

This website allows you to:

  • Pick any move played by white or black, and compare the average score of the games where this move was played against a baseline of the average score for all games.
  • Calculate a plot of the average score of your move as a function of the elo range, to see how successfully the move was played by players of various elo
  • Filter games and keep only the games where the move was played in the opening, the middle game or the endgame.

Results

Check out this reddit post for a discussion about the results: https://www.reddit.com/r/chess/comments/iv8qxf/update_should_i_play_f6_some_extra_analysis/

Technical details

Definitions

The average score S of a move X is: S = (1 * wins + 0.5 * draws + 0 * losses) / (wins + draws + losses)

where:

  • wins is the number of games won when playing the move X
  • draws is the number of games drawn when playing the move X
  • losses is the number of games lost when playing the move X

The part of the game that happens before move 10 is the opening

The part of the game that happens between move 10 and move 40 is the middle game

The part of the game that happens after move 40 is the endgame

⚠️ Note that these three definitions are subjective and highly debatable, for example an engame would be more accurately defined by the point in the game where the queens are traded off, however for the purpose of this project it was simpler to just consider the number of move in order to filter out openings and engames.

Sanitizing moves

Some moves in the Lichess database came with

  • Annotations: for example b4! or Kf1??
  • Comments: for example e4 [The king pawn opening]
  • Computer analysis: for example e4 [+0.23]

All of these were removed to only keep the arithmetic notation.

Additionnally I also chose to deduplicate positional notation (Rfd1 -> Rd1) and captures (Bxf7 -> Bf7 or exd5 -> ed5)

Using the project

Python script

To analyze the first 10.000 games of a PGN stored locally, run:

python main.py lichess_db_standard_rated_2020-07.pgn 10000

To analyze the first 70.000.000 games from a PGN stored in S3, run:

python main.py s3://gjgd-chess/lichess_db_standard_rated_2020-07.pgn 70000000

The web app

cd app/
npm install
npm run start

Tech stack

  • The script to build the database can be run using Python3
  • The webapp was written in React JS and uses the CRA tools
  • The deployment to AWS CloudFront is done with the Serverless framework
  • The CI/CD is ran using Github Actions.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].