{"id":20687233,"url":"https://github.com/bomada/tennis-blog","last_synced_at":"2025-10-05T22:17:39.556Z","repository":{"id":37240391,"uuid":"189946855","full_name":"Bomada/tennis-blog","owner":"Bomada","description":"Data extraction and modelling for the tennis blog","archived":false,"fork":false,"pushed_at":"2024-01-18T11:29:40.000Z","size":8202,"stargazers_count":6,"open_issues_count":18,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-11T11:49:12.472Z","etag":null,"topics":["atp","fantasy","ml","portfolio","python","tennis"],"latest_commit_sha":null,"homepage":null,"language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Bomada.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2019-06-03T06:23:53.000Z","updated_at":"2024-01-18T11:29:44.000Z","dependencies_parsed_at":"2025-04-22T15:10:18.390Z","dependency_job_id":"96475dda-59b0-40b0-a696-8134cd6af48c","html_url":"https://github.com/Bomada/tennis-blog","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Bomada/tennis-blog","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bomada%2Ftennis-blog","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bomada%2Ftennis-blog/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bomada%2Ftennis-blog/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bomada%2Ftennis-blog/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Bomada","download_url":"https://codeload.github.com/Bomada/tennis-blog/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bomada%2Ftennis-blog/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278528714,"owners_count":26001783,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-05T02:00:06.059Z","response_time":54,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["atp","fantasy","ml","portfolio","python","tennis"],"created_at":"2024-11-16T22:56:30.671Z","updated_at":"2025-10-05T22:17:39.523Z","avatar_url":"https://github.com/Bomada.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Table of Contents\n\n1. [Installation](#installation)\n2. [Project Motivation](#motivation)\n3. [File Descriptions](#files)\n4. [Project Process](#process)\n5. [Licensing, Authors, Acknowledgements](#licensing)\n\n# Installation \u003ca name=\"installation\"\u003e\u003c/a\u003e\nThe 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.\n\n# Project Motivation \u003ca name=\"motivation\"\u003e\u003c/a\u003e\nSince 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.\n\n# File Descriptions \u003ca name=\"files\"\u003e\u003c/a\u003e\nInput data used:\n- **data/tdc/tdc_2018.csv**: Data about the best fantasy tennis player's predictions for 2018. Manually collected data from www.tennisdrawchallenge.com\n- **data/atp** (directory): ATP data provided by Jeff Sackmann on https://github.com/JeffSackmann/tennis_atp\n- **tennis-blog.ipynb**: Exploratory notebook with all steps necessary to answer the question if a machine could beat the best fantasy tennis player.\n\n# Project Process \u003ca name=\"process\"\u003e\u003c/a\u003e\nWhen working with this project I followed the CRISP-DM process. The details are found in the notebook but here is a quick summary:\n\n## Business Understanding\nTo 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:\n1. How good would the strategy of always picking the best ranked player be? (Benchmark Prediction)\n2. How good is the best fantasy tennis player at predicting tennis matches? (Best Fantasy Tennis Player Prediction)\n3. How good is a machine learning model at predicting tennis matches? (Machine Learning Prediction)\n\n## Data Understanding\nTo 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.\n\n## Prepare Data\nBefore 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.\n\n## Data Modeling\nFirst I choose to use accuracy as the metric to evaluate model performance. Next I trained and tested four supervised learning models:\n- Logistic Regression\n- Gaussian Naive Bayes\n- Random Forest\n- XGBoost\n\n## Results\nUsing a XGBoost model I managed to beat the best fantasy tennis player in the world. More details are found in this blog post:\nhttps://medium.com/@marcusnilsson78/can-a-machine-beat-the-best-fantasy-tennis-player-in-the-world-130538bd3e11\n\n## Deploy\nOutput of this project was a notebook and a blog post so nothing were deployed into production.\n\n# Licensing, Authors, Acknowledgements \u003ca name=\"licensing\"\u003e\u003c/a\u003e\n## Code\nCopyright 2019 Marcus Nilsson\n\nPermission 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:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE 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.\n\n## Data\nGive credit to www.tennisdrawchallenge.com for the fantasy tennis data and letting me use screenshots of their site for the blog post.\n\nFor 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:\n\n\u003ca rel=\"license\" href=\"http://creativecommons.org/licenses/by-nc-sa/4.0/\"\u003e\u003cimg alt=\"Creative Commons License\" style=\"border-width:0\" src=\"https://i.creativecommons.org/l/by-nc-sa/4.0/88x31.png\" /\u003e\u003c/a\u003e\u003cbr /\u003e\u003cspan xmlns:dct=\"http://purl.org/dc/terms/\" href=\"http://purl.org/dc/dcmitype/Dataset\" property=\"dct:title\" rel=\"dct:type\"\u003eTennis databases, files, and algorithms\u003c/span\u003e by \u003ca xmlns:cc=\"http://creativecommons.org/ns#\" href=\"http://www.tennisabstract.com/\" property=\"cc:attributionName\" rel=\"cc:attributionURL\"\u003eJeff Sackmann / Tennis Abstract\u003c/a\u003e is licensed under a \u003ca rel=\"license\" href=\"http://creativecommons.org/licenses/by-nc-sa/4.0/\"\u003eCreative Commons Attribution-NonCommercial-ShareAlike 4.0 International License\u003c/a\u003e.\u003cbr /\u003eBased on a work at \u003ca xmlns:dct=\"http://purl.org/dc/terms/\" href=\"https://github.com/JeffSackmann\" rel=\"dct:source\"\u003ehttps://github.com/JeffSackmann\u003c/a\u003e.\n\nIn other words: Attribution is required. Non-commercial use only.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbomada%2Ftennis-blog","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbomada%2Ftennis-blog","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbomada%2Ftennis-blog/lists"}