A production-ready full-stack AI system for customer analytics, segmentation, churn prediction, and product recommendations with API deployment and scalability.
- K-Means clustering
- DBSCAN clustering
- Hierarchical clustering
- PCA & t-SNE visualization
- Cluster evaluation metrics (silhouette, Davies-Bouldin)
- XGBoost, LightGBM, Random Forest models
- SMOTE for handling imbalanced data
- ROC-AUC, Precision-Recall evaluation
- SHAP feature importance explanations
- Neural Network variant
- Collaborative Filtering (Matrix Factorization)
- Content-Based Filtering
- Hybrid Model
- Neural Collaborative Filtering
- Cold-start handling
- Customer review sentiment analysis
- Topic modeling (LDA)
- BERT-based classification
- Text preprocessing pipeline
- FastAPI REST API
- Real-time + batch predictions
- Model versioning with MLflow
- Docker containerization
- Kubernetes deployment
- Auto-retraining pipeline
- MLflow experiment tracking
- Airflow pipeline orchestration
- Prometheus metrics
- Grafana dashboards
- Model performance monitoring
customer-ml-platform/
├── data/ # Raw & processed data
├── src/
│ ├── data/ # Data loading & preprocessing
│ ├── features/ # Feature engineering
│ ├── models/ # ML models (segmentation, churn, recsys, nlp)
│ ├── api/ # FastAPI application
│ └── utils/ # Helper utilities
├── notebooks/ # Jupyter notebooks for exploration
├── tests/ # Unit & integration tests
├── dashboard/ # Streamlit dashboard
├── docker/ # Docker configurations
├── k8s/ # Kubernetes manifests
├── airflow/ # Airflow DAGs
└── monitoring/ # Prometheus & Grafana configs
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
pip install -r requirements.txtpython src/data/generate_data.pypython notebooks/01_segmentation.py
python notebooks/02_churn_prediction.py
python notebooks/03_recommendation.pypython src/api/main.pystreamlit run dashboard/app.pyPOST /predict/churn- Predict customer churn probabilityPOST /predict/segment- Assign customer to segmentPOST /predict/recommendations- Get product recommendations
POST /batch/churn-prediction- Bulk churn predictionsPOST /batch/segmentation- Bulk customer segmentation
GET /models/list- List all available modelsGET /models/{model_id}/metadata- Get model metadataPOST /models/{model_id}/load- Load specific model version
See config.yaml for:
- Model hyperparameters
- API settings
- Database connections
- Cloud infrastructure
- Data Ingestion → Raw customer data
- Data Pipeline → Preprocessing & feature engineering
- Model Training → Train & evaluate multiple models
- Model Registry → MLflow artifact store
- API Serving → FastAPI + Uvicorn
- Monitoring → Prometheus + Grafana
- Auto-retraining → Airflow scheduled jobs
- Deployment → Kubernetes clusters
Supports:
- AWS (SageMaker, EC2, S3, RDS)
- Google Cloud (Vertex AI, Compute Engine, Cloud SQL)
- Azure (Azure ML, Container Instances)
| Model | Accuracy | AUC-ROC | F1-Score |
|---|---|---|---|
| XGBoost Churn | 0.89 | 0.92 | 0.85 |
| LightGBM Churn | 0.90 | 0.93 | 0.86 |
| CF Recommender | MAE: 0.68 | NDCG: 0.78 | - |
pytest tests/ -v --cov=src- Create a feature branch
- Commit changes
- Run tests & linting
- Submit pull request