Giter Site home page Giter Site logo

irc_parser's Introduction

Poker Hands Dataset

Simple scripts to extract, clean and browse the IRC Poker Database. Note here only hold 'em hands are included. Most (over 95%) hands are dropped either because they're not hold 'em or because of lack of features.

Data Preparation

Run the following codes in order:

wget http://poker.cs.ualberta.ca/IRC/IRCdata.tgz  # download the database (-> IRCdata.tgz)
tar -xvf IRCdata.tgz                              # unzip the tgz file (-> IRCdata)
python3 extract.py                                # extract data (-> hands.json)
python3 clean.py                                  # drop invalid hand data (-> hands_valid.json)

Eventually there're 10,233,955 hands in hands.json and 437,862 in hands_valid.json after cleaning.

Data Inspection

You may run the following code to inspect hands in their original order. Any time you'd like to stop browsing, you can just use Ctrl+C to interrupt the process.

python3 browse.py                                 # print hands in a formatted way

The script lists extracted hands history as below.

############################################################
   time : 199612            id : 2093
  board : ['Qd', '6s', 'Td', 'Qc', 'Jh']
   pots : [(2, 60), (2, 60), (2, 60), (2, 60)]
players : 
                         Tiger (#1)                         
{'action': 30,
 'bankroll': 2922,
 'bets': [{'actions': ['B', 'r'], 'stage': 'p'},
          {'actions': ['k'], 'stage': 'f'},
          {'actions': ['k'], 'stage': 't'},
          {'actions': ['k'], 'stage': 'r'}],
 'pocket_cards': ['9s', 'Ac'],
 'winnings': 30}
· · · · · · · · · · · · · · · · · · · · · · · · · · · · · · 
                        jvegas2 (#2)                        
{'action': 30,
 'bankroll': 139401,
 'bets': [{'actions': ['B', 'c'], 'stage': 'p'},
          {'actions': ['k'], 'stage': 'f'},
          {'actions': ['k'], 'stage': 't'},
          {'actions': ['k'], 'stage': 'r'}],
 'pocket_cards': ['9c', 'As'],
 'winnings': 30}
############################################################

References

irc_parser's People

Contributors

wsdqy1234 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.