📊 Data & Analysisadvancedchurnmachine-learningpythonpredictionsaas

Build a Churn Prediction Model

Design and build a customer churn prediction model with features, training pipeline, and deployment plan.

The Prompt

prompt.txt
Help me build a customer churn prediction model. Provide:
1. Feature engineering: what behavioral signals predict churn
2. Data preparation: handling class imbalance, train/test split
3. Model selection: logistic regression / random forest / gradient boosting — with trade-off reasoning
4. Python code for the training pipeline
5. Evaluation metrics: precision, recall, AUC — and which matters more for this use case
6. Threshold selection: how to tune precision/recall trade-off
7. Deployment: how to score all users daily
8. Intervention strategy: what to do with predicted churners

Context:
- Product type: [SAAS / APP / E-COMMERCE]
- Churn definition: [HOW YOU DEFINE CHURN]
- Available features: [LIST WHAT DATA YOU HAVE — usage events, billing, support, etc.]
- Class imbalance: [ESTIMATED MONTHLY CHURN RATE %]
- Resources: [DO YOU HAVE A DATA SCIENTIST OR IS THIS SELF-SERVE?]

Example Output

Gradient boosting model (XGBoost) with 12 features: days since last API call, weekly call volume trend, plan, team size, support ticket count, and payment failures. SMOTE for class imbalance (5% churn rate). AUC 0.83 on test set. Threshold set at 0.35 to maximize recall (catch churners before they leave). Deployment: daily scoring job via Airflow, top 100 at-risk users surfaced to CS team.

FAQ

Which AI model is best for Build a Churn Prediction Model?

Claude Sonnet 4 — thorough ML pipeline design with practical deployment guidance.

How do I use the Build a Churn Prediction Model prompt?

Copy the prompt, replace the [BRACKETED] placeholders with your specific information, and paste into your preferred AI assistant (ChatGPT, Claude, Gemini, etc.). Gradient boosting model (XGBoost) with 12 features: days since last API call, weekly call volume trend, plan, team size, support ticket count, and payment failures. SMOTE for class imbalance (5% churn rate). AUC 0.83 on test set. Threshold set at 0.35 to maximize recall (catch churners before they leave). Deployment: daily scoring job via Airflow, top 100 at-risk users surfaced to CS team.