Customer Segmentation is a method to divide our customers into groups based on some business KPIs like recency, frequency, latency, customer spend, etc. These segments are then used to target specific groups of customers to provide better campaign offers.

This notebook can be used for the creation of segments based on Customer Spend and Frequency. You will end of with the following segments.

  • High Value, High Frequency
  • High Value, Low Frequency
  • Low Value, High Frequency
  • Low Value, Low Frequency

Notebook Flow

Clone the Notebook into your workspace.
  1. Cmd 1: Import all the required python libraries.
  2. Cmd 2: Read instructions on how to use the notebook.

    Input Org_id, Start date, End date into the text box.

    It is a usual practice to at least take 2 years of data to get better results.
  3. Cmd 6: Run the query to get user-wise KPIs.
  4. Cmd 13: Ntile bucket-wise user and Sales distribution.
    Here, we are adding a column “Index”. This column gives us sales per customer bucket. Using this index, we can divide our user base into high, mid, and low segments. The buckets are sorted on the basis of ATV in descending order.
  5. Cmd 14: A visual representation of the bucket-wise user and sales distribution.
  6. Cmd 16: Using the index values from cmd 13, change the value of l and h in cmd 16 to set your cut-offs. (l = cut-off for low and h = cut-off for high).
  7. Cmd 20: Run the query to get user-wise KPIs and ntiles.
  8. Cmd 27: Ntile bucket-wise user and sales distribution.
    Here, we are adding a column “Index”. This column gives us sales per customer bucket. Using this index, we can divide our user base into high, mid and low segments. These buckets are sorted in descending order based on the visits of users.
  9. Cmd 28: A visual representation of the bucket-wise user and sales distribution.

  10. Cmd 30: Using the index values from cmd 13, change the value of l1 and h1 in cmd 16 to set your cut-offs. (l1 = cut-off for low and h1 = cut-off for high).

  11. Cmd 38: This command shows basic KPIs for all our segment combinations.

  12. Cmd 39: A Sample Engagement Strategy for segments.

Notebook Links

Open your cluster-specific link provided for the Notebook.


Notebook

Cluster links

High Value High Frequency Customer Segments
India, SEA, EMEA