Code Monkey home page Code Monkey logo

football-match-outcome-prediction's Introduction

Football-Match-Outcome-Prediction

Football Match Prediction Classifier using data from over 30 years from the top European leagues to predict future match results. The project involves: EDA, data cleaning, feature engineering, feature selection, training and optimising multiple classification models for the best accuracy.

EDA and Data Cleaning

  • Used pandas and seaborn to analyse the dataset and perform some initial analysis, and found some trends in the dataset
  • Used pandas to clean some corrupted data
  • There is a clear relationship between the home team tending to score more goals per game across all the different leagues

Feature Engineering

  • Used pandas to join 3 separate datasets together
  • Cleaned the dataset by filling in missing data
  • Created a number of new features, ensuring no data leakage:
    • Form
    • Total goals
    • Discipline

Upload the data to the database

  • Created a data pipeline which cleans the dataset and uploads it to a SQL database
  • Created a feature engineering pipeline to generate new features from the cleaned dataset
  • The new features generated can be altered and tuned by hyper-parameters

Model Training

  • Trained a baseline Logistic Regression model to predict the result: Home Win, Draw or Away Win
  • Used Random Forest and LightGBM models to improve performance
  • Looked at which features can be removed to improve performance (Leave One Feature Out - LOFO)
  • Looked at which years of the dataset which can be removed in order to improve performance
  • Saved the final model as model.pkl

Inference

  • Scraped data for matches that have been completed since the original dataset was put together
  • Used the data cleaning and feature engineering pipelines to transform the new data
  • Used the model to make predictions for these new datapoints
  • See below for the results for Premier League 2023-24 (Gameweek 12, w/c 22nd Oct)

football-match-outcome-prediction's People

Contributors

dan-bouchard avatar

Watchers

 avatar

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.