Supervised Machine Learning
Optimize Marketing Campaign strategy for an retail store by developing a direct-response model.
overview
This project is based on a marketing campaign dataset on Kaggle.
A retail store initiated five marketing campaigns, targeting all registered customers. The dataset encompasses individual records for each customer, indicating their response to those five marketing campaigns, demographic features, as well as the specifics of their purchases.
Suppose the cost to contact each of the customer is $3, and the avenue per sale is $11, then the total cost to contact all customers during the campaign is $6720, the neat revenue is -$3046, and the cost per sale (CPS) is $20.12.
Aim:
Help develop a more efficient strategy of marketing by increasing responses rate and/or reducing expenses.
Direct Response Marketing
is when an organization communicates directly to a preselected customer, who can then respond directly via a method specified by that organization.
A response model can provide a significant boost to the efficiency of a marketing campaign by increasing responses or reducing expenses. The objective is to predict who will respond to an offer for a product or service.
Data Cleaning
The dataset has 2240 datapoints, including three dimensions of data:
retailing related data, which describes the amount that the customer spent on each category of products, the frequency of purchase from each channel, as well as the total amount of complains in the past two years;
customer related data, including demographic features such as birthdate, income, education background and marital status;
campaign related features, which describes whether the customer response to the target campaign or any of the five former marketing campaign.
# Input the data df = pd.read_csv('./marketing_campaign.csv', sep=';') pd.set_option('display.max_columns', None) df.info() df.isnull().sum()
Check the descriptive information of the dataset and the missing value.
# Compare the mean and median of income. print(f'median of income: {df["Income"].median()}') print(f'average of income: {df["Income"].mean()}')
Noticed that there’re missing value in the '“income” column, then compare the mean and median of income.
Mean > median, the distribution is right skewed, and probabily have large outliers.
# Replace the missing value with median number. df = df.fillna(df["Income"].median()) # Check missing value again. df.isnull().sum()
To avoid the influence of outliers, replace the missing value with median number.
Check missing value again.
Exploring Features
& Visualization
Education Background & Acceptance of the Marketing Campaign
Pie Chart
There's more phD customers in receptor for the target campaign.
Might consider to take customers with higher educational background as major TA.
Marital Status & Online/Offline Purchase Times
Cross Tabulation & Heatmap
Some single customers are heavy Internet users.
Married customers and couples are more likely to shop in store.
Distribution of Length of Membership
Accept v.s. Reject
Customers who accepted the target campaign tend to have longer history of visiting the store.
Might consider to take customers with higher educational background as major TA.
Supervised Machine Learning Model
Predict the performance for marketing campaigns
11 models were designed to predict whether a customer would response to the target campaign, including Naïve Bayesian, logistic regression, decision tree, random forest, Support vector machine (SVM) and k-NN.
Since one of the aims of this project is to improve the response rate to the target campaign, the true positive rate (TPR) was used to evaluate the models rather than accuracy.
Result & Recommendation
Monitored marketing strategies applied.
About 60% of the customers selected by the Naïve Bayesian model are expected to response to the target campaign.
However, the Naïve Bayesian classifier identified more target audience of the target campaign than other models did, which leads to higher cost of marketing.
After the marketing strategies applied, the linear SVM classifier competed the Naïve Bayesian classifier for it has the lowest total cost ($183) and the lowest CPS ($4.07).
The k-NN classifier where k=1 also worth an attention for it resulted to the highest neat revenue of $562.
Original Strategy
Customer reached: 2240
Cost for the strategy: $6720
Revenue for the strategy: $3674
Neat revenue for the strategy: $-3046
Cost per sale: $20.11976
V.S.
K-NN Classifier (k=1)
Customer reached: 227
Cost for the strategy: $681.0
Revenue for the strategy: $1243.0
Neat revenue for the strategy: $562.0
Cost per sale: $6.02655
Linear SVM Classifier
Customer reached: 61.0
Cost for the strategy: $183.0
Revenue for the strategy: $495.0
Neat revenue for the strategy: $312.0
Cost per sale: $4.06667
The optimized marketing strategy, which targets customers using a predictive model, outperforms the original approach of reaching out to all customers.
Response Rate, increasing from 15% to 47%.
Net revenue, soaring from a deficit of $-3,046 to a positive $562.
marketing costs, dropping from $6,720 to $681.
Cost Per Sale (CPS), plummeting from $20.12 to just $6.03.
Want more details?
Explore the full versions of the results in slides, or the original code for a comprehensive view.
Delving into the details is always a pleasure.