📋 This project focuses on predicting customer churn using a RandomForestClassifier.
The goal of this project is to build a predictive model that can accurately predict customer churn. Customer churn refers to the phenomenon where customers stop using a product or service. By identifying customers who are likely to churn, businesses can take proactive measures to retain them and reduce churn rate.
📊 The dataset used for this project is dataset.csv
. It contains various customer attributes such as gender, tenure, monthly charges, and churn status.
🔧 The project workflow can be summarized as follows:
-
Data Preprocessing: The dataset is preprocessed to handle missing values, convert data types, and encode categorical variables.
-
Feature Engineering: The features are transformed and prepared for model training using OneHotEncoder and LabelEncoder.
-
Data Balancing: The dataset is balanced using the SMOTE technique to address class imbalance.
-
Model Training: A RandomForestClassifier model is built using a pipeline that includes data standardization.
-
Model Evaluation: The model is evaluated using accuracy score and classification report on the test set.
-
Hyperparameter Tuning: GridSearchCV is used to find the best hyperparameters for the RandomForestClassifier model.
-
Saving the Model: The best model is saved as a pickle file (
model.pkl
) for future use.
🚀 To run the project:
-
Install the required libraries using
pip install -r requirements.txt
. -
Run the script
main.py
to train the model and save it. -
Use the saved model to make predictions on new data.
📊 The best model achieved an accuracy score of XX% on the test set. It shows promising performance in predicting customer churn.
🔍 Further improvements can be made to enhance the model's performance:
- Explore additional feature engineering techniques to capture more predictive information.
- Experiment with different machine learning algorithms to compare performance.
- Collect more data to improve the model's accuracy and generalization.
📚 Feel free to contribute to this project by suggesting improvements or adding new features!