Learn practical skills, build real-world projects, and advance your career
# This Python 3 environment comes with many helpful analytics libraries installed
# It is defined by the kaggle/python Docker image: https://github.com/kaggle/docker-python
# For example, here's several helpful packages to load

import numpy as np # linear algebra
import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)

# Input data files are available in the read-only "../input/" directory
# For example, running this (by clicking run or pressing Shift+Enter) will list all files under the input directory

import os
for dirname, _, filenames in os.walk('/kaggle/input'):
    for filename in filenames:
        print(os.path.join(dirname, filename))

# You can write up to 5GB to the current directory (/kaggle/working/) that gets preserved as output when you create a version using "Save & Run All" 
# You can also write temporary files to /kaggle/temp/, but they won't be saved outside of the current session
/kaggle/input/credit-card-segmentation/CC GENERAL.csv /kaggle/input/credit-card-segmentation/Credit Card Segmentation.ipynb /kaggle/input/credit-card-segmentation/CREDIT CARD - SEGMENTATION CASE STUDY.pdf

The goal of this project is to leverage AI/ ML model to segment customers for launching a specific targeted Ad-campaign. To make it successful, we have to segment them in at-least 3 distinct groups known as "marketing segmentation". It will help to maximize the marketing campaign conversion rate. For example the general four segments are:

  1. Transactors: Customers who pay least amount of interest and very careful with the money. Generally they have lower balance(USD 104), cash advance (USD 303) and perecnt of full paymenet = 23%
  2. Revolvers : (Most lucrative sector) use credit card as a loan, generally they have highest balance (USD 5000), cash advance (USD 5000), low purchase frequency, high cash advance frequency (0.5), high cash advance transactions (16).
  3. VIP/Prime : (This group is specific target to increase credit limit and spend habbit) High credit limit (USD 16K), high percentage of full payment.
  4. Low Tenure: Low tenure (7 Years), low balance.

The steps performed in this task are:

  1. Visualize and explore datasets
  2. Scikit-Learn library to find the optimal number of clusters using elbow method
  3. k-means using Scikit-Learn to perform customer segmentation
  4. Principal Component Analysis (PCA) technique to perform dimensionality reduction and data visualization

Note: This notebook will be updated with the passage of time. Your feedback will be highly appreciated. Please upvote, if you like it and find it helpful. Your support in terms of upvote and positive feedback will keep me motivated :)

# import libraries
import seaborn as sns
import matplotlib.pyplot as plt
from sklearn.preprocessing import StandardScaler, normalize
from sklearn.cluster import KMeans
from sklearn.decomposition import PCA