Tool to ECO classify EPD positions?

Discussion of anything and everything relating to chess playing software and machines.

Moderators: hgm, Harvey Williamson, bob

Forum rules
This textbox is used to restore diagrams posted with the [d] tag before the upgrade.
Post Reply
Dann Corbit
Posts: 9515
Joined: Wed Mar 08, 2006 7:57 pm
Location: Redmond, WA USA
Contact:

Tool to ECO classify EPD positions?

Post by Dann Corbit » Fri Jul 28, 2017 1:44 am

Does such a tool exist?
I only know of tools for PGN.
And if you turn EPD positions into PGN, the tools all classify them incorrectly (at least those that I have tried).

IOW, for instance, all games come out A00 like this:

[Event "?"]
[Site "?"]
[Date "????.??.??"]
[Round "?"]
[White "?"]
[Black "?"]
[Result "*"]
[ECO "A00a"]
[Setup "1"]
[Fen "r1b1qrk1/ppp3bp/n2p1pp1/2P5/3pP1nB/2N2N2/PP2BPPP/R2Q1RK1 w - -"]

*

after you run them through the classifier.

Other classifiers simply do not find anything.

So, is there any reliable tool to classify a set of EPD positions?
Taking ideas is not a vice, it is a virtue. We have another word for this. It is called learning.
But sharing ideas is an even greater virtue. We have another word for this. It is called teaching.

Ferdy
Posts: 3817
Joined: Sun Aug 10, 2008 1:15 pm
Location: Philippines

Re: Tool to ECO classify EPD positions?

Post by Ferdy » Fri Jul 28, 2017 3:21 am

I have not known such tool.

I have done a python script in the past adding eco, opening name etc.

and tried it on Kai's opening test set.

http://talkchess.com/forum/viewtopic.ph ... 11&t=61858

What I did is something like the following.

given eco.pgn and epdList

Code: Select all

for epd in epdList:
    for game in eco.pgn:
        for move in game:
            gepd = getEpd()            
            if gepd == epd:
                save_eco_from_this_game()
                break
            makemove(move)
It is a very long process as it visits all positions in every game found in ref eco.pgn. It is also dependent on the quality of ref eco.pgn you use.

Here is one complication, it can happen that the epd can be found in some games in the eco.pgn, which would result to multi eco in one epd. To filter this out further one idea is to record the ply when epd was encountered then later only use the eco of the epd having the largest ply in eco.pgn.

I am not sure now what I did on filtering I need to see the code again.

If you are really interested I will try to dig it out somewhere in my backup disk.

tpoppins
Posts: 911
Joined: Tue Nov 24, 2015 8:11 pm
Location: upstate

Re: Tool to ECO classify EPD positions?

Post by tpoppins » Fri Jul 28, 2017 3:54 am

I'm afraid that this quest is based on a faulty premise - that ECO codes apply to positions. They don't. ECO codes are defined by sequences of moves, not by any of the positions that arise in the process.

For example, some IQP positions can be reached via certain lines of the Panov Caro-Kann, the QGA, the Semi-Tarrasch or the Nimzo-Indian. What ECO codes would be correct for those - B1x, Dxx or Exx? The obvious answer is none. The lines that lead to those positions can be assigned ECO codes, the positions themselves cannot.

Ferdy
Posts: 3817
Joined: Sun Aug 10, 2008 1:15 pm
Location: Philippines

Re: Tool to ECO classify EPD positions?

Post by Ferdy » Fri Jul 28, 2017 4:30 am

tpoppins wrote:I'm afraid that this quest is based on a faulty premise - that ECO codes apply to positions. They don't. ECO codes are defined by sequences of moves, not by any of the positions that arise in the process.

For example, some IQP positions can be reached via certain lines of the Panov Caro-Kann, the QGA, the Semi-Tarrasch or the Nimzo-Indian. What ECO codes would be correct for those - B1x, Dxx or Exx? The obvious answer is none. The lines that lead to those positions can be assigned ECO codes, the positions themselves cannot.
Perhaps if we are just interested on assinging ECO to position, we can just write all ECO that are applicable to epd, example.

Code: Select all

rnb1k2r/pppnqppp/4p3/3pP3/3P1P2/2N5/PPP3PP/R2QKBNR b KQkq - eco "axx bxx cxx dxx";


carldaman
Posts: 1630
Joined: Sat Jun 02, 2012 12:13 am

Re: Tool to ECO classify EPD positions?

Post by carldaman » Fri Jul 28, 2017 4:52 am

tpoppins wrote:I'm afraid that this quest is based on a faulty premise - that ECO codes apply to positions. They don't. ECO codes are defined by sequences of moves, not by any of the positions that arise in the process.

For example, some IQP positions can be reached via certain lines of the Panov Caro-Kann, the QGA, the Semi-Tarrasch or the Nimzo-Indian. What ECO codes would be correct for those - B1x, Dxx or Exx? The obvious answer is none. The lines that lead to those positions can be assigned ECO codes, the positions themselves cannot.
As far as I know, Chessbase assigns ECO based on the position reached, if that can be reached via a different and better-established move order, and not necessarily the actually played move order.

jdart
Posts: 3720
Joined: Fri Mar 10, 2006 4:23 am
Location: http://www.arasanchess.org

Re: Tool to ECO classify EPD positions?

Post by jdart » Fri Jul 28, 2017 9:09 am

I have a tool for PGN:

https://github.com/jdart1/arasan-chess/ ... ocoder.cpp

It doesn't currently handle the FEN tag but it would not be very hard to make it do that.

See also the ECO class in the src directory, which basically is a position/ECO mapper.

As for accuracy, the problem is that the ECO classification system is inherently ambiguous. There are many cases where you can classify an opening two or more ways, because of transpositions. The classic example is D42 (Semi-Tarrasch) vs B14 (Caro-Kann Botvinnik), some lines of which can also be classified B22 or one of the Nimzo-Indian defenses. Even ChessBase is not consistent in how they classify games.

--Jon

Norm Pollock
Posts: 1015
Joined: Thu Mar 09, 2006 3:15 pm
Location: Long Island, NY, USA
Contact:

Re: Tool to ECO classify EPD positions?

Post by Norm Pollock » Fri Jul 28, 2017 12:47 pm

Scid vs PC has a file called scid.eco. I am not sure if it comes with the installation or if you have to do a small execution to create it.

It contains 10,360 DISTINCT eco positions along with an extended (4 place) ECO value.

Here is an outline for a potential tool:

Put these 10,360 eco into a binary tree. Then search this tree with each of the epd positions that the user wants to classify. If there is a match, then keep going until the search is finished. At each step where there is a match, use the ECO value of the match as the potential "eco" opcode for the user epd. There may be more than one match. Use the last possible match. Default is A00a which is the start position and also the first position listed in "scid.eco".

The default value is A00a. So expect to see A00a for any position that has gone beyond the opening. For example (extreme case): if it is a "KPkp" position, there is no way to give an ECO value.

Here is a direct link to scid.eco that I will list for a short time:

http://www.mediafire.com/file/3i82z9d8qvzi818/scid.epd
It is not the strongest of the species that survive, nor the most intelligent, but the one most responsive to change. -- Charles Darwin

Vinvin
Posts: 4201
Joined: Thu Mar 09, 2006 8:40 am
Full name: Vincent Lejeune

Re: Tool to ECO classify EPD positions?

Post by Vinvin » Fri Jul 28, 2017 1:40 pm

For information, there are 4671 fen positions with English name and ECO code : https://gist.github.com/niklasf/e3d09e380410848964d0

Frank Quisinsky
Posts: 4844
Joined: Wed Nov 18, 2009 6:16 pm
Location: Trier, Germany
Contact:

Re: Tool to ECO classify EPD positions?

Post by Frank Quisinsky » Fri Jul 28, 2017 2:25 pm

Hi Jon,

that is indeed a problem!
Not only Chessbase have problems with many of the codes, other GUIs too. In my opinion best available material is:

Small Encyclopaedia of chess openings.

Note:
A much bigger problem as you wrote is the following situation:
ECO code formed (for an example after 6 moves). Three moves later the move transposition into an other code. Most of programs have now the biggest problem to jump in the right code.

So, not only the move transposition for the first moves of a game are really often difficult to understand, also the move transpositions many moves later, after the ECO code should be clear and formed is much more difficult to understand for chess software.

Best
Frank
I like computer chess!

Post Reply