Traditional definition John Watson by CrIBc0s

VIEWS: 4 PAGES: 23

									                  CG 2008

Learning Positional Features for
   Annotating Chess Games:

             A Case Study

   Matej Guid, Martin Mozina, Jana Krivec,
    Aleksander Sadikov and Ivan Bratko


 Faculty of Computer and Information Science
        University of Ljubljana, Slovenia
       Enhanced Knowledge in Chess Programs


 The improvements of Rybka 3 in evaluation function for chess middlegames:
  understanding good and bad bishops,
  much more advanced understanding of kings attacks,
  importance of defending king by pieces,
  “space” (previously addresed only indirectly)

 (Larry Kaufmann, designer of Rybka’s evaluation function, RybkaForum.net)


 Knowledge is particularly important when annotating chess games…


How to “teach” a program to recognise chess concepts?
           The Concept of the Bad Bishop
 Chess experts in general understand the concept of bad bishop.
 Precise formalisation of this concept is difficult.




Traditional definition (John Watson, Secrets of Modern Chess Strategy, 1999)
 A bishop that is on the same colour of squares as its own pawns is bad:
  its mobility is restricted by its own pawns,
  it does not defend the squares in front of these pawns.

 Moreover, centralisation of these pawns is the main factor in deciding
  whether the bishop is bad or not.
 CRAFTY's Features for Describing Bishops
     Feature                Description                 Defficiency for annotating
                    number of own pawns that        all such pawns count the same,
BLACK_BISHOP_PLUS
                    are on same colour of square    regardless of their position and
_PAWNS_ON_COLOR
                    as bishop                       how badly they restrict the bishop
                    evaluation of bishop's posi-    such predefined value is not the
BLACK_BISHOPS
                    tion based on predefined        actual value of bishop's placement
_POSITION
                    values for particular squares   in a particular position
                                                    number of attacked squares
BLACK_BISHOPS       number of squares that
                                                    and actual bishop's mobility
_MOBILITY           bishop attacks
                                                    are not necessarily the same thing
 CRAFTY's Features for Describing Bishops
     Feature                Description                 Defficiency for annotating
                    number of own pawns that        all such pawns count the same,
BLACK_BISHOP_PLUS
                    are on same colour of           regardless of their position and
_PAWNS_ON_COLOR
                    square as bishop                how badly they restrict the bishop
                    evaluation of bishop's posi-    such predefined value is not the
BLACK_BISHOPS
                    tion based on predefined        actual value of bishop's placement
_POSITION
                    values for particular squares   in a particular position
                                                    number of attacked squares
BLACK_BISHOPS       number of squares that
                                                    and actual bishop's mobility
_MOBILITY           bishop attacks
                                                    are not necessarily the same thing
 CRAFTY's Features for Describing Bishops
     Feature                Description                 Defficiency for annotating
                    number of own pawns that        all such pawns count the same,
BLACK_BISHOP_PLUS
                    are on same colour of square    regardless of their position and
_PAWNS_ON_COLOR
                    as bishop                       how badly they restrict the bishop
                    evaluation of bishop's posi-    such predefined value is not the
BLACK_BISHOPS
                    tion based on predefined        actual value of bishop's placement
_POSITION
                    values for particular squares   in a particular position
                                                    number of attacked squares
BLACK_BISHOPS       number of squares that
                                                    and actual bishop's mobility
_MOBILITY           bishop attacks
                                                    are not necessarily the same thing
            Static Nature of Positional Features

 Positional features in evaluation functions are static in their nature
 Heuristic search enables to fulfil their purpose – contributing to the program
  finding best moves
            Static Nature of Positional Features

 Positional features in evaluation functions are static in their nature
 Heuristic search enables to fulfil their purpose – contributing to the program
  finding best moves




                                                         Is freeing move e6-e5
                                                         possible or not?




 It is also desirable for positional features for annotating chess games
  to be of static nature! Heuristic search is important for instructive annotations.
 see the paper Automated chess tutor. CG 2006, Turin, Italy, May 29-31, 2006.
  Expert-Crafted Rules & Introducing Learning

 It is extremely difficult for chess experts to define
   appropriate rules for determining bad bishops
-> knowledge acquisition bottleneck

 various expert-crafted rules performed rather poorly
   (only 59% of examples were correctly classified)
-> motivation for introducing machine learning
                                                                   Chess experts:
Data Set for Machine Learning                                      wGM Jana Krivec
                                                                   FM Matej Guid

 Data set: 200 middlegame positions from real chess games:
  bad: 78 bishops
  not bad: 122 bishops

 We randomly selected 100 positions for learning and 100 positions for testing.
 CRAFTY’s positional feature values served as attribute values for learning.
           Bad Bishops from Static Point of View

 Our goal: construct a static positional feature BAD_BISHOP
 Assessing bishops “statically” is counter-intuitive from chess point of view
 Special guidelines were chosen for determining “statically” bad bishops…


Guidelines for Determining Bad Bishops from Static Point of View

The bishop is bad from the static point of view in some position, if
1.
     its improvement or exchange is desirable
2.
     the pawn structure limits the bishop’s chances for taking an active part in the
     game,
3.
     its mobility in this position is limited or not important for the evaluation.
       Standard Machine Learning Methods'
     Performance with CRAFTY's features only
 Machine learning methods’ performance on initial dataset

                          Method            Classification accuracy
                    Decision trees (C4.5)            73%
                    Logistic regression              70%
                    Rule learning (CN2)              72%


 The results were obtained on test data set.
 The results obtained with CRAFTY’s positional features only are too inaccurate
   for commenting purposes…
   additional information for describing bad bishops is necessary.

Improved Method
 see the paper Fighting Knowledge Acquisition Bottleneck with Argument Based
  Machine Learning. European Conference on Artificial Intelligence, Patras,
  Greece, July 21-25, 2008. Available at: www.ailab.si/matej
                     First Critical Example
 Rules obtained by ABML method ABCN2 failed to classify this example as
  "not bad“.




 The following question was given to the experts:
   “Why is the black bishop not bad?“
 The experts used their domain knowledge:
   “The black bishop is not bad, since its mobility is not seriously restricted
   by the pawns of both players.”
   Introducing new attribute into the domain
      and adding argument to an example
 Experts’ explanation could not be described with current domain attributes.

                                 A new attribute, IMPROVED_BISHOP_MOBILITY,
                                  was included into the domain:
                                   number of squares accessible to the
                                    bishop, taking into account only own
                                    and opponent’s pawn structure




 The argument
   “BISHOP=“not bad” because IMPROVED_BISHOP_MOBILITY is high“
   was added to the example.
                  Another Critical Example
 The ABML-based knowledge elicitation process can be used to induce rules to
  determine both good (i.e., not bad) and bad bishops.




 Now the following question was given to the experts:
   “Why is the black bishop bad?“
 The experts used their domain knowledge:
   “The black bishop is bad, since black pawns block its diagonals.”
   Introducing new attribute into the domain
      and adding argument to an example
 Experts’ explanation could not be described with current domain attributes.

                                 A new attribute,
                                  BLACK_PAWN_BLOCKS_BISHOP_DIAGONAL,
                                  was included into the domain:
                                   pawns on the color of the square of the
                                   bishop that block the bishop's (front)
                                   diagonals
                                   weights of such pawns were taken into
                                    account (see the “Look-up table” that follows)



 The argument
   “BISHOP=“bad” because BLACK_PAWN_BLOCKS_BISHOP_DIAGONAL is high“
   was added to the example.
                          Counter example

  Method failed to “not bad”,          Counter example: “bad”,
 Critical example:explain critical example with given argument. although
  BLACK_PAWN_BLOCKS_BISHOP             BLACK_PAWN_BLOCKS_BISHOP
 Counter example was presented to experts:
  _DIAGONAL is high.                   _DIAGONAL is high.




 "Why is the “green” bishop not bad, compared to the “red” one?"

 Experts’ explanation: “The black bishop is not bad, since its mobility is not
  seriously restricted, taking the pawn structure into account.”
Improving Arguments with Counter Examples

 The argument given to the critical example was extended to
  “BISHOP=“bad” because BLACK_PAWN_BLOCKS_BISHOP_DIAGONAL is high
  and IMPROVED_BISHOP_MOBILITY is low.”
 With this argument the method could not find any counter examples anymore.

 The new rule covering the critical example became:
        if   BAD_PAWNS_BLOCK_BISHOP_DIAGONAL > 16
        and IMPROVED BISHOP MOBILITY < 4
        then BAD_BISHOP= “bad”           class distribution [42,0]
                Assesing “Bad” Pawns

 Experts designed a look-up table (left) with predefined values for
  pawns that are on color of square of the bishop in order to assign
  weights to such pawns.




            BAD_PAWNS_AHEAD = 16 + 24 + 2 = 42
                After the Final Iteration...
 The whole process consisted of 8 iterations.
     7 arguments were attached to automatically selected critical examples
     5 new attributes were included into the domain



          Attribute                               Description
                               pawns on the color of the square of the bishop -
BAD_PAWNS
                               weighted according to their squares (bad pawns)
BAD_PAWNS_AHEAD                bad pawns ahead of the bishop
BAD_PAWNS
_BLOCK_BISHOP_DIAGONAL
                               bad pawns that block the bishop's (front) diagonals

BLOCKED_BAD_PAWNS              bad pawns blocked by opponent's pawns or pieces
                               number of squares accessible to the bishop taking
IMPROVED_BISHOP_MOBILITY
                               into account only pawns of both opponents
   Classification Accuracy Through Iterations




 The accuracies of all methods improved by adding new attributes.
 ABCN2 (which also used the arguments) outperformed all others.




Arguments suggested useful attributes AND lead to more accurate models.
                       The Final Model




 Rule #2:
      if   BAD_PAWNS_AHEAD > 18
      and IMPROVED_BISHOP_MOBILITY < 3
      then BISHOP= “bad”          class distribution [46,0]
                       The Final Model




 Possible comment:
  “Black bishop is bad,
       since black pawns on the same colour of squares ahead of it,
       and pawns of both opponents restrict its mobility.”
                            Conclusions
 In this case study, Argument Based Machine Learning was shown to be
  a powerful knowledge-elicitation method for defining deep positional
  patterns.

 ABML offers the following advantages for knowledge elicitation:


explain single example                easier for experts to articulate knowledge




critical examples                     expert provides only relevant knowledge




arguments constrain                   hypotheses are consistent with expert
learning                              knowledge

								
To top