This project focuses on predicting customer churn using machine learning techniques. Customer churn, or customer attrition, occurs when customers stop doing business with a company. Predicting and preventing churn is crucial for businesses as it helps retain customers and reduce revenue loss.
- Dataset
- 1. Data Preprocessing
- 2. Feature Engineering
- 3. Model Building
- 4. Model Optimization
- 5. Model Deployment
- For Model Deployment
The dataset used in this project contains the following columns:
- CustomerID
- Name
- Age
- Gender
- Location
- Subscription_Length_Months
- Monthly_Bill
- Total_Usage_GB
- Churn (the target variable)
In the data preprocessing stage, we perform the following tasks:
- Load the dataset and perform initial data exploration.
- Handle missing data and outliers.
- Prepare the data for machine learning by encoding categorical variables and splitting it into training and testing sets.
To improve the model's prediction accuracy, we generate relevant features from the dataset. Feature engineering involves:
- Creating new features, such as 'Total_Cost' and 'Monthly_Usage_per_Subscription.'
- Applying feature scaling or normalization when necessary.
In the model-building stage, we choose appropriate machine learning algorithms and train and validate the selected model on the training dataset. Evaluation metrics such as accuracy, precision, recall, and F1-score are used to assess model performance.
To fine-tune the model and improve predictive performance, we explore techniques like cross-validation and hyperparameter tuning. Multiple machine learning algorithms may be compared to identify the best-performing model.
Once satisfied with the model's performance, we deploy it in a production-like environment. The model can take new customer data as input and provide churn predictions.
- Open the comment prompt.
- Go to the file location where app.py file is located
- Run the following code: "streamlit run app.py"