GithubHelp home page GithubHelp logo

tennis-blog's Introduction

Table of Contents

  1. Installation
  2. Project Motivation
  3. File Descriptions
  4. Project Process
  5. Licensing, Authors, Acknowledgements

Installation

The xgboost library is needed to run the code here beyond the Anaconda distribution of Python. The code should run with no issues using Python versions 3. See the requirements.txt file for details about library versions.

Project Motivation

Since I'm both a big tennis fan and data nerd, I've long wanted to know how a machine learning algorithm would cope against the best fantasy tennis players in the world.

File Descriptions

Input data used:

  • data/tdc/tdc_2018.csv: Data about the best fantasy tennis player's predictions for 2018. Manually collected data from www.tennisdrawchallenge.com
  • data/atp (directory): ATP data provided by Jeff Sackmann on https://github.com/JeffSackmann/tennis_atp
  • tennis-blog.ipynb: Exploratory notebook with all steps necessary to answer the question if a machine could beat the best fantasy tennis player.

Project Process

When working with this project I followed the CRISP-DM process. The details are found in the notebook but here is a quick summary:

Business Understanding

To find out if a machine learning model could beat a fantasy tennis player I created a challenge where the goal was to predict the correct winners of tennis matches. I then tried to answer three questions:

  1. How good would the strategy of always picking the best ranked player be? (Benchmark Prediction)
  2. How good is the best fantasy tennis player at predicting tennis matches? (Best Fantasy Tennis Player Prediction)
  3. How good is a machine learning model at predicting tennis matches? (Machine Learning Prediction)

Data Understanding

To be able to answer the question I manually collected data on the best fantasy tennis player from www.tennisdrawchallenge.com. In addition I got ATP tennis data from Jeff Sackmann's Github repository.

Prepare Data

Before I could build a model many things were done to the data. Columns were modified, new features created, missing values imputed and much more. Before training the model data was split into a training and a test set.

Data Modeling

First I choose to use accuracy as the metric to evaluate model performance. Next I trained and tested four supervised learning models:

  • Logistic Regression
  • Gaussian Naive Bayes
  • Random Forest
  • XGBoost

Results

Using a XGBoost model I managed to beat the best fantasy tennis player in the world. More details are found in this blog post: https://medium.com/@marcusnilsson78/can-a-machine-beat-the-best-fantasy-tennis-player-in-the-world-130538bd3e11

Deploy

Output of this project was a notebook and a blog post so nothing were deployed into production.

Licensing, Authors, Acknowledgements

Code

Copyright 2019 Marcus Nilsson

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Data

Give credit to www.tennisdrawchallenge.com for the fantasy tennis data and letting me use screenshots of their site for the blog post.

For the ATP data I must give a huge thank you to Jeff Sackmann. He has provided free high quality tennis data for years. The ATP data from Jeff comes with the following license:

Creative Commons License
Tennis databases, files, and algorithms by Jeff Sackmann / Tennis Abstract is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
Based on a work at https://github.com/JeffSackmann.

In other words: Attribution is required. Non-commercial use only.

tennis-blog's People

Contributors

bomada avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

vc77

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.