Data Analyst Project: Business Decision Research
Tags: Logistic Regression

1. Introduction

“ABC” is the sports store. ABC selles various product as jeans, shirts, bags, and shoes. ABC has sold since 2013 so that it has regular customers and keep trying to increase the new customers.

In 2019, customers are decreasing. The manager asks junior data analyst to process the data company. Customers is churn, if there is no transaction in 6 months before the last transaction of overall data.

2. Data

Data consists of 100000 rows and 8 columns. There are no, row_num, customer_id, product, first_transaction, last_transaction, average_transaction_amount, count_transaction as columns. Get the data from https://dqlab-dataset.s3-ap-southeast-1.amazonaws.com/data_retail.csv.

Figure 1. Data Overview

First_Transaction and Last_Transaction changed to date time type.

3. Method

3.1 Determine the customers is churn or not churn.

Last transaction of overall data is February 2019, It is means customers called churn if last_transaction less than or equal to August 2018. Customers churn and not churn as much 66569 and 33431.

3.2 Exploration Data

Figure 2. Customer acquisition by year first transaction

From 2013 to 2017, customer was increased. Start from 2018 to 2019, customer was decreased. In 2019, the decrease is significant.

Figure 3. Transaction Customer by year first transaction

Most transaction occur in 2015 and 2017 and the percentage is same. If compare with Figure 2, 2017 is year with significant increase and has difference so far with 2015. This shows increase in customers not effect to transaction.

Figure 4. Average transaction amount by year

From year to year, products are bought by customers is various. In every year, shoes is sells. Shirts and bag sold begin 2017 to 2019.

Figure 5. Proportion churn by product

In overall, proportion churn by product is high because the proportion more than 60%. Products are same, it is proportion churn higher than not churn.

Figure 6. Customer distribution by count transaction group

Count transaction was grouped by 5 intervals. If count transaction equal 1, category of the count transaction is ‘1.1'. If count transaction between 2 to 3 , category of the count transaction is ‘2.2–3’. If count transaction between 4 to 6 , category of the count transaction is ‘3.4–6’. If count transaction between 7 to 10 , category of the count transaction is ‘4.7–10’. If count transaction more than 10 , category of the count transaction is ‘5.>10’. Based on figure 5, Customers buys product with one transaction is highest, it is achieve to 50000.

Figure 7. Customer distribution by average transaction amount group

Average transaction was grouped by 8 intervals. The intervals is described by Figure 8.

Figure 8. Intervals of average transaction

The biggest average transaction in fifth intervals. It is means the biggest average transaction between 1000000 to 2500000.

3.3 Modeling

3.3.1 Feature columns and target

Average transaction, count transaction, and year difference (last transaction — first transaction) are predictor (x variables), while the ‘is_churn’ as responds (y variable).

3.3.2 Split data

Data be divided into two parts, there are train data and test data. Percetage the test data is 25% of the overall data.

3.3.3 Built the model with train data

The model is built with logistic regression because measurement scale of the respond is binary.

3.3.4 Evaluation model with confusion matrix

Figure 9. Confusion matrix

Based on figure 9, model has good performance to predict customers not churn, but the performance to predict customers churn is very bad because

the only one customer churn can be predicted correctly.

4. Conclusion

The predictive ability of the model needs to be improved. There are several ways that can be done: (1) Tuning parameter (2) Apply the cross validation. In logistic regression, the cross validation is possible to apply.