This project utilizes a LightGBM machine learning model combined with hyperparameter optimization via Optuna to forecast revenue based on historical data.
Ensure your project structure looks like this before running:
Datathon/
│
├── data/ # Contains raw data (you need to place the csv files here)
│ ├── sales.csv # Training data
│ ├── sales_test.csv # Test data to predict
│ └── sample_submission.csv # Sample format for submission
│
├── src/ # Contains Python source code
│ ├── Feature_engineering.py # Script for data preprocessing and feature extraction
│ └── Main.py # Script for training the LightGBM model and generating predictions
│
├── out/ # Auto-generated directory for predictions and plots
│
├── requirements.txt # List of required Python libraries
└── run.bat # Batch script to automatically run the entire pipeline on Windows
Simply double-click the run.bat file in the root directory. This script will automatically:
- Install all necessary dependencies from
requirements.txt. - Navigate into the
srcfolder. - Execute
Feature_engineering.pyto process the raw data and generate feature datasets. - Execute
Main.pyto search for optimal hyperparameters using Optuna, train the LightGBM model, and output the final results.
Open a Terminal (Command Prompt / PowerShell / bash) at the project root directory (Datathon/):
- Install dependencies:
pip install -r requirements.txt
- Execute Python scripts (Note: you must run these from inside the
srcdirectory):cd src python Feature_engineering.py python Main.py
Upon successful execution, an out/ directory will be created (if it doesn't already exist) containing the following files:
submission.csv: The final prediction file containing the revenue forecast for submission.LightGBM_Simple_Revenue_Forecast.png: A plot comparing the actual revenue (Training set) with the predicted revenue (Test set).Feature_Importance.png: A bar chart illustrating the Feature Importance of the top 30 input variables learned by the model.