Skip to content

A lightweight Flask app that forecasts next-month vehicle stock demand and surfaces basic buyer insights. Built for my WGU Computer Science capstone.

Notifications You must be signed in to change notification settings

KodyPrograms/Automotive-Inventory-Predictor

Repository files navigation

Automotive Inventory Predictor

A lightweight Flask app that forecasts next-month vehicle stock demand and surfaces basic buyer insights. Built for my WGU Computer Science capstone.

Live app

This is a local-only demo.

Running locally

Things you need

  • Python 3.x
  • pip

The easy way

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.py

Open http://127.0.0.1:5000

The harder way

If you want to manage deps yourself:

pip install flask pandas scikit-learn joblib
python app.py

Open http://127.0.0.1:5000

Generate the model (.pkl)

If you need to retrain the model from scratch, run:

python train.py

This writes vehicle_stock_forecast_model.pkl to the project root.

Clean data

Use the cleaning script to preprocess raw data before training.

python clean_car_data.py

This outputs csv/cleaned_car_data.csv.

Uploading data (in-app)

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.

Sample data

  • csv/template.csv provides the expected column layout
  • csv/car_data.csv is a raw sample dataset
  • csv/cleaned_car_data.csv is the cleaned version used for training

Architecture

- Browser (Flask + Jinja templates)
- Python app (data cleaning -> model training -> prediction)
- CSV storage (inputs + generated report)

Features

  • Forecast sales for each vehicle model (next month)
  • Buyer insights (avg income and gender distribution)
  • CSV export of the forecast report

Notes

  • The trained model is loaded from vehicle_stock_forecast_model.pkl on startup.
  • Uploading a file retrains the model and regenerates the report.

Enjoy!

About

A lightweight Flask app that forecasts next-month vehicle stock demand and surfaces basic buyer insights. Built for my WGU Computer Science capstone.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published