Skip to content

I walk you though what an entire machine learning cycle looks like for a binary classification problem. For this walkthrough, we are utilizing UCI's Iranian Churn dataset

License

Greenskin44/telecom-churn-ml-lifecycle

Repository files navigation

Churn Prediction Model

This repository contains a machine learning model designed to predict customer churn in an Iranian telecom company. The project includes model training, evaluation, deployment via Docker, and a RESTful API for serving predictions.

Table of Contents


Installation

To set up this project locally, follow these steps:

  1. Clone the repository:
     git clone https://github.com/Greenskin44/churn-prediction.git
     cd churn-prediction
    
    
    
  2. Usage a. Train and Evaluate the Model To train and evaluate the model, use:
    import joblib
    model = joblib.load('Optimized_IRN_churn_prediction_model.pkl')
    predictions = model.predict(X_test)
    
    

c. Model Explanation Use LIME for explainability on a single instance or SHAP (if supported):

from lime import lime_tabular
explainer = lime_tabular.LimeTabularExplainer(...)
explanation = explainer.explain_instance(X_test.iloc[0],           
model.predict_proba)
  1. Model Explainability
    from lime import lime_tabular
    explainer = lime_tabular.LimeTabularExplainer(...)
    explanation = explainer.explain_instance(X_test.iloc[0],model.predict_proba)
    explanation.show_in_notebook()
    
    
  2. Docker Deployment a. This project includes Docker setup for consistent deployment. For full Docker instructions, see Docker/README.md.
       docker build -t churn-model .
       docker run -p 5000:5000 churn-model
    
    
  3. API Instructions a. The API exposes a /predict endpoint for making predictions. Detailed API usage can be found in API/README.md.
       python app.py
    

c. API Endpoint: POST /predict for prediction with JSON data input.

  1. CI/CD Pipeline a. We use GitHub Actions for continuous integration and deployment. For details on the CI/CD setup, see .github/README.md.

  2. License a. This project is licensed under the Apache 2.0 License. See the LICENSE file for details.

Releases

No releases published

Packages

No packages published

Languages