Logo Lanfrica

Dilikwy/Primary-Customer-Prediction

Domain:

socioeconomic

Record type:

project
Creator:
Dil
Host:
A customer analytics project that predicts which Ghana banking customers will become primary customers. It combines SQL data extraction, feature engineering, model training, and scoring. The final model segments customers into high, medium, and low priority for targeted decision-making. # Primary Customer Prediction This repository contains a customer analytics project focused on predicting which Ghana retail or business banking customers are likely to become primary customers. The working files live inside the `Primary Customer Prediction/` folder. ## Project Overview The project combines SQL-based data extraction, exploratory analysis, feature engineering, model training, and production-style scoring. The training workflow builds a binary `PRIMACY` target, compares several classification models, saves preprocessing assets, and produces reusable model artifacts for later scoring. ## Project Sections ### 1. Model Development Notebook File: `Primary Customer Prediction/Ghana_Primary_Customers_Prediction.ipynb` This is the main end-to-end notebook for the project. It: - pulls source data from banking tables - prepares the `PRIMACY` target - performs exploratory analysis and feature selection - compares models such as Logistic Regression, Random Forest, XGBoost, and LightGBM - calibrates and saves the final pipeline for reuse ### 2. Python Export Of The Notebook File: `Primary Customer Prediction/Ghana_Primary_Customers_Prediction.py` This script is the exported Python version of the notebook logic. It is useful when reviewing the workflow as plain code, tracking the modeling pipeline outside Jupyter, or reusing parts of the training workflow in a more script-friendly format. ### 3. Scoring Notebook File: `Primary Customer Prediction/Predicting Primary Customers_Scoring NOtebook.ipynb` This notebook applies the saved model artifacts to current customer data. It loads the trained pipeline, scores customers with `predict_proba`, and assigns likelihood segments such as high, medium, and low priority using saved threshold values. ### 4. SQL Extraction Script File: `Primary Customer Prediction/Primary_Customer Data Extraact.sql` This SQL file contains the base extraction queries used to pull customer activity and cross-sell data from inter …