Intermediate 10 Questions • ~3 hrs study

Deployment & MLOps (Q291-300)

Model serving, containerization, CI/CD for ML, monitoring, A/B testing, and production-ready ML systems.

291

How do you deploy an ML model to production?

Short Answer

Package model (ONNX, TorchScript, SavedModel) → Create API (FastAPI/Flask) → Containerize (Docker) → Deploy (Kubernetes, AWS SageMaker, or serverless) → Monitor (latency, drift, accuracy).

Key Points

  • Model serialization: pickle, joblib, ONNX, TorchScript
  • Serving: FastAPI (async), TorchServe, TensorFlow Serving, Triton
  • Scaling: Horizontal (multiple replicas) + load balancing
  • Monitoring: Data drift, prediction drift, latency P99

💡 Memory Trick: "ML Deployment = Train → Package → Serve → Monitor → Retrain (continuous loop)"

292

What is model drift and how do you detect it?

Short Answer

Model drift occurs when model performance degrades over time due to changes in data distribution. Types: Data drift (input changes), concept drift (relationship between input-output changes).

Detection Methods

  • Statistical tests: KS test, PSI (Population Stability Index)
  • Monitor feature distributions over time windows
  • Track prediction distribution shifts
  • Performance monitoring with ground truth (delayed feedback)

💡 Memory Trick: "Drift = The world changed but your model didn't. Like using a 2019 map in 2024"

293

Explain A/B testing for ML models.

Short Answer

A/B testing routes a percentage of traffic to the new model (challenger) while the rest goes to the current model (champion). Compare metrics over time with statistical significance before full rollout.

Key Points

  • Traffic split: Start with 5-10% to new model
  • Metrics: Business KPIs (revenue, CTR) + ML metrics (accuracy)
  • Duration: Run long enough for statistical significance
  • Alternatives: Shadow mode (log predictions without serving), canary deployment

💡 Memory Trick: "A/B test = Clinical trial for ML models. Control group vs treatment group"

Questions 294-300 continue with the same detailed format.

Topics covered: Docker for ML, Kubernetes for model serving, Feature Stores, ML Pipeline orchestration (Airflow, Kubeflow), Model Versioning (MLflow, DVC), GPU optimization, and cost management.

View Full Documentation →