• Home
  • Twitter
  • SmarterSig
  • Betfair
  • About Me
  • Post Cats
    • Betfair API-NG
    • Horse Stride Length
    • Web Scraping Race Data
  • Books
    • Precision CX Wong
    • Hands on ML

Make Your Betting Pay

~ Improve Your Horse Betting

Make Your Betting Pay

Tag Archives: Deep Learning Horse Racing Machine Learning

Deep Learning and Horse Racing

17 Thursday May 2018

Posted by smartersig in Deep Learning

≈ 18 Comments

Tags

Deep Learning Horse Racing Machine Learning

Came back inspired and fascinated from the cinema the other day having sat with one other lone cinema goer watching AlphaGo.
Alphago is a deep learning program create by the company DeepMind to challenge the world champion Go player. Since the defeat of Kasparov, a world chess champion by a similar deep learning program the next mountain to climb was always Go. So far its proved elusive as the number of game permutations in Go make Chess look like noughts and crosses and it was thought that Go might be just too difficult for an AI program. If you get a chance you must see the documentary as it tracks the development, first beating the European champion and then the world champion. Even more interesting is the reaction of the huge crowd watching the event.

If you have read any of my other posts you will know that I have been impressed by the gains that seem to be possible surrounding the machine learning algorithm Gradient Boosting. This algorithm seems to be the defacto Kaggle competition winner at the moment. Kaggle, if you are not familiar, is a web site where data scientist hobbyists and pro’s take on submitted data sets and see who can produce the best Machine Learning solution. Inspired by Go I finally got around to checking out Deep Learning and was not surprised to find further gains. I tested three approaches on a simple data set consisting of just two features, namely horse age and days since last run. In all three cases I trained the models on two years of flat handicap data and tested them on one year of handicap data. Deep learning came out ahead of GDB which in turn beat Random Forests in terms of profit and loss of top rated.

If this topic would be of interest as perhaps a hands on tutorial then please leave a comment below. In the meantime probably the first thing you need to do if you want to get involved is to install Tensorflow and Keras. Keras is a front end built on top of Tensorflow and provides a simplified access to deep learning. You will need to have Anaconda Python installed which if you followed my earlier blog on Machine Learning you should have installed see here

https://markatsmartersig.wordpress.com/2016/01/13/profitable-punting-with-python-1/

Installing Tensorflow and Keras

First you need to create a new environment for your Keras based programs. Pull up a command box (type command in windows search box)

Assuming you have Anaconda installed enter the following command (not very clear in WordPress but that is a double dash before name shown below)

conda create –name deeplearning python

You can change deeplearning to whatever you’d like to call the environment. You’ll be prompted to install various dependencies throughout this process—just agree each time.

Let’s now enter this newly created virtual environment. Enter the following command

activate deeplearning

The command prompt should now be flanked by the name of the environment in parentheses—this indicates you’re inside the new environment.

We know need to install in this new environment any libraries we may need as they wont be accessible from the original root folder created when Anaconda was installed.

IPython and Jupyter are a must for those who rely on Jupyter notebooks for data science. Enter the following commands

conda install ipython
conda install jupyter

Pandas includes the de facto library for exploratory analysis and data wrangling in Python. Enter the following command

conda install pandas

SciPy is an exhaustive package for scientific computing, but the namesake library itself is a dependency for Keras. Enter the following

conda install scipy

Seaborn is a high-level visualization library. Enter the following

conda install seaborn

Scikit-learn contains the go-to library for machine learning tasks in Python outside of neural networks.

conda install scikit-learn

We’re finally equipped to install the deep learning libraries, TensorFlow and Keras. Neither library is officially available via a conda package (yet) so we’ll need to install them with pip. One more thing: this step installs TensorFlow with CPU support only and not GPU support. Enter the following

pip install –upgrade tensorflow
pip install –upgrade keras

Check all is OK

Get Jupyter Notebook up and running by entering

jupyter notebook

Once you are in notebook create a new notebook file and simply enter

from keras.models import Sequential
from keras.layers import Dense

Now run the above cell and hopefully all will be OK

Should you at any point wish to remove the new environment simply use the following command

conda remove –name deeplearning –all

That’s enough for now, if there is interest then we could perhaps explore the code sessions.

Subscribe

  • Entries (RSS)
  • Comments (RSS)

Archives

  • December 2019
  • November 2019
  • September 2019
  • August 2019
  • July 2019
  • May 2019
  • April 2019
  • March 2019
  • February 2019
  • January 2019
  • December 2018
  • October 2018
  • August 2018
  • July 2018
  • June 2018
  • May 2018
  • April 2018
  • March 2018
  • February 2018
  • December 2017
  • November 2017
  • July 2017
  • June 2017
  • April 2017
  • February 2017
  • January 2017
  • December 2016
  • November 2016
  • October 2016
  • September 2016
  • August 2016
  • July 2016
  • May 2016
  • April 2016
  • March 2016
  • February 2016
  • January 2016
  • December 2015
  • November 2015
  • July 2015
  • May 2015
  • April 2015
  • March 2015
  • February 2015
  • January 2015
  • December 2014
  • November 2014
  • October 2014
  • September 2014
  • August 2014
  • July 2014
  • June 2014
  • May 2014
  • April 2014
  • March 2014
  • January 2014
  • December 2013
  • October 2013

Categories

  • Betfair API-NG
  • Deep Learning
  • Group Betting Exercise
  • Horse Stride Length
  • Profitable Punting with Python
  • Sectional Times
  • Sentiment Analysis and Hugh Taylor
  • Speed PARS
  • Uncategorized
  • Web Scraping Race Data

Meta

  • Register
  • Log in

Create a free website or blog at WordPress.com.

Privacy & Cookies: This site uses cookies. By continuing to use this website, you agree to their use.
To find out more, including how to control cookies, see here: Cookie Policy