/Kelly-Betting

Using Data Science and Machine Learning Prediction of Football Prediction & Kelly Betting

Primary LanguageJupyter NotebookMIT LicenseMIT

Kelly Betting & Foot Ball Prediction


This is a Data Science project in which we are going to create a machine learning model to make prediction of a football match and betting prediction.


Table of Contents


⚠️ Frameworks and Libraries

  • Sklearn: Simple and efficient tools for predictive data analysis
  • Matplotlib : Matplotlib is a comprehensive library for creating static, animated, and interactive visualizations in Python.
  • Numpy: Caffe-based Single Shot-Multibox Detector (SSD) model used to detect faces
  • Pandas: pandas is a fast, powerful, flexible and easy to use open source data analysis and manipulation tool, built on top of the Python programming language.
  • Seaborn: pandas is a fast, powerful, flexible and easy to use open source data analysis and manipulation tool, built on top of the Python programming language.
  • Pickle: The Pickle module implements binary protocols for serializing and de-serializing a Python object structure.

πŸ“ Datasets

πŸ”„ Source

The Dataset is available in this repository. Clone it and use it.


πŸ“ˆ Visualising data

<br/>

πŸ“– Data Preprocessing

Data pre-processing is an important step for the creation of a machine learning model. Initially, data may not be clean or in the required format for the model which can cause isleading outcomes. In pre-processing of data, we transform data into our required format. It is used to deal with noises, duplicates, and missing values of the dataset. Data pre- rocessing has the activities like importing datasets, splitting datasets, attribute scaling, etc. Preprocessing of data is required for improving the accuracy of the model.

πŸ”‘ Prerequisites

All the dependencies and required libraries are included in the file <code>requirements.txt </code> See here


πŸš€  Installation

The Code is written in Python 3.7. If you don’t have Python installed you can find it here. If you are using a lower version of Python you can upgrade using the pip package, ensuring you have the latest version of pip. To install the required packages and libraries, run this command in the project directory after cloning the repository:

  1. Clone the repo
git clone https://github.com/Chaganti-Reddy/Kelly-Betting.git
  1. Change your directory to the cloned repo
cd Kelly-Betting
  1. Now, run the following command in your Terminal/Command Prompt to install the libraries required
python3 -m virtualenv kelly_b

source kelly_b/bin/activate

pip3 install -r requirements.txt

πŸ’‘ How to Run

  1. Open terminal. Go into the cloned project directory and type the following command:
cd Deploy
python3 main.py

πŸ“‚ Directory Tree

.
β”œβ”€β”€ assets
β”‚   β”œβ”€β”€ 1.png
β”‚   β”œβ”€β”€ 2.png
β”‚   β”œβ”€β”€ GD.png
β”‚   β”œβ”€β”€ GS.png
β”‚   β”œβ”€β”€ main.jpg
β”‚   └── outcome.png
β”œβ”€β”€ Book1.twb
β”œβ”€β”€ Data
β”‚   β”œβ”€β”€ code4.ipynb
β”‚   β”œβ”€β”€ test_data.csv
β”‚   └── train_data.csv
β”œβ”€β”€ Deploy
β”‚   β”œβ”€β”€ app.yaml
β”‚   β”œβ”€β”€ main.py
β”‚   β”œβ”€β”€ model_prepped_dataset.csv
β”‚   β”œβ”€β”€ model_prepped_dataset_modified.csv
β”‚   β”œβ”€β”€ requirements.txt
β”‚   β”œβ”€β”€ static
β”‚   β”‚   β”œβ”€β”€ odds_distribution.png
β”‚   β”‚   └── probability_distribution.png
β”‚   └── templates
β”‚       β”œβ”€β”€ index.html
β”‚       β”œβ”€β”€ prediction1.html
β”‚       β”œβ”€β”€ prediction2.html
β”‚       └── prediction3.html
β”œβ”€β”€ goal_difference_prediction
β”‚   β”œβ”€β”€ AdaBoost.ipynb
β”‚   β”œβ”€β”€ code2.ipynb
β”‚   β”œβ”€β”€ comparison.ipynb
β”‚   β”œβ”€β”€ data_prep.ipynb
β”‚   β”œβ”€β”€ dataset2.csv
β”‚   β”œβ”€β”€ DicisionTree.ipynb
β”‚   β”œβ”€β”€ final_data.csv
β”‚   β”œβ”€β”€ GaussianNB.ipynb
β”‚   β”œβ”€β”€ KNeighbors.ipynb
β”‚   β”œβ”€β”€ model_prepped_dataset.csv
β”‚   β”œβ”€β”€ model_prepped_dataset.json
β”‚   β”œβ”€β”€ odds_kelly.ipynb
β”‚   β”œβ”€β”€ RandomForest.ipynb
β”‚   β”œβ”€β”€ SVC.ipynb
β”‚   β”œβ”€β”€ test_data.csv
β”‚   β”œβ”€β”€ train_data.csv
β”‚   └── XGBClassifier.ipynb
β”œβ”€β”€ goal_difference_prediction2
β”‚   β”œβ”€β”€ AdaBoost.ipynb
β”‚   β”œβ”€β”€ code2.ipynb
β”‚   β”œβ”€β”€ comparison.ipynb
β”‚   β”œβ”€β”€ data_prep.ipynb
β”‚   β”œβ”€β”€ dataset2.csv
β”‚   β”œβ”€β”€ DecisionTree.ipynb
β”‚   β”œβ”€β”€ final_data.csv
β”‚   β”œβ”€β”€ GaussianNB.ipynb
β”‚   β”œβ”€β”€ KNeighbors.ipynb
β”‚   β”œβ”€β”€ model_prepped_dataset.csv
β”‚   β”œβ”€β”€ model_prepped_dataset.json
β”‚   β”œβ”€β”€ odds_kelly.ipynb
β”‚   β”œβ”€β”€ RandomForest.ipynb
β”‚   β”œβ”€β”€ test_data.csv
β”‚   └── train_data.csv
β”œβ”€β”€ goal_prediction
β”‚   β”œβ”€β”€ AdaBoost.ipynb
β”‚   β”œβ”€β”€ code3.ipynb
β”‚   β”œβ”€β”€ comparison.ipynb
β”‚   β”œβ”€β”€ data_analytics.ipynb
β”‚   β”œβ”€β”€ data_prep.ipynb
β”‚   β”œβ”€β”€ dataset3.csv
β”‚   β”œβ”€β”€ DecisionTree.ipynb
β”‚   β”œβ”€β”€ final_data.csv
β”‚   β”œβ”€β”€ GaussianNB.ipynb
β”‚   β”œβ”€β”€ KNeighbors.ipynb
β”‚   β”œβ”€β”€ LogisticRegression.ipynb
β”‚   β”œβ”€β”€ model_prepped_dataset.csv
β”‚   β”œβ”€β”€ model_prepped_dataset.json
β”‚   β”œβ”€β”€ RandomForest.ipynb
β”‚   β”œβ”€β”€ SVC.ipynb
β”‚   β”œβ”€β”€ test_data.csv
β”‚   β”œβ”€β”€ train_data.csv
β”‚   └── XGBClassifier.ipynb
β”œβ”€β”€ k2148344_dissretation_draft.docx
β”œβ”€β”€ model_prepped_dataset.csv
β”œβ”€β”€ model_prepped_dataset.json
β”œβ”€β”€ model_prepped_dataset_modified.csv
β”œβ”€β”€ outcome_prediction
β”‚   β”œβ”€β”€ AdaBoostClassifier.ipynb
β”‚   β”œβ”€β”€ code1.ipynb
β”‚   β”œβ”€β”€ comparison.ipynb
β”‚   β”œβ”€β”€ data_prep.ipynb
β”‚   β”œβ”€β”€ dataset1.csv
β”‚   β”œβ”€β”€ DecisionTree.ipynb
β”‚   β”œβ”€β”€ final_data.csv
β”‚   β”œβ”€β”€ GaussianNB.ipynb
β”‚   β”œβ”€β”€ KNeighborsClassifier.ipynb
β”‚   β”œβ”€β”€ LogisticRegression.ipynb
β”‚   β”œβ”€β”€ model_prepped_dataset.csv
β”‚   β”œβ”€β”€ model_prepped_dataset.json
β”‚   β”œβ”€β”€ odds_kelly.ipynb
β”‚   β”œβ”€β”€ svc.ipynb
β”‚   β”œβ”€β”€ test_data.csv
β”‚   β”œβ”€β”€ train_data.csv
β”‚   └── XGBClassifier.ipynb
β”œβ”€β”€ requirements.txt
β”œβ”€β”€ Team Ranking
β”‚   β”œβ”€β”€ code.ipynb
β”‚   β”œβ”€β”€ data.csv
β”‚   β”œβ”€β”€ model_prepped_dataset.csv
β”‚   └── team_ranking_analysis.ipynb
β”œβ”€β”€ temp.ipynb
└── Total Goal Prediction
    β”œβ”€β”€ code3.ipynb
    β”œβ”€β”€ comparison.ipynb
    β”œβ”€β”€ data_analytics.ipynb
    β”œβ”€β”€ data_prep.ipynb
    β”œβ”€β”€ dataset3.csv
    β”œβ”€β”€ final_data.csv
    β”œβ”€β”€ model_prepped_dataset.csv
    β”œβ”€β”€ model_prepped_dataset.json
    β”œβ”€β”€ test_data.csv
    └── train_data.csv

πŸ”‘ Results

1. Prediction by Outcome


1. Prediction by Goal Difference


1. Prediction by Goals Scored


πŸ‘ And it's done!

Feel free to mail me for any doubts/query βœ‰οΈ chagantivenkataramireddy1@gmail.com


πŸ™‹ Citation

You are allowed to cite any part of the code or our dataset. You can use it in your Research Work or Project. Remember to provide credit to the Maintainer Chaganti Reddy by mentioning a link to this repository and her GitHub Profile.

Follow this format:

  • Author's name - Chaganti Reddy
  • Date of publication or update in parentheses.
  • Title or description of document.
  • URL.

❀️ Owner

Made with ❀️  by Chaganti Reddy

πŸ‘€ License

MIT Β© Chaganti Reddy