Analyzing Credit Card Purchase Patterns Using Clustering (2024)

Using the various clustering models to assess patterns in Credit Card purchases and then make recommendations for the client

Analyzing Credit Card Purchase Patterns Using Clustering (3)

Introduction to the Problem

Before diving head-on into the various clustering methods, let us take a short look at the problem we are trying to solve here. A credit card company has, over time, supported data about the various customers it possesses. The company collected data about various facts related to the customers, such as their balances, purchases, cash advances, credit line, etc. The team was tasked to make meaningful insights from the data, and then devise strategies using which the company can target customers and increase credit card sales, and it in turn revenue.

After drawing a brief dataset description, we notice that the data looks like this:

Analyzing Credit Card Purchase Patterns Using Clustering (4)

We start by analyzing various clustering methods and then will provide our recommendations to the clients. Let’s first take a brief look into clustering and K-Means.

Introduction to Clustering

Clustering is the task of grouping a set of objects in such a way that objects in the same group (called a cluster) are more similar (in some sense) to each other than to those in other groups (clusters). Clustering deals with grouping of data where a pair of similar data points are placed in the same cluster. So, the notion of similarity of matching between data points plays an important role in clustering. Clustering is flat or hierarchical and is implemented in Python using scikit-learn’s cluster package (sklearn.cluster).
Flat Clustering divides the posts into a set of clusters without relating the clusters to each other. The goal is to create clusters that are similar within itself, and dissimilar from others. In hierarchical clustering, the number of clusters does not need to be specified beforehand but instead depends on the dendrogram plot. There is a hierarchy of clusters that are created.

Let’s implement the K-Means clustering method first, and then assess what can be the recommendations.

K-Means Clustering

As noted above, K-Means clustering is a type of flat clustering where we can initialize the model with a set number of clusters. The K-Means model works by choosing k centroids and then groups the data points based on minimum data points, and then reposition the centroids until convergence is achieved, provided the clusters are stable.

Analyzing Credit Card Purchase Patterns Using Clustering (5)

Let’s now make an Elbow plot to assess what an optimal number of clusters should be. Elbow plot, also called the Scree plot, is a plot that gives information about the clusters. The Elbow plot:

Analyzing Credit Card Purchase Patterns Using Clustering (6)

So, looking at the plot above, we assume that the best number of clusters for our analysis would be 4. Now, using 4 clusters, and applying K-Means clustering, our result turns out to be:

Analyzing Credit Card Purchase Patterns Using Clustering (7)

For the above K-Means clustering, we used the initialization method as Random. The problem with Random Initialization is that, with each run, the within-cluster sum of squares changes, since the centroids are chosen at random. This is called the Random Initialization Trap and should be avoided. To avoid this, simply use the k-means++ initialization method, which uses fixed points as centroids and hence gives better results.

Analyzing Credit Card Purchase Patterns Using Clustering (8)

A visualization for clustering which uses K-Means init method is as given below:

Analyzing Credit Card Purchase Patterns Using Clustering (9)

We can see that the K-Means++ initialization method does work better than the random init method.

Hierarchical Clustering

Moving on to other types of clustering methods, we can observe the Hierarchical clustering method. This method does not need clusters to be specified before-hand and rather chooses its clusters by using dendrograms. A dendrogram is a plot that tells about the way the clusters are distributed. A hierarchical clustering begins with each data point in its cluster and goes on combining the clusters until a single cluster is reached. To stop a single cluster from being formed, though, a dendrogram criterion is generally used which takes the longest edge that does not cross a horizontal line as the minimum distance criterion. Any cluster that crosses this line will be chosen in the final model.

A point to note here is that the K-Means cluster aims at reducing the distance, while Hierarchical Clustering tries to reduce the variance in the clusters. Therefore, HC provide better and sharper clusters, though they are suboptimal because they are not separated by distance.

Analyzing Credit Card Purchase Patterns Using Clustering (10)

Hierarchical Clustering can be implemented in python by using AgglomerativeClustering() from the scikit-learn.cluster package. The dendrogram for our analysis looks like:

Analyzing Credit Card Purchase Patterns Using Clustering (11)

From above, we know that we can choose the number of clusters to be 3. After doing so, and fitting the above method, we can observe that the clusters look like:

Analyzing Credit Card Purchase Patterns Using Clustering (12)

Density-Based Clustering

Density-based clustering methods are based on distributing points according to the various densities of the clusters. DBScan Clustering is a clustering method that uses Density-based methods rather than distance-based clustering in K-Means and HC. The full name of DBSCAN is Density-Based Spatial Clustering of Applications with Noise. Upon fitting the DBSCAN method to the credit card dataset and then visualizing the clusters, we get:

Analyzing Credit Card Purchase Patterns Using Clustering (13)

Upon looking at the analysis by DBSCAN above, it was observed with more clarity that the clusters have a more non-linear shape in this, and hence, these types of clustering methods should be used when the data is not linearly separable.

Marketing Insights from Data

The following can be some inputs for marketing strategies:

High Balance, High Purchase — These people made expensive purchases but they also had higher balances to support these purchases. They also made large payments and can be the target for market research.

High Balance, Low Purchase (Higher purchase values)- These are the people who had higher balances but made lower purchases and have medium or high credit limits and took out large cash advances.

Medium Balance, Medium Purchase — These customers did not have low or high balances and they also did not make big or small purchases but they did everything at a medium level.

Frugal Customers (low balance, low purchase) — These are the customers that made the smallest purchases and since their credit limit was also low, this means that the customers did not make these purchases frequently. Therefore, it can be assumed that these customers churned out, and marketing strategies can be devised to reduce this churn.

So a marketing strategy that looked at the four groups can be highly effective to solve the problem.

Pros and Cons of Clustering Methods

K-Means: These methods are simple to understand, easily adaptable, and they work well on small or large datasets but we need to choose the number of clusters

HC Agglomerative Clustering: The optimal number of clusters in these can be obtained by the model itself, and there can be a practical visualization with the dendrogram but the model is not appropriate for large datasets.’

Please find the full implementation of this project on my Github here.

Analyzing Credit Card Purchase Patterns Using Clustering (2024)

FAQs

What does the result of clustering cardholders reveal about their behavior? ›

By using clustering algorithms and dimensionality reduction techniques, you can identify patterns and relationships in customer data and predict customer spending and purchasing traits based on their behavior and characteristics.

What are the three major steps in cluster analysis? ›

Two-step clustering can handle scale and ordinal data in the same model, and it automatically selects the number of clusters. The hierarchical cluster analysis follows three basic steps: 1) calculate the distances, 2) link the clusters, and 3) choose a solution by selecting the right number of clusters.

What is cluster analysis in pattern recognition? ›

Cluster analysis foundations rely on one of the most fundamental, simple and very often unnoticed ways (or methods) of understanding and learning, which is grouping “objects” into “similar” groups. This process includes a number of different algorithms and methods to make clusters of a similar kind.

What are the drawbacks of cluster analysis? ›

An obvious drawback to cluster analysis is the level of overlap between clusters. Clusters close in distance, meaning a high correlation in returns, often share some similar risk factors. Thus, a down day in one cluster could translate to an equally weak performance in another cluster.

How to interpret clustering results? ›

Some tips to interpret clustering results- Visualize the clusters: Use scatter plots, heatmaps, or dendrograms to visualize the distribution of data points within clusters. Validate cluster quality: Assess the quality of clusters using metrics like silhouette score, purity, or Rand index.

What is cluster analysis in consumer behavior? ›

Cluster analysis provides a data-driven approach to identifying distinct customer groups based on shared characteristics or behaviors. Cluster analysis can contribute to enhancing customer segmentation in the following ways: Providing more personalized products and messaging.

What is the main purpose of clustering? ›

Clustering is used to identify groups of similar objects in datasets with two or more variable quantities. In practice, this data may be collected from marketing, biomedical, or geospatial databases, among many other places.

What are some of the key benefits of clustering? ›

  • Overview of Clustering. Benefits of Clustering. ...
  • Improving Response Time: Caching.
  • Scheduling Jobs and Administrative Tasks.
  • Administering MicroStrategy Web and Mobile.
  • Combining Administrative Tasks with System Manager.
  • Automating Administrative Tasks with Command Manager.
  • Enterprise Manager Data Dictionary.

How to visualize clustering results? ›

Cluster visualization techniques (scatterplots, heatmaps, dendrograms) You can also use various data visualizations to interpret your cluster analysis results. Scatterplots can help you visualize the data points and their assigned cluster labels by showing you the grouping patterns and the separation between clusters.

How to assess clustering results? ›

The silhouette method provides a measure of how similar the data is to the assigned cluster as compared to other clusters. This is computed by calculating the silhouette value for each data point, and then averaging the result across the entire data set.

What is a real life example of clustering? ›

Some specific examples of clustering: The Hertzsprung-Russell diagram shows clusters of stars when plotted by luminosity and temperature. Gene sequencing that shows previously unknown genetic similarities and dissimilarities between species has led to the revision of taxonomies previously based on appearances.

What is the difference between pattern recognition and clustering? ›

While pattern recognition techniques require that the number and labels of categories are known, clustering techniques are unsupervised, requiring no external knowledge of categories.

What is an example of using cluster analysis? ›

Cluster analysis can be a powerful data-mining tool for any organisation that needs to identify discrete groups of customers, sales transactions, or other types of behaviours and things. For example, insurance providers use cluster analysis to detect fraudulent claims, and banks use it for credit scoring.

How do you evaluate clustering results? ›

It is essential to execute the clustering technique repeatedly using multiple random initializations or settings in order to judge the sustainability of the clustering findings. One can evaluate the stability of the clustering results using metrics such as the Jaccard index or the variance of information.

How do you analyze cluster samples? ›

A good analysis of survey data from a cluster sample includes seven steps:
  1. Estimate a population parameter.
  2. Compute sample variance within each cluster (for two-stage cluster sampling).
  3. Compute standard error.
  4. Specify a confidence level.
  5. Find the critical value (often a z-score or a t-score).
  6. Compute margin of error.

How do you Analyse Kmeans clustering? ›

Interpreting the meaning of k-means clusters boils down to characterizing the clusters. A Parallel Coordinates Plot allows us to see how individual data points sit across all variables. By looking at how the values for each variable compare across clusters, we can get a sense of what each cluster represents.

Top Articles
PIP Mandatory Reconsideration: what you need to know
Highlighting – Learning Center
Devin Mansen Obituary
Nybe Business Id
English Bulldog Puppies For Sale Under 1000 In Florida
Santa Clara College Confidential
Hertz Car Rental Partnership | Uber
Dr Lisa Jones Dvm Married
Nation Hearing Near Me
Imbigswoo
Tugboat Information
Yesteryear Autos Slang
Hillside Funeral Home Washington Nc Obituaries
Oppenheimer Showtimes Near Cinemark Denton
Bcbs Prefix List Phone Numbers
Houses and Apartments For Rent in Maastricht
Simpsons Tapped Out Road To Riches
Roll Out Gutter Extensions Lowe's
Equibase | International Results
Plan Z - Nazi Shipbuilding Plans
Odfl4Us Driver Login
Sussur Bloom locations and uses in Baldur's Gate 3
8005607994
Weldmotor Vehicle.com
3Movierulz
Breckiehill Shower Cucumber
Is Henry Dicarlo Leaving Ktla
Big Boobs Indian Photos
Memberweb Bw
Www Craigslist Com Shreveport Louisiana
Tamilrockers Movies 2023 Download
Black Adam Showtimes Near Amc Deptford 8
Soulstone Survivors Igg
450 Miles Away From Me
8 Ball Pool Unblocked Cool Math Games
Oxford House Peoria Il
Encompass.myisolved
Busted Newspaper Campbell County KY Arrests
Henry Ford’s Greatest Achievements and Inventions - World History Edu
Craigslist - Pets for Sale or Adoption in Hawley, PA
Discover Things To Do In Lubbock
Nail Salon Open On Monday Near Me
Quick Base Dcps
Cleveland Save 25% - Lighthouse Immersive Studios | Buy Tickets
705 Us 74 Bus Rockingham Nc
Copd Active Learning Template
15 Best Places to Visit in the Northeast During Summer
VerTRIO Comfort MHR 1800 - 3 Standen Elektrische Kachel - Hoog Capaciteit Carbon... | bol
2294141287
A jovem que batizou lei após ser sequestrada por 'amigo virtual'
Who uses the Fandom Wiki anymore?
Bunbrat
Latest Posts
Article information

Author: Ouida Strosin DO

Last Updated:

Views: 6143

Rating: 4.6 / 5 (76 voted)

Reviews: 83% of readers found this page helpful

Author information

Name: Ouida Strosin DO

Birthday: 1995-04-27

Address: Suite 927 930 Kilback Radial, Candidaville, TN 87795

Phone: +8561498978366

Job: Legacy Manufacturing Specialist

Hobby: Singing, Mountain biking, Water sports, Water sports, Taxidermy, Polo, Pet

Introduction: My name is Ouida Strosin DO, I am a precious, combative, spotless, modern, spotless, beautiful, precious person who loves writing and wants to share my knowledge and understanding with you.