Skip to content

kshipra-fetch/customer-churn-prediction

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Customer Retention using Fetch.ai Agents and Machine Learning

This repository demonstrates how to integrate a machine learning model with Fetch.ai autonomous agents to make real-time customer-centric decisions. By embedding a customer churn prediction model into these agents, the system can identify potential churners and take proactive measures to retain them.

Setup and Usage

  1. Clone the Repository

    git clone https://github.com/kshipra-fetch/customer-churn-prediction.git
    cd customer-churn-prediction
    
  2. Install Required Packages

    pip install -r requirements.txt
    
  3. Train and Save the Model
    Open and run Customer_Churn_Prediction.ipynb to train the model, apply pre-processing, and save the model and scaler.

  4. Configure Agents
    Customer Retention Agent: Customize customer-retention-agent.py with ClickSend credentials. Churn Prediction Agent: Ensure the paths for saved model and scaler are correct in churn-prediction-agent.py.

  5. Run the Agents\

  • Start the Customer Retention Agent and copy the address and paste in Churn Prediction Agent.
    python3 customer-retention-agent.py
    
  • Start the Churn Prediction Agent in a separate terminal:
    python3 churn-prediction-agent.py
  1. Run the following curl command in a new terminal to test the prediction agent:

    curl -d '{"CreditScore":619,"Geography":"France","Gender":"Female","Age":42,"Tenure":2,"Balance":0,"NumOfProducts":1,"HasCrCard":1,"IsActiveMember":1,"Complain":1,"SatisfactionScore":2}' \
      -H "Content-Type: application/json" \
      -X POST http://localhost:8000/rest/post
  2. Check the logs for both agents to confirm that:

  • The prediction agent identifies churn and sends customer details to the retention agent.
  • The retention agent generates an offer and logs the SMS response.

Further Reading

For more details, check out the full article on Medium: Integrating Machine Learning Models with Fetch.ai Agents for Smarter Decisions

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published