Create and analyze customer segments with k-means clustering

“It may be necessary to stand on the outside of one is to see things clearly.”

― Peter Høeg, Tales of the Night


I believe that the best way to learn about marketing data science is to work through examples. In this blog post, I would like to talk about

  • Customer segmentation and why it is important to know
  • Building a k-means clustering model and choosing the optimal number of clusters with the Elbow method and the Silhouette coefficient
  • Interpretation of k-means clustering in the marketing context

Customer segmentation

Customer segmentation is the process of dividing customers into groups based on common…

Become more productive in visualizing data in Python

“Beauty will save the world.”

- F. Dostoevsky


Have you ever gotten frustrated after looking at your visualization in Python? Have you ever thought that it can be done better with less effort and time? If so, this post is perfect for you because I would like to share about the Altair library, which will boost your productivity and make your visualisations more appealing.

I suppose you already know how visualization is vital for any analysis and how it helps convey and translate an idea to a wider audience. Also, visualizing data is one of the first steps to explore…

Recency, Frequency, Monetary metrics to forecast customer behaviour with linear regression

“No person can open another person, all we can do is wait. And then work with the openness when it occurs.”
― Peter Høeg, The Quiet Girl


In this blog post, I would like to focus on feature engineering to predict customer transactions for the next month. As a data scientist working in marketing, I find it quite important to understand why I am doing some work and how it can solve a business problem. I think feature engineering is a part of an analysis where the domain knowledge and hard skills are equally important and blended to find a…

Apply multilayer perceptron model to retain your customers

“To be, or not to be, that is the question…”

- William Shakespeare, Hamlet


In real-world situations, data scientists often start an analysis with a simple and easy to implement model such as linear or logistic regression. There are various advantages of this approach such as getting a sense of the data with a minimum cost and giving food for thoughts on how to solve a business problem.

In this blog post, I decided to start from the opposite side by applying a multilayer perceptron model (neural network) to predict customer churn. …

All Customers are Not Equal

“It is the time you have wasted for your rose that makes your rose so important.”
― Antoine de Saint-Exupéry, The Little Prince


As a data scientist working in marketing, I find it quite challenging to combine a few fields like marketing, machine learning and statistics, and produce insights, which make sense. In this blog post, I want to show an application of machine learning in marketing, particularly, in defining and predicting Customer Lifetime Value (CLTV). …

Utilize patterns of reasoning, which are common across data science


In this part of the blog post, I would like to share with you how we can draw inspiration from patterns that have been noticed and explored by others to make logical reasoning. I believe that it is useful to gain a good mental library of various examples of reasoning to have a map to lead us to well-worn trails that take us where we need to go. I think this approach can be applied to analytics as well to optimize our decision-making process. But this is probably a topic for another blog post.

We will explore the following groups…

Learn about reasoning and components of an argument

“What has been affirmed without proof can also be denied without proof.”
― Euclid


I believe that every data scientist is aware of the necessity to have “soft-skills” and critical thinking, which have the same importance as an ability to write clean code and apply machine learning algorithms. That is why I decided to learn some approaches and frameworks from the social sciences to improve the quality of analyses I do. Particularly, I wanted to get to know more about arguments and patterns of reasoning. In the first part of the blog post, I would like to share with you…

CoNVO framework to structure and systematize our thoughts

“The only true wisdom is in knowing that you know nothing.“ — Socrates


Have you ever thought about how to pose the right questions while working on a data science project? I got this question after joining my current company, where I closely work with about 25 data scientists. I have noticed that some really great data scientists, apart from having strong “hard-skills”, are also good at asking questions. These great data scientists tend to attend to the problem of why and so what before diving into how.

Unleash new opportunities with data

Bringing new customers to a service is a common business problem, which can be solved by analyzing data of existing customers and the general population.

In this blog post, I would like to talk about how a company can bring new customers through customer segmentation and analyzing general population using supervised and unsupervised machine learning.

Outline of the post:

1. Explaining types of customer segmentation

2. Getting to know the data

3. Data cleaning

4. Data preprocessing

5. Applying k-means clustering to find segments within existing customers

6. Calculating Euclidean distances to find similar people in the general population

“Forewarned is forearmed” — English proverb

Short Intro

Some of my friends aspired by “the sexiest job in the 21st century” ask me how to enter the field and how to learn Data Science within less than one year as I did. I often start my answer with a few suggestions and following questions, which I want to share with all of you.

My name is Aigerim. I fell in love with Data Science while I was attending a presentation of an AI and ML circle at The University of Tokyo, where one of the post-docs was showing how to use Random Forest Classifier to solve a problem…

Aigerim Shopenova

Data Scientist @ Rakuten | 💜 Data Science and Psychology |

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store