Skip to content

misterseyiayeni/marketing-campaign-customer-segmentation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 

Repository files navigation

Marketing Campaign Analysis

Problem Definition

The Context

Why is this problem important to solve?

Customer segmentation is crucial because it allows businesses to better understand their customers, tailoring marketing strategies to different customer groups based on unique characteristics. This leads to improved customer engagement, increased sales, and optimized use of resources. Segmented campaigns can significantly boost click rates and overall revenue by targeting personalized communications and offerings.

The Objective

What is the intended goal?

The objective is to utilize unsupervised learning techniques such as dimensionality reduction and clustering to identify the best possible customer segments from the given dataset. This will enable more effective and efficient marketing strategies, ultimately enhancing return on investment (ROI).

The Key Questions

What are the key questions that need to be answered?

  1. What are the distinct customer segments within the dataset?
  2. What characteristics define each customer segment?
  3. How can these segments be leveraged to optimize marketing strategies?
  4. Which clustering method provides the most meaningful and actionable segments?

The Problem Formulation

What is it that we are trying to solve using data science?

We aim to solve the problem of understanding customer behavior and characteristics by dividing the customer dataset into meaningful segments. This involves analyzing customer profiles, campaign conversion rates, and engagement with marketing channels to create segments that can be targeted with tailored marketing strategies. The goal is to enhance marketing efficiency and improve ROI by effectively utilizing customer data.


Data Dictionary


The dataset contains the following features:

  1. ID: Unique ID of each customer
  2. Year_Birth: Customer’s year of birth
  3. Education: Customer's level of education
  4. Marital_Status: Customer's marital status
  5. Kidhome: Number of small children in customer's household
  6. Teenhome: Number of teenagers in customer's household
  7. Income: Customer's yearly household income in USD
  8. Recency: Number of days since the last purchase
  9. Dt_Customer: Date of customer's enrollment with the company
  10. MntFishProducts: The amount spent on fish products in the last 2 years
  11. MntMeatProducts: The amount spent on meat products in the last 2 years
  12. MntFruits: The amount spent on fruits products in the last 2 years
  13. MntSweetProducts: Amount spent on sweet products in the last 2 years
  14. MntWines: The amount spent on wine products in the last 2 years
  15. MntGoldProds: The amount spent on gold products in the last 2 years
  16. NumDealsPurchases: Number of purchases made with discount
  17. NumCatalogPurchases: Number of purchases made using a catalog (buying goods to be shipped through the mail)
  18. NumStorePurchases: Number of purchases made directly in stores
  19. NumWebPurchases: Number of purchases made through the company's website
  20. NumWebVisitsMonth: Number of visits to the company's website in the last month
  21. AcceptedCmp1: 1 if customer accepted the offer in the first campaign, 0 otherwise
  22. AcceptedCmp2: 1 if customer accepted the offer in the second campaign, 0 otherwise
  23. AcceptedCmp3: 1 if customer accepted the offer in the third campaign, 0 otherwise
  24. AcceptedCmp4: 1 if customer accepted the offer in the fourth campaign, 0 otherwise
  25. AcceptedCmp5: 1 if customer accepted the offer in the fifth campaign, 0 otherwise
  26. Response: 1 if customer accepted the offer in the last campaign, 0 otherwise
  27. Complain: 1 If the customer complained in the last 2 years, 0 otherwise

Assumption: The data is collected in the year 2016.

  • Histogram of Income (initial)

income_histogram_before

  • Histogram of Income (after outlier was dropped)

income_histogram_after

  • Histograms for other variables

wine_histogram

fruits_histogram

meat_histogram

products_histogram

sweet_histogram

gold_histogram

  • Bar Plot of Marital Status

marital_status_barplot

  • Heatmap (initial)

heatmap

  • Education vs Income Barplot

education_income_barplot

  • Marital Status vs Income Barplot

marital_status_income_barplot

  • Number of Kids at Home vs Income

numberofkids_income_barplot

  • Crosstab of Marital Status vs Number of Kids at Home

crosstab_maritalstatus_numofkids

  • Histogram of Age

age_histogram

  • Histogram of Amount per Purchase

amnoutperpurchase_distribution

  • Scatterplot of Income vs Expenses

  • expenses_income_scatterplot

  • Family Size vs Income

familysize_income_barplot

  • Heatmap (New)

heatmap_after

  • Scatterplot of t-SNE Clusters

t-SNE

  • Scatterplot of PCA Application

pca_application

  • KMeans Elbow Plot

K-Means_Elbow_Curve

  • Scatterplot of KMeans (3 Clusters)

kmeans_pca_clustering_3clusters

  • Boxplot of KMeans (3 Clusters)

boxplot_kmeans_3clusters

  • Scatterplot of KMeans (5 Clusters)

kmeans_pca_clustering_5clusters

  • Boxplot of KMeans (5 Clusters)

boxplot_kmeans_5clusters

  • Scatterplot of KMedoids (5 Clusters)

kmedoids_clustering_5clusters

  • Boxplot of KMedoids (5 Clusters)

boxplot_kmedoids_5clusters

  • Scatterplot of Hierarchical Clustering (3 segments)

hierarchical_clustering_3clusters

  • Boxplot of Hierarchical Clustering (3 segments)

boxplot_hierarchical_clustering_3clusters

  • Boxplot of DBSCAN

dbscan_pca

  • Scatterplot of Gaussian Mixture Model (5 Clusters)

gmmcluster

  • Boxplot of Gaussian Mixture Model (5 Clusters)

boxplot_gmm

Conclusion and Recommendations

1. Comparison of Various Techniques and Their Relative Performance

We evaluated multiple clustering techniques based on the silhouette score, which measures how similar an object is to its own cluster compared to other clusters. Here’s a comparison:

  1. K-Means:

    • For (n_clusters = 3): Silhouette score = 0.2694
    • For (n_clusters = 4): Silhouette score = 0.2547
    • For (n_clusters = 5): Silhouette score = 0.2337
    • For (n_clusters = 6): Silhouette score = 0.2186
    • Best score: K-Means with (n_clusters = 3), silhouette score = 0.2694
  2. K-Medoids:

    • Silhouette score for (k = 5): 0.1192
  3. DBSCAN:

    • (eps = 2), (min_samples = 6): Silhouette score = 0.1112
    • (eps = 2), (min_samples = 20): Silhouette score = 0.3385
    • (eps = 3), (min_samples = 6): Silhouette score = 0.2237
    • (eps = 3), (min_samples = 20): Silhouette score = 0.3382
    • Best score: DBSCAN with (eps = 2) and (min_samples = 20), silhouette score = 0.3385
  4. Gaussian Mixture Model (GMM):

    • (n_components = 5): Silhouette score = 0.1341

Performance Summary:

  • DBSCAN with (eps} = 2) and (text{min_samples} = 20 ) had the highest silhouette score (0.3385).
  • K-Means with (n_clusters = 3) provided a strong performance with a silhouette score of 0.2694.

Scope for Improvement:

  • Further tuning of DBSCAN parameters (eps and min_samples) could potentially improve performance.
  • Combining clustering methods or integrating domain-specific knowledge might yield better results.

2. Refined Insights

  • DBSCAN was highly effective in identifying well-separated clusters and managing noise points. This is beneficial for data sets with outliers or irregular cluster shapes.
  • K-Means showed solid performance, especially with 3 clusters, indicating that the data might naturally group into three distinct segments.
  • GMM provided a moderate performance, but offers the flexibility of soft clustering, where data points can belong to multiple clusters with different probabilities.

Key Insights:

  • The data contains clear subgroups that can be identified with proper parameter tuning.
  • Outlier detection is crucial for understanding the data's structure and should be integrated into the final solution.

3. Proposal for the Final Solution Design

Based on the analysis, I propose adopting DBSCAN with (text{eps} = 2) and (text{min_samples} = 20) for the following reasons:

  • Highest Silhouette Score: Achieved the best-defined clusters among the methods tested.
  • Flexibility: Effectively handles outliers and finds arbitrarily shaped clusters, making it versatile for various data structures.
  • No Need for K: Does not require specifying the number of clusters in advance, simplifying the clustering process.

Implementation Steps:

  1. Cluster the Data: Use DBSCAN with the optimal parameters to cluster the data.
  2. Visualize and Interpret: Create visualizations to understand the clusters and their characteristics.
  3. Validate: Ensure the clusters make sense in the context of the problem using domain-specific knowledge.

This combination of flexibility, performance, and ease of use makes DBSCAN the best solution for your clustering needs.

About

Marketing Campaign Analysis

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors