A lightweight Flask app that forecasts next-month vehicle stock demand and surfaces basic buyer insights. Built for my WGU Computer Science capstone.
This is a local-only demo.
- Python 3.x
- pip
Install dependencies with the included script, then run the app.
git clone https://github.com/KodyPrograms/Automotive-Inventory-Predictor.git
cd Automotive-Inventory-Predictor
python install.py
python app.pyIf you want to manage deps yourself:
pip install flask pandas scikit-learn joblib
python app.pyIf you need to retrain the model from scratch, run:
python train.pyThis writes vehicle_stock_forecast_model.pkl to the project root.
Use the cleaning script to preprocess raw data before training.
python clean_car_data.pyThis outputs csv/cleaned_car_data.csv.
From the home page, upload a CSV. The app will:
- Clean the uploaded file
- Retrain the model
- Generate a forecast report
You can download the forecast from the Download button once it’s generated.
csv/template.csvprovides the expected column layoutcsv/car_data.csvis a raw sample datasetcsv/cleaned_car_data.csvis the cleaned version used for training
- Browser (Flask + Jinja templates)
- Python app (data cleaning -> model training -> prediction)
- CSV storage (inputs + generated report)
- Forecast sales for each vehicle model (next month)
- Buyer insights (avg income and gender distribution)
- CSV export of the forecast report
- The trained model is loaded from
vehicle_stock_forecast_model.pklon startup. - Uploading a file retrains the model and regenerates the report.
Enjoy!