UP - logo
E-viri
Recenzirano Odprti dostop
  • Primjena šume slučajnih sta...
    Jokić, Jovan; Martinčić-Ipšić, Sandra

    Zbornik Veleučilišta u Rijeci, 05/2019, Letnik: 7, Številka: 1
    Journal Article, Paper

    Cilj je ovog rada izgraditi model vrednovanja šahovskih pozicija koji se temelji na informacijama dobivenima iz mrežnih značajki pozicija šahovskih figura na ploči. Međusobni odnosi figura, kao i odnosi figura i polja koja zauzimaju, a koji opisuju određene taktičke i strateške elemente šahovske partije, mogu se modelirati kompleksnom mrežom. Ovim je radom pokazano kako upotrebom samo određenih mjera koje opisuju strukturu kompleksne mreže možemo naučiti klasifikator pozicija koji može predvidjeti krajnji ishod partije bolje od klasične Shannonove evaluacijske funkcije. Shannonova evaluacijska funkcija kvantificira materijalno stanje na ploči obiju strana u šahovskoj igri, mobilnost figura, sigurnost kralja te kvalitetu pješačke strukture. Računalni model koji klasificira na ulazu ima vektore značajki određene iz četiri vrste mreža (mreža podrške, mreža mobilnosti, pozicijska mreža, mreža praćenja) konstruiranih iz baze majstorskih partija, od kojih svaka modelira određeni aspekt šahovske igre. Vektor značajki sadrži značajke dobivene izračunom različitih mjera strukture mreže. Za određivanje značajki prema važnosti, kao i klasifikacijski postupak ishoda igre, upotrebljava se šuma slučajnih stabla. Nadalje, eksperimentalno se određuju osnovne evaluacije statičkih pozicija u šahovskim partijama pomoću Stockfish šahovskog programa. Nakon toga, značajke te pripadne evaluacijske ciljne klase (pobjeda bijelog, pobjeda crnog igrača ili remi) udružuju se u ulazne vektore za učenje modela klasifikacije pozicija, čiji se rezultati uspoređuju sa Shannonovom evaluacijskom funkcijom. Pokazano je kako predložena metoda vrednovanja temeljena na informacijama o strukturi mreže daje bolje rezultate (75 % točnosti) od klasične Shannonove evaluacijske funkcije (52 % točnosti) za testnu bazu partija. This work addresses the problem of constructing a static chess position evaluation model which utilizes only information extracted from complex networks’ features of positions of chess pieces on the board. The mutual relations of chess figures, the complex relations of figures and the positions on the chess board, as well as the information on which fields they are attacked, describing tactical and strategic elements of the chess game, all these are modeled by a complex network formalism. The goal of this work is to demonstrate that it is possible to train a classifier which would have better prediction results of the game outcome, utilizing only selected measurements of the complex network’s features rather than the corresponding Shannon’s evaluation function. Shannon’s evaluation function quantifies the material state of both players on the board, the mobility of the figures, king safety and pawn structure quality. The input to the classification model consists of feature vectors defined by four types of networks (support, mobility, position, tracking) constructed from static game positions. The game information is obtained from the available chess games database in a Portable Game Notation format. Features vector contains different complex network’s measures that quantify the structural properties of the network. The machine-learning algorithm of random forest is used for the training of the classification model and for selecting the most important features which have the highest impact on the prediction results. Experimentally, with the custom Python script and employing the chess engine Stockfish for analysis, a baseline fixed-depth evaluation of the static positions in chess games are extracted for determining the target classification classes – labels - win for white, win for black or draw. Next, the selected network measurements and the corresponding class labels form the input features vectors. The features vectors are used to train the Random Forest classifier: the results of the trained classification model (75% correctly predicted outcomes are compared to the baseline obtained by the standard Shannon’s evaluation function (52% correctly classified outcomes)). PGN database (Portable Game Notation) reading and parsing of games from the games database, the representation of static positions from the games, and the generation of networks/graphs are done with the suitable Python tools, namely the chess library chess-py and NetworkX Python module.