Analyze user behavior preferences and retention status
The Analysis on Statistical Period of User Preference task analyzes behavior data to answer two key questions for recommendation decisions:
-
How many days of user history reliably reflect current preferences? (the feature engineering window)
-
Which users lack sufficient recent activity and need a cold start policy?
Run this task before feature engineering to find the optimal statistical window for user preference features and the recurrence rate threshold for cold start eligibility.
Prerequisites
Ensure that you have:
-
A behavior data table with a date partition field in
yyyymmddoryyyy-mm-ddformat -
A field that uniquely identifies users (such as
user_id)
Configure the task
Step 1: Set the task type and data source
-
For Task Type, select Analysis on Statistical Period of User Preference from the drop-down list.
-
For Data Table, select the behavior table to analyze.
-
For Task Name, enter a name for the task.
Step 2: Configure the partition and user fields
-
For Partition Field, select a date field in
yyyymmddoryyyy-mm-ddformat. -
For User ID Field, select the field that uniquely identifies users — for example,
user_id.
Step 3: Set the statistical periods
Configure the three types of retention metrics you want to calculate:
| Metric | Field | Description | Example values |
|---|---|---|---|
| Recurrence rate | Statistical Period of Recurrence Rate | Number of days over which the recurrence rate is calculated. Determines the feature engineering window (k'). | 1,7,15,21 |
| Single-day retention rate | Statistical Period of Single-day Retention Rate | Number of days over which the single-day retention rate is calculated. | 1,3,7 |
| Periodic retention rate | Statistical Period of Periodic Retention Rate | A periodic interval — by week or by month. | Select from drop-down |
To specify multiple values for recurrence rate or single-day retention rate, separate them with commas.
Default weekly intervals for the periodic retention rate are 1 week, 4 weeks, and 12 weeks. Default monthly intervals are 1 month and 2 months. A periodic retention rate measures the percentage of users who are active in one period (such as January) and remain active in the following period (such as February).
Step 4: Choose how to run the task
For Periodic Running, choose how to execute the task:
-
No (default): Click Save and Calculate. In the Data Timestamp of Re-run Task dialog box, specify a time range and click OK. By default, the time range covers the last seven days.
-
Yes: Configure the Periodic Running Time parameter to set the daily execution time, then click Save.
Business time refers to the date partition where data is stored, not the time when the data was written.
Key concepts
Recurrence rate
Recurrence rate over k days = Number of users who visited both during Day T−k to Day T−1 and on Day T / Number of users who visited on Day T
Retention rate
Retention rate over k days = Number of users who visited both on Day T+k and Day T / Number of users who visited on Day T
Use the results
After the task runs, use the recurrence rate results to set two parameters for your recommendation pipeline.
Determine the feature engineering window (k')
Find the value of k at which the recurrence rate reaches 80% or 90%. This value (k') is your feature engineering window — the number of days of behavior history used to calculate user preference features and define the sample training period.
Example: If the recurrence rate reaches 90% at k = 14, set your feature engineering window to 14 days.
Identify users who need a cold start policy
When the recurrence rate over k' days falls below 90%, more than 10% of users have had no activity in the past k' days. The system lacks recent data to model their preferences accurately. Apply the cold start policy for these users.
Diagnostic reports
The diagnostic reports contain two sections:
-
User behavior preferences: Shows the recurrence rate across different k-day windows. Use the recurrence rate curve to locate the k value where the curve approaches 80% or 90% — that is your feature engineering window (k').
-
User retention status: Shows single-day and periodic retention rates, helping you understand how long users remain engaged after their initial visit.