Level Based Persona and Segmentation

In this article, we will do a simple rule-based segmentation study using only pandas functions without using machine learning.

We will create new customer definitions (level-based persona) by using the user information we have and the information about the purchases made by the users. Then, we will try to predict which segment a new person will be with these customer definitions we created.

Persona can be defined as examining characteristic information obtained from different sources and the emergence of the ideal customer profile in light of this information. We can say that persona is actually an analysis process.

What is Customer Profiling?

Customer profiling is primarily gathering all the information you can about people you want to sell products/services to, and grouping these potential customers together by categories. It is more than your general “target market” because you take the time to understand your customers.

  • You will get better conversions
  • You will develop and sell better products
  • It helps you understand where your customers are spending their time

Business Problem:

A game company wants to create level-based new customer definitions (personas) by using some features of its customers, creating segments according to these new customer definitions, and estimating how much the new customers can earn on average according to these segments.


  • Price: Customers spending amount.
  • Source: The type of device the customer is connecting to.
  • Sex: Gender of the customer.
  • Country: Country of the customer.
  • Age: Age of the customer.

For all the codes, you can check my repo.



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