Javatpoint Logo
Javatpoint Logo

App User Segmentation in Python

The task of classifying users depending on how they interact with the app is known as app user segmentation. It assists in locating retained users, determining the group of customers for a marketing campaign, and solving a variety of other business difficulties involving the search for users with comparable characteristics. This post is for you if you want to discover how to segment app users. In this tutorial, I'll guide you through the process of app customer segmentation using Machine Learning and Python.

App User Segmentation

In order to solve the challenge of app user segmentation, we must categorise users depending on how they interact with the app. So, in order to overcome this problem, we need data on users depending on how they interact with the app.

I discovered a dataset containing information on how users who use an app on a regular basis and users who have uninstalled the app interacted with it. This information may be utilised to segment users and identify retained and churn consumers.

App Users Segmentation: A brief Case Study

Businesses and app developers must identify and target certain user categories to better engagement and keep more users to raise lifetime value in the increasingly competitive world of applications.

Here is a dataset we gathered from an app in order to discover a data-driven method to segmenting app users according to their usage behaviours and spending capabilities in order to identify consumers who the app would retain and lose over time.

All of the characteristics in the dataset are listed below:

  1. userid: The user's unique identifier;
  2. Mean Screen Time: The user's mean screen time on the programme.
  3. Mean Spent on App ( INR ): The user's mean amount spent on the application.
  4. User Reviews: Did the user give any feedback regarding their experience with the application? If true, ( 1; else, 0 ).
  5. Ratings: The application's rating supplied by the user.
  6. New Password Request: the amount of times a user asked for a new password.
  7. Last Visited Mins: The number of mins since the user was last active.
  8. Status: Installed if the programme is installed, and removed if the user quit using it.

Discover relationships between users who are still using the programme and those who have uninstalled it, and establish user segments to better understand the maintained users and those who can be maintained before moving on to other options.

Main table of dataset (for reference purpose only):

userid Mean Screen Time Mean Spent on App ( INR ) Left Review Ratings New Password Request Last Visited Mins Status
2002 27 631 2 9 7 2990 Uninstalled
2002 0 51 0 1 8 21008 installed
2003 37 207 0 8 5 972 Uninstalled
2001 32 115 2 6 2 799 installed
2005 15 127 2 5 6 3668 Uninstalled
2006 28 599 0 9 1 2878 Uninstalled
2007 19 887 2 9 6 1182 installed
2008 8 32 0 2 2 2725 Uninstalled
2009 28 712 2 8 2 802 Uninstalled
2020 28 521 2 8 1 1622 installed
2022 11 688 2 8 5 2293 Uninstalled
2022 21 166 2 20 1 1221 Uninstalled
2023 2 19 0 3 7 9008 Uninstalled
2021 12 815 0 20 7 3207 installed
2025 32 252 0 5 1 2595 Uninstalled
2026 22 269 0 20 3 577 Uninstalled
2027 38 776 2 7 1 2965 installed
2028 31 312 0 6 2 3221 Uninstalled
2029 22 250 0 7 5 3160 Uninstalled
2020 28 967 2 20 6 2925 Uninstalled
2022 25 771 2 7 2 632 Uninstalled
2022 31 182 0 6 8 1057 Uninstalled
2023 22 615 2 9 2 2916 installed
2021 26 688 0 9 1 1702 Uninstalled
2025 31 100 0 8 1 1289 Uninstalled
2026 18 73 2 20 2 2891 Uninstalled
2027 33 160 0 9 2 2019 Uninstalled
2028 19 818 0 5 1 129 Uninstalled
2029 9 16 0 0 2 3273 Uninstalled

In the part below, I'll walk you through the process of App User Segment using Machine Learning using Python.

Python App User Segmentation

Let's get started with App User Segment by importing the essential Python modules and dataset:

Code snippet:

Output:

   userid  Mean Screen Time  Mean Spent on App ( INR )  Left Review  \
- - - - - - - - - - - - - - - - - - - - - - - - - - -  - - - - - - - - - - - - - - - - - - - 
0    1001                 17.0                       634.0            1   
1    1002                  0.0                        54.0              0   
2    1003                 37.0                       207.0            0   
3    1004                 32.0                       445.0            1   
4    1005                 45.0                       427.0            1   

   Ratings  New Password Request  Last Visited Mins       Status  
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
0        9                     7                  2990    Installed  
1        4                     8                 24008   Uninstalled  
2        8                     5                   971    Installed  
3        6                     2                   799    Installed  
4        5                     6                  3668    Installed  

To begin, consider the greatest, lowest, and mean time spent on screens of all users:

Code snippet:

Output:

Mean Screen Time = 24.39039039039039
Highest Screen Time = 50.0
Lowest Screen Time = 0.0

To begin, consider the greatest, lowest, and mean time spent on screens of all users:

Code snippet:

Output:

Mean Spend of the Users = 424.4154154154154
Highest Spend of the Users = 998.0
Lowest Spend of the Users = 0.0

Now consider the link between active users' spending capacity and screen time and users who have discontinued the app:

Code snippet:

Output:

App User Segmentation in Python

So this is fantastic! Users who deleted the app had a median screen time of less than 5 mins per day and spent less than 100 dollars. There is also a linear association between mean computer time and mean expenditure of users who are still using the app.

Let's have a peek at the link between user ratings and mean screen time now:

Code snippet:

Output:

App User Segmentation in Python

As we can see, people that deleted the app awarded it a maximum of five stars. In comparison to people who ranked higher, their screen time is quite short. As a result, customers who dislike spending more time with the programme grade it low and remove it at some point.

App User Segmentation to Identify Retained and Dropped Users

Now, let's look into App User Segmentation to see who the app kept and who it lost permanently. For this challenge, I will use the K-means clustering technique in Machine Learning:

Code snippet:

Output:

   userid  Mean Screen Time  Mean Spent on App ( INR )  Left Review  \
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 

0    1001                 17.0                       634.0            1   
1    1002                  0.0                        54.0              0   
2    1003                 37.0                       207.0            0   
3    1004                 32.0                       445.0            1   
4    1005                 45.0                       427.0            1   
5    1006                 28.0                       599.0            0   
6    1007                 49.0                       887.0            1   
7    1008                  8.0                        31.0              0   
8    1009                 28.0                       741.0            1   
9    1010                 28.0                       524.0            1   

   Ratings  New Password Request  Last Visited Mins       Status  Segments  
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
0        9                     7                  2990    Uninstalled         0  
1        4                     8                 24008  uninstalled         2  
2        8                     5                   971    Uninstalled         0  
3        6                     2                   799    installed              0  
4        5                     6                  3668    Uninstalled       0  
5        9                     4                  2878    installed            0  
6        9                     6                  4481    Uninstalled       0  
7        2                     1                  1715    installed            0  
8        8                     2                   801    Uninstalled         0  
9        8                     4                  4621    Uninstalled         0  

Let's take a look at how many portions we have:

Code snippet:

Output:

0    910
1     45
2     44
Name: Segments, dtype: int64

Let's rename the portions for easier comprehension:

Code snippet:

Let us now see the segments:

Code snippet:

Output:

App User Segmentation in Python

The blue section represents the number of users kept by the app over time. The red segment represents users who have recently removed the programme or are planning to do so. The green segment represents the number of users that the programme has lost.

Summary

As a result, you may categorise users based on how they interact with the app. App user segmentation assists organisations in finding retained users, determining the user segment for a promotional initiative, and solving a variety of other business challenges that require searching for users based on comparable criteria. I hope you enjoyed my post on Segmenting App Users Using Machine Learning in Python.







Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA