1. Introduction to cohort analysis
Hi there, welcome to this course on Customer Segmentation in Python! It is a powerful analytics technique to group customers and enable the business to customize their product offering and marketing strategy. For example, we can group the customers by the month of the first purchase, segment by their recency, frequency and monetary values or run k-means clustering to identify similar groups of customers based on their purchasing behavior. You will dig deeper into customer purchasing habits and uncover actionable insights.
2. About me
First, a little bit about me.
I am currently leading a data science team for Amazon Devices - understanding behavior of Amazon Echo, Kindle, FireTV and FireTablets customers.
I have been working in the data analytics world for over 10 years
and had experience in e-commerce, banking, consulting, finance and other industries.
3. Prerequisites
To get the most out of this course you should be able to
manipulate data in Python with the pandas library
have a basic level of understanding how to manipulate datetime objects
have a decent foundation on plotting in Python, with either matplotlib or seaborn packages
and have some experience with unsupervised learning, specifically with kmeans clustering
We will cover some of the in the class but we expect that you have some knowledge of each in order to learn the most from this course.
4. What is cohort analysis?
Cohort analysis is a descriptive analytics tool. It groups the customers into mutually exclusive cohorts - which are then measured over time.
Cohort analysis provides deeper insights than the so-called vanity metrics. It helps with understanding the high level trends better by providing insights on metrics across both the product and the customer lifecycle.
5. Types of cohorts
There are tree major types of cohorts.
Time cohorts are customers who signed up for a product or service during a particular time frame. Analyzing these cohorts shows the customers’ behavior depending on the time they started using the company’s products or services. The time may be monthly or quarterly, even daily.
Behavior cohorts are customers who purchased a product or subscribed to a service in the past. It groups customers by the type of product or service they signed up. Customers who signed up for basic level services might have different needs than those who signed up for advanced services. Understanding the needs of the various cohorts can help a company design custom-made services or products for particular segments.
Size cohorts refer to the various sizes of customers who purchase company’s products or services. This categorization can be based on the amount of spending in some period of time after acquisition, or the product type that the customer spent most of their order amount in some period of time.
Now, let's look at the main elements of the cohort analysis.
6. Elements of cohort analysis
The cohort analysis data is typically formatted as a pivot table.
7. Elements of cohort analysis
The row values represent the cohort. In this case it's the month of the first purchase and customers are pooled into these groups based on their first ever purchase.
8. Elements of cohort analysis
The column values represent months since acquisition. It can be measured in other time periods like months, days, even hours or minutes. That depends on the scope of the analysis.
9. Elements of cohort analysis
Finally, the metrics are in the table. Here, we have the count of active customers. The first column with cohort index "one" represents the total number of customers in that cohort. This is the month of their first transaction. We will use this data in the next lessons to calculate the retention rate and other metrics.
10. Elements of cohort analysis
Let's look at the table - we can see that the first cohort was acquired in December 2010, and there are 715 customers in it.
11. Elements of cohort analysis
This value here suggests that the last date we're working with is from December 2011, and there are 38 customers in this cohort.
12. Explore the cohort table
Now, let's explore the cohort table with customer counts to get familiar with the data format.