Arvato Bertelsmann Customer Analysis
By: Mei Eisenbach
Tags: Customer Segmentation, Supervised Learning, Machine Learning, Marketing Analysis, Unsupervised Learning

Introduction

In this project, demographics data for customers of a mail-order sales company in Germany, was analyzed and compared against demographics information for the general population. The data was provided Bertelsmann Arvato Analytics.

Customer segmentation was used to identify the parts of the population that best describe the core customer base of the company. In the second part of the analysis, a dataset with demographics information for targets of a marketing campaign for the company was used to model and predict which individuals are most likely to convert into becoming customers for the company.

For the customer segmentation, average within-cluster distance was used to help determine the number of clusters to produce. The clusters were then analyzed and evaluated on how informative they are on the customer base. For the marketing campaign, the predictions were tuned locally using roc-auc and final scoring was done by uploading to the Kaggle competition.

Customer Segmentation — Analysis

Data files:

Udacity_AZDIAS_052018.csv: Demographics data for the general population of Germany; 891 211 persons (rows) x 366 features (columns).

Udacity_CUSTOMERS_052018.csv: Demographics data for customers of a mail-order company; 191 652 persons (rows) x 369 features (columns).

Along with the data, two files describing the data were provided:

DIAS Attributes — Values 2017.xlsx: a data dictionary of the columns including description, possible values, and what the values mean.

DIAS Information Levels — Attributes 2017.xlsx: indicates the information level for each column (Person, Household, Building, etc)

Using the two description files, features.csv was manually created containing the attribute, information level, data type, missing or unknown values.

Missing Features

39 features were in the demographics data that were not described in the data dictionary. These were dropped from the customer segmentation datasets. 5 features were in the data dictionary but were not in the data. Ideally, we would have gone back to the company and asked for clarification.

Missing Values

The population data was analyzed for missing values. The first step was to convert missing values to Nan’s using the feature information data.

Missing values by column

Most columns have less than 20% missing values so this was set as the threshold. The names of the columns to be dropped were saved to a list and the columns were dropped from the population data.

Missing values by row

Most rows have less than 25 missing values.

Zooming in to see the counts for less than 50 missing, we see that 10 is a good threshold.

Customer Segmentation — Methodology

Data Cleaning

A data cleaning script was created which performed the following items.

Missing Values

Columns with greater than 20% missing were dropped

Rows with greater than 10 missing values were dropped

Re-encoding and Engineered Features

Columns starting with D19_: 10’s (no transactions) were re-coded as 0’s (no transactions). Only some of the D19 columns had 10’s. Re-coding was done to be consistent with the other D19 columns.

OST_WEST_KZ was dummy encoded

PRAEGENDE_JUGENDJAHRE was split in decade and movement

CAMEO_INTL_2015 was split into wealth and life_stage

Dropped features

Features not found in the data dictionary

CAMEO_DEU_2015, LP_FAMILIE_FEIN, LP_STATUS_FEIN were dropped since the information was also in the _GROB (rough) versions of the the feature.

KBA_ variables were dropped because they caused problems with PCA

For the clustering task, it was import that all the features were well understood so that the clusters could be interpreted. For this reason columns not found in the given data dictionary were dropped.

Data Preprocessing

The data was imputed using the median to remove any remaining missing values and scaled.

PCA

Principal Component Analysis (PCA) was performed because of the large number of features and the fact that many of them provide almost the same information. For the customer segmentation task, a clustering algorithm will be used and they run very slowly with large numbers of features.

From the cumulative variance explained graph, it was determined that at 90% the gain in explained variance levels off. This occurs at 76 principal components.

PCA Interpretation

First principal component

The first principal component accounts for 11.67% of the variance explained.

Highest weighted features:

D19_VERSAND_ANZ_24 is transaction activity MAIL-ORDER in the last 12 months (6 = very high activity)

ONLINE_AFFINITAET is online affinity (5 = highest)

D19_GESAMT_ANZ_24 is mail-order transaction activity TOTAL POOL in the last 24 months (6 = very high activity)

Lowest weighted features:

HH_EINKOMMEN_SCORE is estimated household net income (1 = highest income group)

CAMEO_DEUG_2015 is CAMEO major classification 2015 (1 = upper class)

wealth was derived from CAMEO_INTL_2015 (1 = wealthy)

This component is an indicator of purchasing activity and wealth. Note, the indicators for wealth are all inverted with 1 indicating highest wealth.

Second principal component

The second principal component accounts for 7.97% of the variance explained.

Highest weighted features:

SEMIO_REL is affinity indicating in what way the person is religious (1 = highest affinity)

decade was derived from PRAEGENDE_JUGENDJAHRE (1 = 40’s, 15 = 90's)

FINANZ_SPARER is financial typology: money saver (1 = very high)

Lowest weighted features:

ALTERSKATEGORIE_GROB is age major category (4 = > 60 years)

FINANZ_VORSORGER is financial typology: be prepared (1 = very high)

FINANZ_MINIMALIST is financial typology: low financial interest (1 = very high)

This component is a an indicator of lack of religiousness, youth, free spending.

Third principal component

The Third principal component accounts for 5.65% of the variance explained.

Highest:

EWDICHTE is population density (6 = densest)

PLZ8_ANTG3 is number of 6–10 family houses in the zipcode (3 = high share)

ORTSGR_KLS9 is size of the community, classified number of inhabitants (9 = > 700.000 inhabitants)

Lowest:

SEMIO_KULT is affinity indicating in what way the person is cultural minded (1 = highest affinity)

SEMIO_REL is affinity indicating in what way the person is religious (1 = highest affinity)

PLZ8_ANTG1 is number of 1–2 family houses in the zipcode (3 = high share)

This component is an indicator of population density and cultural minded/religiousness.

Implementation

Clustering using k-means

To determine the optimal number of clusters, the elbow method was used. The average within-cluster distance across variance k clusters were calculated and plotted. It was determined that 8 clusters would be a good starting point.

Refinement

Clustering Pipeline

At this point, the preprocessing (imputation and scaling), pca, and estimator were combined into a pipeline. The benefit of a pipeline is that it saves the preprocessing objects with the model.

Cluster Comparison

The clustering pipeline was fitted on the population data and then used to cluster the population and customer data.

Starting with 8 clusters, it was found that one cluster was overrepresented in the customer data. It was suspected that some of the clusters could be combined without losing information. Unfortunately, the dataset is too large to use a hierarchical cluster algorithm. With that type of algorithm, you are able to see which groups merge as the number of clusters decreases.

At 6 clusters, there were also one overrepresented cluster. There are three under-represented clusters.

At 5 clusters, you can see that there is one overrepresented group and two underrepresented groups in the customer data.

Customer Segmentation — Results

Cluster Analysis

A heatmap of the clusters and their PCA values shows that at five clusters the clusters are easily distinguishable from one another using the first three PCA components.

PCA summary of first three values

PCA 0 is an indicator of purchasing activity and wealth

PCA 1 is a indicator of lack of religiousness, youth, free spending

PCA 2 is an indicator of population density and urban-ness

Cluster 4: overrepresented

PCA values: 1.46352879, -3.49229666, -0.74227797

The most distinguishing feature of Cluster 4 is the very low value for pca 1. This indicates this cluster is more religious, older and savers. It also as a positive value for pca 0 which is an indicator of purchasing activity and wealth.

Cluster 0: underrepresented

PCA values: -3.01992766, 4.10241541, 0.57541029

Cluster 0 has a very low value for pca0 and a very high value for pca1. This cluster has low purchasing activity and wealth. They are also not very religious but are young and free spending.

Cluster 1: also underrepresented

PCA values: -0.84571908, 1.06199565, -3.32130468

For cluster 1, the most distinguishing feature is the very low pca2 value. This cluster has low population density and cultural minded/religiousness.

Evaluation

Metrics for unsupervised learning algorithms are not as clear-cut as for supervised learning model and are dependent on the goal of the analysis.

Here we are attempting to separate groups of individuals which are more likely to be customers so it’s important for the clusters to show differences in the clusters between the population data and customer data. From the cluster comparison charts, it was clear which clusters were over-represented and which ones were under-represented.

Additionally, the clusters should be easily distinguishable from one another. Using only the first three principal components, each of the five clusters can be identified based on whether the values are higher or lower the average.

Clustering Marketing Data

The clustering model developed in the previous section was applied to the mailout data. The thought was that perhaps the response rate would be higher in the overrepresented group. The clustering pipeline which includes pca and creates 5 clusters was used to cluster the training data with the response variable removed.

The response rate for cluster 4 was 1.4% which is higher than all the other clusters and higher than the overall response rate of 1.2%. The difference in response rate would not enough to predict marketing responses. This strategy was then abandoned.

It’s interesting to note the distribution of individuals chosen for the marketing campaign seem to agree mostly with the results of the segmentation analysis. 37.3% of the marketing campaign individuals were Cluster 4. This cluster is overrepresented in the customer data as compared to the population and are more likely to become customers. Only 1.8% of the campaign individuals were from Cluster 0, one of the underrepresented clusters.