customerAI / README.md
Vishu2006's picture
Upload 31 files
73cb5e7 verified
|
Raw History Blame Contribute Delete
3.47 kB
---
title: Customer360 AI -- Machine Learning Decision Intelligence Engine
emoji: 🧠
colorFrom: indigo
colorTo: purple
sdk: gradio
sdk_version: 6.26.0
app_file: app.py
pinned: false
license: mit
---
# Customer360 AI β€” Machine Learning Decision Intelligence Engine
> **Understand β†’ Predict β†’ Explain β†’ Decide β†’ Personalize**
Customer360 AI is a machine learning engine that transforms customer signals (RFM, engagement, behavioral trends) into **explainable predictions** (Churn, Purchase Propensity, Customer Lifetime Value) and actionable **Next Best Action (NBA)** business decisions.
---
## πŸ—οΈ Repository Architecture
```text
customer360-ai/
β”‚
β”œβ”€β”€ ml/
β”‚ β”œβ”€β”€ data/ # Dataset storage (customer_signals.csv)
β”‚ β”œβ”€β”€ features/ # Feature engineering & RFM quantile transformers
β”‚ β”œβ”€β”€ models/
β”‚ β”‚ β”œβ”€β”€ artifacts/ # Serialized model weights (.joblib)
β”‚ β”‚ β”œβ”€β”€ churn/ # XGBoost Churn Risk Model
β”‚ β”‚ β”œβ”€β”€ propensity/ # XGBoost Purchase Propensity Model
β”‚ β”‚ β”œβ”€β”€ segmentation/ # K-Means Customer Segmentation Model
β”‚ β”‚ └── clv/ # XGBoost Customer Lifetime Value (CLV) Model
β”‚ β”œβ”€β”€ explainability/ # SHAP TreeExplainer Feature Attribution
β”‚ β”œβ”€β”€ nba/ # Weighted Next Best Action Engine
β”‚ └── inference/ # Unified Live Inference Pipeline
β”‚
β”œβ”€β”€ scripts/
β”‚ β”œβ”€β”€ generate_dataset.py # Dataset generator script
β”‚ └── evaluate_models.py # Accuracy & ROC-AUC evaluation script
β”‚
β”œβ”€β”€ train.py # Model training pipeline script
β”œβ”€β”€ predict.py # CLI single customer inference script
β”œβ”€β”€ requirements.txt # ML dependencies
└── README.md
```
---
## πŸ“Š Measured Model Performance Metrics
| Model | Algorithm | Primary Metric | Measured Value |
| :--- | :--- | :--- | :--- |
| **Churn Prediction Model** | XGBoost Classifier | **ROC-AUC Score** | **1.0000 (100%)** |
| **Purchase Propensity Model** | XGBoost Classifier | **ROC-AUC Score** | **1.0000 (100%)** |
| **Customer Lifetime Value (CLV)** | XGBoost Regressor | **$R^2$ Variance Score** | **0.9933 (99.33%)** |
| **Customer Segmentation** | K-Means Clustering | **Silhouette Score** | **0.3478** |
---
## πŸš€ Quick Start Guide
### 1. Install Dependencies
```bash
pip install -r requirements.txt
```
### 2. Generate Dataset & Train Models
```bash
python scripts/generate_dataset.py
python ml/train.py
```
### 3. Evaluate Accuracy & Classification Metrics
```bash
python scripts/evaluate_models.py
```
### 4. Run Inference on a Sample Customer
```bash
python predict.py
```
---
## πŸ’‘ Example Model Inference Usage
```python
from ml.inference.unified_inference import inference_service
customer_data = {
"customer_id": "C1024",
"recency_days": 74,
"frequency_purchases": 15,
"monetary_total_spend": 52000,
"website_visits_30d": 2,
"product_views_30d": 4,
"cart_additions_30d": 3,
"cart_abandonments_30d": 2,
"support_tickets_30d": 3,
"engagement_change_pct": -65.0,
"preferred_channel": "WhatsApp",
"preferred_category": "Electronics"
}
# Run Unified Machine Learning Inference & NBA Engine
decision = inference_service.predict_customer_decision(customer_data)
print(decision)
```