Monday, 5 April 2010

The Betting AI (Artificial intelligence) - project initiation

Next part of the betting ai design.

Background

In 2008 I started a research project that was to analyse and understand behaviours on a betting exchange. On the beginning of my research I created FlexiBet, automated betting system based on state machines. For the purpose of the Flexibet project I developed betting-scxml, domain specific language for creating automated betting strategies based on SCXML state machines. 

Having that, I created a few betting strategies and I put them live to get some data to analyse. In the next step I analysed collected data, then I created new betting strategy and I put it live again to get more data to analyse.

I was evolving betting strategies and analysing collected data for one year or so, until it became time consuming and difficult to continue. It was because of using manual data analysis, mostly based on SQL and Eclipse Birt Business Intelligence. Despite of being simple and handy for creating simple reports, I found it difficult to analyse complex data.

Vision

The vision is to apply neural network technique to analyse markets on a betting exchange. I want to create a trader based on a neural network that can take appropriate bet placement decisions. Then, trader should be tested on a historical market data to measure how efficient the trader's intelligence is.

Use case scenario:
I want to choose historical market data for the simulation, e.g. all market data for the period from 01.02.2010 to 10.02.2010

Then I want to choose trader implementation that the bet placement intelligence should be tested for.

Then I want to run simulation.

Finally I want to see expected trader profit based on matched bets placed by trader and market probabilities derived from market prices before market is turned in play.

References

Project home page: http://code.google.com/p/betting-ai/

4 comments:

  1. I don't know if you plan to do it, but publishing the collected dataset could also help people like me to test our ideas against a real dataset without going through the pain of building a full featured automatic bettor.

    Keep the good work.

    ReplyDelete
  2. Hello,

    Not specifically related to this article but as you just come back on your new website after being in holidays quite some time :), i begin here.

    I know you like cxf, but why not having used directly the Betfair java code instead ? I guess there are several reasons as Betfair code is in its final state, validated and so on, contrary to your code for which you still add betfair features.

    Nothing related, but i like your idea about playing with betfair and i also like you now play around with scala :) By the way, did you ever consider a good business rules engine like Drools for example ? I may misunderstood but i feel an sql database in this context is not the thing you love the most in this world :) Did you give a try to a graph database like neo4j which i think is quite natural in this context.

    Alex

    ReplyDelete
  3. Hi,

    It is perhaps obvious, but for the benefit of those following make sure you have two data sets, one for training and one for validation.

    An error of many potential AI researchers is to validate against their training set, which is no validation at all.

    Keep up the fine work, and thanks for sharing.


    Vaughano.

    ReplyDelete
  4. Hi Toni, Cloud, Anonymous,

    Thanks for your comments.

    Toni:
    Unfortunately I cannot publish collected data, because of using non commercial betfair api licence, but feel free to use my software to do it:

    http://code.google.com/p/betfair-api/ - java betfair api that is easy to use. Go to junit tests, most of the code is well commented.

    http://code.google.com/p/betex-ecosystem/source/browse/#svn/trunk/betex-ecosystem-marketdatacollector - Simple market data collector that stores data in the Apache CouchDB. It’s a command line application that allows collecting either one particular market every given number of seconds or all HR win/place/inplay/sp markets 10 minutes before market start time. The given data is collected: market prices, market traded volume, market details.

    http://code.google.com/p/betting-market-observer/ - Collects data from betfair api, betdaq, bwin, oddschecker, etc. and correlates it. This module is used by FlexiBet automated betting system.

    Cloud:
    Why cxf and not Betfair java code?
    When I created my library the betfair java code didn’t exist, I’m not sure if it exist now and how stable it is.

    Drools?
    Yes, I considered it two years ago when I was starting Flexibet project. I decided to chose SCXML , because it provides state machine concept and drools doesn’t.

    neo4j?
    I haven’t tried it but it sounds promising, btw for the purpose of the betting-ai project I’m using the Apache Couch DB database. It’s a schema less database, so storing complex and dynamic data is very useful, also it provides a concept of views to process raw data using map-reduce algorithm. When I have a while I will drop a line on my blog about it.

    Anonuymous:
    My idea is to learn the neural network continuously, so to keep it up to date. In terms of processing historical data for the purpose of simulation, I will process first market, then learn the network, then process next market and train the neural network again and so on. When I will be in the position to put neural networks live, then I will do the same, so neural network will be trained every time the new market is processed.

    ReplyDelete