The E-Commerce Customer Churn Prediction Platform is a cutting-edge solution designed to empower e-commerce businesses with the ability to identify and predict customer churn. By leveraging machine learning algorithms, this advanced web application analyzes various customer behavior patterns and attributes, providing businesses with valuable insights to take proactive retention measures.

Features

This comprehensive platform offers a range of innovative features that enable businesses to gain a deeper understanding of their customers' behavior and preferences. Some key features include:

  • Customer Churn Prediction: Accurately predicts the likelihood of a customer churning based on their behavior and profile data
  • Intuitive Data Entry: User-friendly form with organized sections for customer profile, shopping behavior, and satisfaction metrics
  • Visual Result Display: Clear visual representation of prediction results with probability indicator
  • Comprehensive Dashboard: Detailed analytics dashboard with churn trends, customer distribution, and risk factors

Technology Stack

The E-Commerce Customer Churn Prediction Platform is built using a robust technology stack that includes:

  • Python 3.8+: Core programming language
  • Flask 2.0.1: Web framework for building the application
  • Pandas 1.3.3: Data manipulation and analysis
  • NumPy 1.21.2: Numerical computing
  • Scikit-learn 0.24.2: Machine learning library

Project Structure

The project is organized into the following directories:

  • webApp/: Main application directory containing files such as app.py, requirements.txt, and HTML templates

+ templates/: Directory for HTML templates (e.g., index.html, result.html, dashboard.html)

+ rf_churn_model.pkl: Pre-trained Random Forest model

Installation

To set up the project locally, follow these steps:

  1. Clone the repository: git clone https://github.com/yourusername/ecommerce-churn-prediction.git
  2. Create a virtual environment: python -m venv venv
  3. Activate the virtual environment:
  • On Windows: venv\Scripts\activate
  • On macOS/Linux: source venv/bin/activate
  1. Install dependencies: pip install -r requirements.txt
  2. Run the application: python app.py
  3. Access the application: Open your web browser and navigate to http://127.0.0.1:5000/

Usage

To use the application, follow these steps:

  1. Navigate to the home page
  2. Fill in all required fields with customer data:
  • Customer Profile: Tenure, City Tier, Gender, Marital Status
  • Shopping Behavior: Warehouse distance, App usage, Login device, etc.
  • Order Details: Order count, Days since last order, Cashback amount, etc.
  • Satisfaction Metrics: Satisfaction score, Complaints
  1. Submit the form to generate a prediction
  2. View comprehensive analytics including:

+ Customer distribution

+ Churn rate trends

+ Risk factors

+ City tier and product category analysis

+ Recent predictions

Machine Learning Model

The application uses a Random Forest classification model trained on historical e-commerce customer data with the following characteristics:

  • Algorithm: Random Forest Classifier
  • Training Data: Historical customer behavior and churn status
  • Validation Method: Cross-validation
  • Features: 29 input features after one-hot encoding
  • Target Variable: Binary (Churn/No Churn)

Future Enhancements

The E-Commerce Customer Churn Prediction Platform is designed to be highly scalable and adaptable, with future enhancements planned to include:

  • Integration with existing customer relationship management systems
  • Real-time prediction updates based on changing customer behavior
  • Advanced analytics capabilities for identifying trends and patterns

Contributing

The project welcomes contributions from the open-source community. If you're interested in contributing or have questions about the project, please feel free to reach out.

License

The E-Commerce Customer Churn Prediction Platform is licensed under the MIT License.