How bhavesh2205/bank-customer-churn-prediction works
Main Components
• Data Source: The raw data is provided via churn_data.csv. This is the base dataset containing customer records.
• Data Exploration & Preprocessing: Components include Exploratory Data Analysis (usually performed in notebook.ipynb), handling missing values/outliers, encoding categorical variables (with one-hot and label encoding), and scaling numerical features (as indicated in the README).
• Feature Engineering: A module that selects important features through correlation analysis and feature importance metrics.
• Model Training: This module represents the training of multiple models (e.g., Logistic Regression, Decision Trees, Random Forest, SVM, KNN, XGBoost, CatBoost). It includes handling data imbalance using SMOTE and possibly iterating over various models. The catboost_info directory indicates additional logging or configuration for CatBoost training.
• Model Evaluation: Where the performance metrics (Accuracy, Precision, Recall, F1-Score, ROC-AUC) are calculated to determine the best model. The README mentions that Random Forest was determined to be best.
• Model Persistence: This is the stage of saving the trained model objects using pickle (as seen in the pickle directory, which houses the random_forest.pkl, label_encoder.pkl, scaler.pkl).
• Deployment: Represented by app.py, which likely loads the pickled model(s) to expose a web application for making predictions. The README also notes hosting on the Render cloud platform.
Relationships and Interactions
• The output is then fed into Feature Engineering and subsequently to the Model Training Pipeline, which branches to multiple models.
• An evaluation component collects the results of various models. Feedback here can help select the final model (in this case, Random Forest).
• The chosen model is serialized (saved via pickle) and then loaded by the Deployment component (app.py).
• How external libraries (e.g., CatBoost, scikit-learn, SMOTE) interact as part of the training modules.
Architectural Patterns and Technologies
• Modular Design: Each step (Data Preprocessing, Feature Engineering, Model Training, Evaluation, and Deployment) is separated into independent parts.
• Tools & Technologies: Include technologies like Python (app.py, notebook.ipynb), scikit-learn, CatBoost (with its own log via catboost_info folder), pickle for model persistence, and the Render cloud platform for deployment.
• Data Source (churn_data.csv)
• Data Exploration/Preprocessing (processes performed in notebook.ipynb and possibly parts of app.py if integrated)
• Feature Engineering
• Model Training (with a branch indicating multiple models including CatBoost, Random Forest, etc.)
• Model Evaluation (highlight metrics calculation)
• Model Persistence (pickle saving of models and encoders)
• Deployment (app.py showing the API/web app)
• External Services: Render cloud deployment