Game moves statistics, any program for that ?

For discussing go computing, software announcements, etc.
User avatar
oca
Lives in gote
Posts: 699
Joined: Wed Feb 19, 2014 2:53 am
Rank: DDK
GD Posts: 0
KGS: aco
IGS: oca
OGS: oca
Location: Switzerland
Has thanked: 485 times
Been thanked: 166 times

Game moves statistics, any program for that ?

Post by oca »

Hi, maybe it's a weird question but, did anyone know if it exists a programm that will be able to produce some kind of statistics on a given sgf file ?

for instance, I would give it "the_game_i_did_last_night_that_was_so_funny_even_if_i_loose.sgf" and it will tell me something like that :

black :
- nobi : 20 (xx % of the moves)
- kosumi : 40 (xx % of the moves)
- tobi : 30 (xx % of the moves)
- Niken-tobi : 5 (xx % of the moves)
- keima : 50 (xx % of the moves)
- Ogeima : ...
...

white:
- nobi : 37 (xx % of the moves)
- tobi : 12 (xx % of the moves)
- Niken-tobi :
- keima : 64 (xx % of the moves)
...

or even better with analysis of "things" like : tenuki, tsuke, peep, osae( maybe a bit difficult with one as I understand it more like beeing an intent not a move... or is it a move :scratch:)


I know that only statistics (or statistics only) isn't enougth to judge a game, but I will still like that kind of tools.

[edit]
Finally I did try to write one... first try here : viewtopic.php?p=165330#p165330
[/edit]
Last edited by oca on Wed May 21, 2014 4:02 am, edited 2 times in total.
Converting the book Shape UP! by Charles Matthews/Seong-June Kim
to the gobook format. last updated april 2015 - Index of shapes, p.211 / 216
User avatar
EdLee
Honinbo
Posts: 8859
Joined: Sat Apr 24, 2010 6:49 pm
GD Posts: 312
Location: Santa Barbara, CA
Has thanked: 349 times
Been thanked: 2070 times

Post by EdLee »

Hi oca, not that I know of, but maybe it's an interesting idea to show broken shapes or other bad shapes.
(Of course, we sill need further analysis to determine if the shape is actually good or bad, locally and globally.)

For example, each of (a) and (b) below shows a local broken shape for W.
(a): Locally, pro consensus is the result is even. Needs global context.
(b): Locally, bad for W. Still needs global context.
Click Here To Show Diagram Code
[go]$$
$$ | . . . . . . . . . ? . . . . . . . . . |
$$ | . . . . a . . . . ? . . . . b . . . . |
$$ | . . . . . . . . . ? . . . . . . . . . |
$$ | . . O . . . . . . ? . . . . . . . . . |
$$ | . . . X . . . . . ? . . X X X X X . . |
$$ | . . O X . . . . . ? . . . O X O . . . |
$$ | . . O # # W . X . ? . . . O X O . . . |
$$ | . . O W # . . . . ? . . . . X . . . . |
$$ | . . . . . . . . . ? . . . . . . . . . |
$$ -----------------------------------------[/go]
User avatar
RBerenguel
Gosei
Posts: 1585
Joined: Fri Nov 18, 2011 11:44 am
Rank: KGS 5k
GD Posts: 0
KGS: RBerenguel
Tygem: rberenguel
Wbaduk: JohnKeats
Kaya handle: RBerenguel
Online playing schedule: KGS on Saturday I use to be online, but I can be if needed from 20-23 GMT+1
Location: Barcelona, Spain (GMT+1)
Has thanked: 576 times
Been thanked: 298 times
Contact:

Re: Game moves statistics, any program for that ?

Post by RBerenguel »

Pachi kind of, can. But hard to "convince it" to do it
Geek of all trades, master of none: the motto for my blog mostlymaths.net
User avatar
EdLee
Honinbo
Posts: 8859
Joined: Sat Apr 24, 2010 6:49 pm
GD Posts: 312
Location: Santa Barbara, CA
Has thanked: 349 times
Been thanked: 2070 times

Post by EdLee »

Hi oca, on a related note, your original idea of the stats of various shapes in a game
is kind of like -- to borrow from something John recently wrote -- taking a Van Gogh painting
and getting the stats of the number of colors, the number of strokes, the number of strokes
sorted by varying degrees, the heights and widths and thickness of the strokes, etc.

Apparently, the kind of information above can be useful for software to analyze
potential forgeries -- comparing a questionable Van Gogh's stats to the real master's stats. :)

As far as trying to appreciate a masterpiece, the stats are not very interesting to me. :)
x.jpg
x.jpg (126.06 KiB) Viewed 13840 times
User avatar
RBerenguel
Gosei
Posts: 1585
Joined: Fri Nov 18, 2011 11:44 am
Rank: KGS 5k
GD Posts: 0
KGS: RBerenguel
Tygem: rberenguel
Wbaduk: JohnKeats
Kaya handle: RBerenguel
Online playing schedule: KGS on Saturday I use to be online, but I can be if needed from 20-23 GMT+1
Location: Barcelona, Spain (GMT+1)
Has thanked: 576 times
Been thanked: 298 times
Contact:

Re:

Post by RBerenguel »

EdLee wrote:Hi oca, on a related note, your original idea of the stats of various shapes in a game
is kind of like -- to borrow from something John recently wrote -- taking a Van Gogh painting
and getting the stats of the number of colors, the number of strokes, the number of strokes
sorted by varying degrees, the heights and widths and thickness of the strokes, etc.

Apparently, the kind of information above can be useful for software to analyze
potential forgeries -- comparing a questionable Van Gogh's stats to the real master's stats. :)

As far as trying to appreciate a masterpiece painting, the stats are not very interesting to me. :)
x.jpg


On a related note, fractal dimension of Jackson Pollock's paintings was used to detect a forgery (read in a SciAm issue I have at home, from around 2000 I guess)
Geek of all trades, master of none: the motto for my blog mostlymaths.net
User avatar
EdLee
Honinbo
Posts: 8859
Joined: Sat Apr 24, 2010 6:49 pm
GD Posts: 312
Location: Santa Barbara, CA
Has thanked: 349 times
Been thanked: 2070 times

Post by EdLee »

RBerenguel wrote:On a related note, fractal dimension of Jackson Pollock's paintings was used to detect a forgery (read in a SciAm issue I have at home, from around 2000 I guess)
Nice! :clap:
schawipp
Lives in gote
Posts: 420
Joined: Mon Nov 12, 2012 1:13 am
Rank: EGF 4k
GD Posts: 0
Has thanked: 75 times
Been thanked: 58 times

Re:

Post by schawipp »

EdLee wrote:Hi oca, on a related note, your original idea of the stats of various shapes in a game
is kind of like -- to borrow from something John recently wrote -- taking a Van Gogh painting
and getting the stats of the number of colors, the number of strokes, the number of strokes
sorted by varying degrees, the heights and widths and thickness of the strokes, etc.


Actually, there is an artist who is specialized on these kind of things: http://innovajo.blogspot.com/2011/09/ocd-artist-ursus-wehrli-16-photos.html ;-)
John Fairbairn
Oza
Posts: 3724
Joined: Wed Apr 21, 2010 3:09 am
Has thanked: 20 times
Been thanked: 4672 times

Re: Game moves statistics, any program for that ?

Post by John Fairbairn »

A long time ago, probably in days of rec.games.go, I posted ideas about a program that would detect the type of move just made and then offer a list of proverbs or even articles that apply to that type of move. It was meant for humans but had obvious applications in computer play, too.

I implemented a version that worked for a handful of move types such as monkey jumps, but it was just too much work to cover the whole gamut. But I still think it's doable and useful.
User avatar
RBerenguel
Gosei
Posts: 1585
Joined: Fri Nov 18, 2011 11:44 am
Rank: KGS 5k
GD Posts: 0
KGS: RBerenguel
Tygem: rberenguel
Wbaduk: JohnKeats
Kaya handle: RBerenguel
Online playing schedule: KGS on Saturday I use to be online, but I can be if needed from 20-23 GMT+1
Location: Barcelona, Spain (GMT+1)
Has thanked: 576 times
Been thanked: 298 times
Contact:

Re: Game moves statistics, any program for that ?

Post by RBerenguel »

In a very simple-case scenario, this is doable with some shell scripting, patience and using sgfutils. No need to reinvent the wheel in this case, just build the car on top of some neat wheels. I.e. quick example

create an SGF file with a stone at hoshi and a keima approach. Name it hoshi-keima-kakari.sgf (for instance)
create an SGF file with a stone at hoshi and a 1pt jump approach. Name it hoshi-1-jump-kakari.sgf (for instance)
create an SGF file with a stone at hoshi and a ogeima approach. Name it hoshi-ogeima-kakari.sgf (for instance)
[...]

[Note: IIRC, for sgfutils to recognise proper kakaris with otherwise empty corners, i.e. proper kakari and not just an approach to a developed corner later, we'd also need to add "empty" for the non-related areas in the quadrant where the hoshi is]

Loop through all these files using sgfinfo -pat={patternfile} -alltra -trunc50 file_to_analise.sgf to check kakaris only for the first 50 moves or so, then output the relevant info. So, if sgfinfo matches hoshi-keima-kakari.sgf, return in the data "Played a keima kakari to a hoshi stone."

Actually this could be made much more interesting by (afterwards) automatically looking up joseki choices in kogo's joseki dictionary.

----

This is vaguely close to a minor project I have to study 9x9 games in more detail, using sgfutils and my relatively large collection of (relatively) high level amateur play & pro play. Specifically I want to check common shapes and openings used, as well as relatively specific tactics that come in play. So far it's essentially an idea because I'm not sure how to handle part of it (specifically checking middle game situations is very hard unless using pachi's pattern-checking & making systems, and I'm not sure if it handles 9x9 well)
Geek of all trades, master of none: the motto for my blog mostlymaths.net
User avatar
oca
Lives in gote
Posts: 699
Joined: Wed Feb 19, 2014 2:53 am
Rank: DDK
GD Posts: 0
KGS: aco
IGS: oca
OGS: oca
Location: Switzerland
Has thanked: 485 times
Been thanked: 166 times

Re: Game moves statistics, any program for that ?

Post by oca »

Marcel Grünauer wrote:Getting back on topic, I'm also thinking about such a program. The difficulty might be to assign a type to a move (is it nobi, nozoki, oki etc.); maybe some moves can have several types.

Let's say we have this sequence, where :b5: is both a nobi from :b1: and a from keima :b3:...

I would say the program should show this :

Code: Select all

black : 
   - hoshi : 1
   - Ogeima : 1
   - nobi : 1 
   - keima : 1

white :
  - is there anybody here ? ;)

Marcel Grünauer wrote:It would then also be interesting to look at sequences (e.g., "empty corner star point > keima kakari > two-space high pincer > keima kake > nobi" etc.) and use these sequences as the basis for a new kind of positional search by asking "which games contain these sequences?", thereby identifying kinds of fights etc.

Yes, that would be fine too to indentify kakari, shimari and so on...
Converting the book Shape UP! by Charles Matthews/Seong-June Kim
to the gobook format. last updated april 2015 - Index of shapes, p.211 / 216
User avatar
oca
Lives in gote
Posts: 699
Joined: Wed Feb 19, 2014 2:53 am
Rank: DDK
GD Posts: 0
KGS: aco
IGS: oca
OGS: oca
Location: Switzerland
Has thanked: 485 times
Been thanked: 166 times

Re:

Post by oca »

EdLee wrote:Hi oca, not that I know of, but maybe it's an interesting idea to show broken shapes or other bad shapes.
(Of course, we sill need further analysis to determine if the shape is actually good or bad, locally and globally.)

For example, each of (a) and (b) below shows a local broken shape for W.
(a): Locally, pro consensus is the result is even. Needs global context.
(b): Locally, bad for W. Still needs global context.
Click Here To Show Diagram Code
[go]$$
$$ | . . . . . . . . . ? . . . . . . . . . |
$$ | . . . . a . . . . ? . . . . b . . . . |
$$ | . . . . . . . . . ? . . . . . . . . . |
$$ | . . O . . . . . . ? . . . . . . . . . |
$$ | . . . X . . . . . ? . . X X X X X . . |
$$ | . . O X . . . . . ? . . . O X O . . . |
$$ | . . O # # W . X . ? . . . O X O . . . |
$$ | . . O W # . . . . ? . . . . X . . . . |
$$ | . . . . . . . . . ? . . . . . . . . . |
$$ -----------------------------------------[/go]


detecting broken shape would be so cool, but seems very difficult... maybe we can just spot "obvious one", but then we need a definition for what "an obvious broken shape" is... :scratch:

anyway... what would be cool is that the program can have some kind of "plugin", so that we can plug modules...
- a module for detecting simple moves,
- a module for broken shape
- a module for known bad shapes (which can be good sometimes... headache again...)
etc...
[edit]
- a module to count sacrificed stones, once again very easy to do :-? ....
- a module to mesure aji... :o ok stop here with impossible things, let's focus on doable one
[/edit]
Converting the book Shape UP! by Charles Matthews/Seong-June Kim
to the gobook format. last updated april 2015 - Index of shapes, p.211 / 216
User avatar
Bonobo
Oza
Posts: 2224
Joined: Fri Dec 23, 2011 6:39 pm
Rank: OGS 13k
GD Posts: 0
OGS: trohde
Universal go server handle: trohde
Location: Lüneburg Heath, North Germany
Has thanked: 8262 times
Been thanked: 924 times
Contact:

Re: Re:

Post by Bonobo »

schawipp wrote:[..] there is an artist who is specialized on these kind of things: http://innovajo.blogspot.com/2011/09/ocd-artist-ursus-wehrli-16-photos.html ;-)

Thanks for that great “OCD art” link, muchly appreciated (and widely shared) :-D

Greetz, Tom
“The only difference between me and a madman is that I’m not mad.” — Salvador Dali
hyperpape
Tengen
Posts: 4382
Joined: Thu May 06, 2010 3:24 pm
Rank: AGA 3k
GD Posts: 65
OGS: Hyperpape 4k
Location: Caldas da Rainha, Portugal
Has thanked: 499 times
Been thanked: 727 times

Re: Game moves statistics, any program for that ?

Post by hyperpape »

I'm not sure how I feel about the fact that the twigs are not straight up and down in the seventh work.
gowan
Gosei
Posts: 1628
Joined: Thu Apr 29, 2010 4:40 am
Rank: senior player
GD Posts: 1000
Has thanked: 546 times
Been thanked: 450 times

Re: Game moves statistics, any program for that ?

Post by gowan »

Couldn't Kombilo be used in some cases? Say look for keima, ikken tobi, ogeima, etc. It might work if you cut down the empty space around the shape that is the search key.
User avatar
daal
Oza
Posts: 2508
Joined: Wed Apr 21, 2010 1:30 am
GD Posts: 0
Has thanked: 1304 times
Been thanked: 1128 times

Re: Game moves statistics, any program for that ?

Post by daal »

This isn't exactly what you're looking for, but your question reminded me of the go style estimator, which did offer some analysis of the types of moves a player tends to make. Unfortunately, it seems no longer to be working.
Patience, grasshopper.
Post Reply