# About Data
## Chess Data
We use **.pgn** file as the source of the tarining data. A single pgn file can contain as many chess games as you want. By processing **.pgn** file, we can fetch out thousands of player's movement which can be used to train the model.
Here is our data source : [pgn source](http://www.pgnmentor.com/files.html#players)
Each pgn file record the games played by specific player.
### What a pgn file looks like
```
[Event "Lloyds Bank op"]
[Site "London"]
[Date "1984.??.??"]
[Round "1"]
[White "Adams, Michael"]
[Black "Sedgwick, David"]
[Result "1-0"]
[WhiteElo ""]
[BlackElo ""]
[ECO "C05"]
1.e4 e6 2.d4 d5 3.Nd2 Nf6 4.e5 Nfd7 5.f4 c5 6.c3 Nc6 7.Ndf3 cxd4 8.cxd4 f6
9.Bd3 Bb4+ 10.Bd2 Qb6 11.Ne2 fxe5 12.fxe5 O-O 13.a3 Be7 14.Qc2 Rxf3 15.gxf3 Nxd4
16.Nxd4 Qxd4 17.O-O-O Nxe5 18.Bxh7+ Kh8 19.Kb1 Qh4 20.Bc3 Bf6 21.f4 Nc4 22.Bxf6 Qxf6
23.Bd3 b5 24.Qe2 Bd7 25.Rhg1 Be8 26.Rde1 Bf7 27.Rg3 Rc8 28.Reg1 Nd6 29.Rxg7 Nf5
30.R7g5 Rc7 31.Bxf5 exf5 32.Rh5+ 1-0
```
## Training Data
Since we want to train a model to pick and move, the board configue at each turn is a necessary information. The data includes a sequence of board configue, a picked chess and a player movement.
We composed these information and stored as a single file which is more easy to manage. Pre-processing also reduced the memory cost when we train a model.
Example Training Data
```
1
w
1 2 2 2
2 3 4 5 6 4 3 2
1 1 1 1 1 1 1 1
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 -1 0 0 0
0 0 0 0 0 0 0 0
-1 -1 -1 -1 0 -1 -1 -1
-2 -3 -4 -5 -6 -4 -3 -2
2 3 4 5 6 4 3 2
1 1 1 1 1 1 1 1
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
-1 -1 -1 -1 -1 -1 -1 -1
-2 -3 -4 -5 -6 -4 -3 -2
```
The fisrt line record the checkmate situaion and second record the color player is playing. The third line record the picked position and moveed position. After that recorded the current board configue and each number reprensent a kind of pieces. The rest record the previous board configue in sequence.