fsmosca / chess-artist

A python script that can annotate chess games in pgn file with static evaluation or search score of an engine, can annotate an epd file with acd, acs, bm, and ce opcodes, can test engine with epd test suite and can generate chess puzzles.
GNU General Public License v3.0
69 stars 18 forks source link

Calculate average move error of the players. #23

Closed fsmosca closed 7 years ago

fsmosca commented 7 years ago

When the engine preferred move is different from the move of the player in the game, calculate the score difference in pawn units between these moves. After the game get the average move error.

Example: 1. e4 e5 2. Nf3 a6 ? {+0.80} (2...Nc6 {+0.05 - Stockfish}) 3. Nxe5 Ba3 ? {+3.5} (3... Qe7 {+0.50 - Stockfish})

  1. Black move error at move 2... player_move_error = +0.05 - (+0.80) = -0.75 since this is black to move we reverse the sign. player_move_error = -1 * -0.75 = 0.75
  2. Black move error at move 3... player_move_error = +0.50 - (+3.5) = -3.0 player_move_error = +3.0

Total black move error in 2 moves = 0.75 + 3.0 = 3.75 average = 3.75/2 = 1.875

Don't calculate move errors when the score of the player's move is already winning or losing (+4.0 pawns or more). Calculation of move errors starts at move 12.

The average move error will be appended at the end of the movetext in the notation. 4. bxa3 {WhiteAveError=+0.0, BlackAveError=+1.875} 1-0