The Customer Churn Prediction project is designed to predict customer churn using a machine learning model deployed via a Flask API. This project helps businesses identify customers who are likely to leave, allowing for proactive retention strategies.
The primary objective of this project is to predict customer churn based on historical customer data. The project consists of two main components: a machine learning model and a Flask API for model deployment.
-
Machine Learning Model: This component involves the training and evaluation of a machine learning model using historical customer data. The model is designed to predict whether a customer is likely to churn or not.
-
Flask API: The Flask API serves as an interface to the machine learning model. It allows users to send customer data and receive churn predictions in real-time.
To run the Flask API, execute the following command:
python FlaskPredictiveService.py
By default, the API runs on http://localhost:5000.
Predict Endpoint URL: /predict Method: POST Description: Make predictions using the pre-trained machine learning model.
Input Data The input data should be provided in JSON format with the following fields:
CustomerID: The unique identifier for the customer. Name: The customer's name. Age: The age of the customer
The API response will be in JSON format and will include churn predictions.
Example Response:
{ "predictions": [0, 1, 0, 0, 1] }
In case of any errors, the API will return an error message in JSON format.
Example Error Response:
{ "error": "Invalid input data." }