owensharpe / Premier-League-Match-Winner-Predictor

**Credit to Dataquest** This project provides a Python script for scraping football data from FBRef using BeautifulSoup and Pandas. The scraped data is intended for predicting English Premier League (EPL) matches. The project is currently halted do to FBRef web-scraping bots.
https://fbref.com/en/
1 stars 0 forks source link
data-scraping football-analytics machine-learning prediction-model

FBRef Football Data Scraper and EPL Match Prediction

Introduction

This repository contains a Python script designed to scrape football data from FBRef using BeautifulSoup and Pandas. The scraped data is intended to be used for predicting English Premier League (EPL) matches. Please note that accessing websites programmatically, especially ones with protective measures like anti-bot mechanisms, may violate their terms of service. Ensure compliance with FBRef's policies before using this code.

Prerequisites

To run the code, make sure you have the following dependencies installed:

Python (version 3.6 or higher) BeautifulSoup4 Pandas

You can install these packages using the following command: pip install beautifulsoup4 pandas

Usage

Run the Python script:

prem_scraping.py This script is designed to scrape FBRef football data. However, be cautious about the legality of web scraping and ensure that you comply with FBRef's terms of service.

Data

The scraped data will be stored in a CSV file named prem_matches.csv. This file will contain various football statistics that can be used for EPL match predictions.

EPL Match Prediction

The predict_matches.py script utilizes the scraped data to predict English Premier League matches. Before running this script, ensure that you have the required libraries installed: pip install scikit-learn

Run the prediction script:

python predict_prem_winners.py

This script uses a machine learning model to predict match outcomes based on the scraped FBRef data. Adjust the model and parameters as needed for your specific requirements.

Disclaimer

Important: Web scraping may violate the terms of service of the website being scraped. Use this code responsibly and ensure compliance with FBRef's policies. The author of this code is not responsible for any misuse or violation of terms of service.

Contributing

Feel free to contribute by forking the repository and submitting a pull request. Bug reports, feature requests, and suggestions are also welcome in the "Issues" section.