harbor run -t LiteCoder/churn-prediction-imbalanced-dataharbor download LiteCoder/churn-prediction-imbalanced-dataBuild a customer churn prediction pipeline in Python that generates a synthetic telecom dataset, handles class imbalance, trains multiple models, and evaluates them with emphasis on recall.
/app/Create a synthetic telecom customer churn dataset and save it to /app/churn_dataset.csv. The dataset must have:
Churn with values 1 (churned) and 0 (not churned)CustomerID (unique string identifier)Tenure (integer, months with the company)MonthlyCharges (float)TotalCharges (float)Contract (categorical: "Month-to-month", "One year", "Two year")InternetService (categorical: "DSL", "Fiber optic", "No")NumSupportTickets (integer)PaymentMethod (categorical: at least 3 distinct values)/app/class_distribution.png/app/correlation_heatmap.pngChurn column/app/test_features.csvApply at least one resampling technique (e.g., SMOTE, random oversampling, or undersampling) on the training data only.
Train at least 3 different classification models (e.g., Logistic Regression, Random Forest, Gradient Boosting, SVM, etc.).
Evaluate all models on the held-out test set. Save evaluation results to /app/evaluation_results.json with the following structure:
{
"models": [
{
"model_name": "<string>",
"accuracy": <float>,
"precision": <float>,
"recall": <float>,
"f1_score": <float>,
"roc_auc": <float>
}
],
"best_model": "<model_name with highest recall>"
}
All metric values must be between 0.0 and 1.0.
Requirements for the best model:
best_model field must match the model_name of the model with the highest recall in the models list./app/model_comparison.png/app/feature_importance.png/app/best_model.pkl/app/test_predictions.csv with columns: CustomerID, Churn_Predicted, Churn_Probability
Churn_Predicted: integer 0 or 1Churn_Probability: float between 0.0 and 1.0 (probability of churn)| File | Format |
|---|---|
/app/churn_dataset.csv |
CSV with header |
/app/class_distribution.png |
PNG image |
/app/correlation_heatmap.png |
PNG image |
/app/test_features.csv |
CSV with header |
/app/evaluation_results.json |
JSON |
/app/model_comparison.png |
PNG image |
/app/feature_importance.png |
PNG image |
/app/best_model.pkl |
Pickle file |
/app/test_predictions.csv |
CSV with header |