All Products
Document Center

Monitor user loss

Last Updated: May 14, 2020


How to increase the user base while retaining existing users is key to business growth. Many technical measures are required to retain existing users. An important measure is to create a user loss model to learn the features of lost users in the past and train a risk control model through machine learning to predict the user loss trend. This helps formulate measures to prevent user loss.

Business pain points

Many businesses take warning and monitoring measures to prevent user loss, but these measures are not intelligent enough. Rule-based warning is widely used but fails to discover potential user loss in an accurate manner.


Machine Learning Platform for AI (PAI) provides a set of solutions for feature encoding, classification model training, and model evaluation based on labeled data.

  1. Required knowledge: basic modeling knowledge.

  2. Development cycle: one to two days.

  3. Required data: more than one thousand labeled data items that indicate the situations under which users are lost. The prediction effect is better when more labeled data items are available.


In this example, data is collected on the behaviors of 7,043 user samples in the real-life telecommunications field. The collected data includes the user attributes and the status of user loss (whether users are lost or retained).

Feature data:

Parameter Description
customerid The ID of a user.
gender The gender of the user.
SeniorCitizen Specifies whether the user is a city resident. 1 indicates that the user is a city resident, and 0 indicates that the user is not a city resident.
Partner Specifies whether the user has a partner.
Dependents Specifies whether the user is affiliated.
tenure The duration when the user has dealings with the company.
PhoneService Specifies whether the user subscribes to mobile phone services.
MultipleLine Specifies whether the user has multiple lines.
InternetService Specifies whether the user subscribes to services from Internet service providers (ISPs). Valid values include DSL, Fiber optic, and No.
OnlineSecurity Specifies whether the user faces Internet security issues.
OnlineBackup Specifies whether the user has access to online support.
DeviceProtection Specifies whether the user has access to service protection.
TechSupport Specifies whether the user has applied for technical support.
StreamingTV Specifies whether the user has access to streaming TV programs.
StreamingMovies Specifies whether the user has access to streaming movies.
Contract The time limit of the user’s contract. Values: Month-to-month and Two year.
PaperlessBilling Specifies whether the user receives electronic bills.
PaymentMethod The payment method used by the user.
MonthlyCharges The monthly expenses of the user.
TotalCharges The total expenses of the user.

Target data:

Parameter Description
churn Specifies whether the user is lost.


Log on to PAI Studio at

The solution data and experiment environment are built in the corresponding template on the homepage .

Open the experiment:

  1. Data source

The data source is the streaming data received by users.

  1. Feature encoding

Use the One-Hot Encoding and SQL Script components to create a feature engineering model and convert original character-type features to numeric features.

The target field “churn” is used as an example. Run the following SQL statement to convert the original values Yes and No to 1 and 0, respectively:

  1. select (case churn when 'Yes' then 1 else 0 end) as churn from ${t1};
  1. Model training

Divide the data into two parts: a training set for model training, and a prediction set to verify the model effect. User loss warning falls in binary classification because a user is either lost or retained. Use the binary classification algorithm to create a classification model, which can be deployed in one click as a RESTful API service to be called in business scenarios.

  1. Model effect verification

Use the Binary Classification Evaluation component to verify the model accuracy. An AUC of 0.83 indicates a prediction accuracy of about 80%.


User loss warning is widely used in business scenarios. PAI provides a full set of algorithms based on user features, helping customers to quickly train a user loss model in one to two days. This accelerates the process of experiment setup.