This Prediction system ingests raw e-commerce customer and order data, cleans and transforms both tables, loads them into PostgreSQL, generates analytics-ready views, trains churn and customer lifetime value models, and exposes real-time prediction services through FastAPI and Streamlit.

🧩 Architecture Overview


  1. Raw data loads from data/raw/customers.csv and data/raw/orders.csv
  2. Data is cleaned and validated in scripts/extract.py and scripts/transform.py
  3. Cleaned tables are loaded into PostgreSQL by scripts/load.py
  4. SQL views are created via sql/07.views.sql and scripts/views.py
  5. Customer-level features are built in src/feature.py
  6. Churn and CLV models are trained in src/model.py
  7. Predictions are generated in src/predict.py and stored in the database
  8. FastAPI serves real-time scoring through /predict
  9. Streamlit delivers an interactive UI for business users
  10. Groq LLM model integration providing AI driven insights and action plan

📊 Dashboard


Page_1.png

Page_2.png

Page_3.png

💻 Webpages