image imagewidth (px) 540 868 |
|---|
YAML Metadata Warning:empty or missing yaml metadata in repo card
Check out the documentation for more information.
- 1. Project Goal
- 2. Dataset
- 3. Data Preparation
- 4. Global Visualizations
- 5. Research Questions, Plots, and Insights
- Question 1 – Is there a positive relationship between income and total spending?
- Question 2 – Does total spending differ across age groups?
- Question 3 – Do children in the household affect spending patterns?
- Question 4 – Does marital status influence total spending?
- Question 5 – Do customers spend very different amounts on different product types?
- Question 6 – Who responds to campaigns, and what characterizes them?
- Question 1 – Is there a positive relationship between income and total spending?
- 6. Overall Insights and Limitations
- 7. Presentation Video
Customer Personality Analysis – EDA Results
1. Project Goal
The goal of this project is to use numeric-focused Exploratory Data Analysis (EDA) on the Customer Personality Analysis dataset to understand:
- Which customer characteristics are associated with higher spending.
- How these characteristics differ between customers who responded to the last marketing campaign and those who did not.
The main outcome variable is:
Response(0 = no, 1 = yes) – did the customer respond to the last marketing campaign?
The analysis is oriented around the question:
Which types of customers are more likely to respond to a marketing campaign, and how do they spend their money?
2. Dataset
- Name: Customer Personality Analysis
- Source: Kaggle – https://www.kaggle.com/datasets/imakash3011/customer-personality-analysis
- Local file used:
marketing_campaign.csv - Size: ~2,240 rows, ~29 columns (mostly numeric)
2.1 Main Feature Groups
Demographics
Year_Birth, derivedAgeEducationMarital_StatusKidhome,Teenhome, derivedChildren_Total
Spending (last 2 years)
MntWines,MntFruits,MntMeatProductsMntFishProducts,MntSweetProducts,MntGoldProds- derived
Total_Spending= sum of all product-related amounts
Behavior / Engagement
RecencyNumDealsPurchasesNumWebPurchasesNumCatalogPurchasesNumStorePurchasesNumWebVisitsMonth
Campaign / Feedback
AcceptedCmp1–AcceptedCmp5ResponseComplainZ_CostContact,Z_Revenue
2.2 Derived Features Used in the Analysis
Age = 2014 - Year_BirthChildren_Total = Kidhome + TeenhomeTotal_Spending= sum of all product amounts- Clipped features to reduce the influence of extreme values:
Income_clippedTotal_Spending_clipped
3. Data Preparation
3.1 Data Overview
- The dataset was loaded from
marketing_campaign.csv(tab-separated). - A basic overview was performed using:
df.shapedf.info()df.head()
This confirmed that:
- The dataset is mostly numeric.
- A small amount of missing data exists (mainly in
Income). - No obvious structural issues appear.
3.2 Missing Values
- Missing values were checked with
df.isnull().sum(). - The only variable with a meaningful number of missing values was
Income. - Missing
Incomevalues were imputed using the median:- Median is more robust than the mean in a highly skewed distribution.
- After imputation,
Incomehad 0 missing values. - Other variables had either 0 or negligible missing values and were left as-is.
3.3 Type Fixing
Dt_Customerwas converted from string to datetime usingpd.to_datetime(..., dayfirst=True).- This enables time-based calculations if needed (e.g. customer tenure).
3.4 Duplicates
- Duplicate rows were checked using
df.duplicated().sum(). - Result: 0 duplicated rows → no rows were removed.
3.5 Outlier Handling
Outliers were examined mainly in:
IncomeTotal_Spending
Both were strongly right-skewed with very high extreme values.
Instead of removing customers, I used IQR-based clipping:
- Values below
Q1 − 1.5 × IQRwere set to the lower bound. - Values above
Q3 + 1.5 × IQRwere set to the upper bound.
This produced the features:
Income_clippedTotal_Spending_clipped
and kept all customers in the dataset while reducing the impact of extremes.
4. Global Visualizations
Before asking specific research questions, I created a few global plots to understand the overall distribution and relationships.
4.1 Income Distribution (clipped)
- Income remains right-skewed, even after clipping.
- Most customers are concentrated in the lower-to-middle income range.
- A small group of customers still have relatively high incomes.
4.2 Campaign Response Distribution
- The vast majority of customers have
Response = 0(no response). - Only a small minority responded to the last marketing campaign.
- This confirms that the target variable is imbalanced.
4.3 Correlation Heatmap – Selected Features
- There is a clear positive correlation between
Income_clippedandTotal_Spending_clipped. - Web, catalog and store purchases are positively correlated with each other and with total spending.
NumWebVisitsMonthis negatively correlated with purchases, suggesting that many visits without purchases may signal low engagement.Responsehas weaker but still informative correlations with spending and engagement features.
5. Research Questions, Plots, and Insights
Question 1 – Is there a positive relationship between income and total spending?
Insight:
There is a clear positive relationship between Income_clipped and Total_Spending_clipped.
Higher-income customers tend to spend more overall, even after clipping extreme values.
Not every high-income customer is a heavy spender, but heavy spenders are much more common in the higher income ranges.
Question 2 – Does total spending differ across age groups?
Insight:
The bar plot compares average Total_Spending_clipped between age groups.
- Middle-aged customers (around 40–59) show the highest average spending.
- Younger and older customers tend to spend less on average.
Age is therefore an important factor in understanding customer value.
Question 3 – Do children in the household affect spending patterns?
Insight:
- Households with fewer children (0–1) often have higher average spending.
- As the number of children increases, average spending per customer tends to decrease.
Family composition (number of children/teens at home) clearly influences how much customers spend.
Question 4 – Does marital status influence total spending?
Insight:
- The boxplot shows the distribution of
Total_Spending_clippedacross marital status categories. - Some groups (for example, customers in stable relationships) contain more heavy spenders and have higher medians.
- Other groups have lower median spending and narrower distributions.
Marital status captures differences in household structure and financial behavior that affect consumption.
Question 5 – Do customers spend very different amounts on different product types?
Insight:
- Spending is not equally distributed across product categories.
- A large share of total spending is concentrated in wines and meat products.
- Other categories (fruits, fish, sweets, gold products) account for a smaller share of total revenue.
This shows that a few product lines drive most of the revenue, which is important for marketing and stock decisions.
Question 6 – Who responds to campaigns, and what characterizes them?
Insight:
The grouped bar plot compares average values of:
Income_clippedTotal_Spending_clippedAgeChildren_Total
for customers who responded to the last campaign vs those who did not.
Overall, responders tend to:
- Have higher income on average.
- Have higher total spending.
- Show somewhat different age and family profiles.
Responders are therefore more valuable and more engaged customers.
6. Overall Insights and Limitations
6.1 Key Insights
- There is a strong link between income and total spending: higher-income customers are more likely to be heavy spenders.
- Age, marital status, and number of children are all related to spending behavior and can be used for customer segmentation.
- Spending is concentrated in a few product categories, especially wines and meat products.
- Customers who respond to marketing campaigns tend to be higher-value customers, with higher income and spending levels.
These insights can be used to:
- Design targeted marketing campaigns.
- Focus on high-value customer segments.
- Improve cross-selling and upselling strategies across product categories.
6.2 Limitations
- The data is cross-sectional and comes from a single company, so results may not generalize to other contexts.
- Campaign responses and complaints are relatively rare, which limits statistical power.
- Outlier handling and imputation were based on robust but simple rules (median imputation and IQR clipping) and were not tuned for predictive modeling.
Despite these limitations, the EDA provides a clear picture of who the most valuable customers are, how they spend their money, and which groups are most likely to respond to future campaigns.
7. Presentation Video
You can watch the 2–3 minute walkthrough of this project here:
[[Watch the presentation video]https://www.youtube.com/watch?v=TfhvzoJg2ds
- Downloads last month
- 103