Skip to content

Realtime MLOps Implementation using DVC, Docker, GitHub Actions, Kubernetes, KServe and Argo CD.

Notifications You must be signed in to change notification settings

iam-veeramalla/Realtime-MLOps-Project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Churn Model MLOps Demo

A simple demonstration of MLOps practices for a customer churn prediction model.

What Does This Model Do?

Real-World Example:

Imagine you run a telecom company with thousands of customers. Some customers are happy and stay for years, while others leave (churn) after a few months. This model predicts which customers are likely to leave.

Example Customer:

  • Sarah is 45 years old
  • Been a customer for 24 months
  • Pays $79.99/month
  • Total spent: $1,920
  • Called customer support 3 times this month

Model Prediction:

{
  "churn": 1,
  "churn_probability": 0.73
}

Translation: Sarah has a 73% chance of canceling her subscription. Why? She's calling support frequently (unhappy) and paying relatively high fees. Your business can now:

  • Offer her a discount
  • Reach out with personalized support
  • Prevent losing her before she leaves

The model looks at patterns like:

  • High monthly charges → More likely to churn
  • More support calls → Customer is frustrated
  • Low tenure → Haven't built loyalty yet

This helps businesses save customers proactively instead of reacting after they've already left!

Project Structure

churn-model/
├── generate_data.py          # Generate synthetic churn dataset
├── train.py                   # Train the model
├── api.py                     # FastAPI inference server
├── requirements.txt           # Python dependencies

1. Initial Setup

# Install dependencies
pip install -r requirements.txt

# Generate dataset
python generate_data.py

# Train model
python train.py

# Test API locally
python api.py
# Visit http://localhost:8000/docs

API Usage

curl -X POST http://localhost:8000/predict \
  -H "Content-Type: application/json" \
  -d '{
    "age": 45,
    "tenure_months": 24,
    "monthly_charges": 79.99,
    "total_charges": 1920.00,
    "num_support_calls": 3
  }'

Response:

{
  "churn": 1,
  "churn_probability": 0.73
}

About

Realtime MLOps Implementation using DVC, Docker, GitHub Actions, Kubernetes, KServe and Argo CD.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages