This project aims to predict outcomes of upcoming UFC fights based on historical fight data. It involves scraping fight data, preprocessing it, and training machine learning models to make predictions. The results are stored in a CSV file for further analysis.
-
Clone the repository:
git clone https://github.com/Jacob1802/ufc_model.git cd ufc-prediction-model -
Create a virtual environment:
python -m venv venv On Linux/Mac: source venv/bin/activate On Windows: venv\Scripts\activate -
Install the dependencies:
pip install -r requirements.txt
python main.py
This will:
- Scrape the latest UFC event data.
- Prepare the data for modeling.
- Train models and make predictions.
- Save the predictions to `data/predictions.csv`.The project uses a combination of machine learning models to predict various fight outcomes:
- Linear Regression for statistical predictions (e.g., strikes landed, takedowns).
- LightGBM Classifier for win/loss predictions.
- Feature Engineering: Preprocesses the raw fight data to extract relevant features for modeling.
- Label Encoding: Encodes categorical variables for model compatibility.
- Models are trained using historical fight data (
data/fights.csv). - The data is split into training and testing sets to evaluate model performance.
- The trained models predict outcomes for upcoming fights (
data/upcoming_fight_data.csv). - Predictions include the winner and confidence levels for each fight.
- Results are saved to
data/predictions.csv.