Data diagnosis

Updated at:

Run data diagnostics to assess the quality of your user, item, and behavior tables before feature engineering. Diagnostic results help you decide which features to keep, how to configure discretization parameters, the optimal lookback window for user preference features, and the training sample duration.

Prerequisites

Before you begin, make sure you have:

  • Registered your data tables in the Data Registration module (MaxCompute user property tables, item property tables, and user behavior tables)

Diagnostic task types

PAI-Rec supports five diagnostic task types, each targeting a different data quality question.

Task type What it tells you When to use it
Basic Statistical Analysis Distribution and missing rate of field values Before feature engineering, to decide which features to keep or discard
Analysis on Item or User Change Rate Daily increase and decrease rates for users or items When setting up new-user or cold-start policies
Analysis on Statistical Period of User Preference The optimal lookback window (k days) for user preference features When determining the statistical period and sample training window
Two-table Join Analysis Whether behavioral data and features are available and IDs are unique When joining a behavior table with an item table
Exception Analysis Abnormal exposure or conversion rates for specific users or items When investigating upstream/downstream behavior anomalies

Basic statistical analysis

Analyzes the distribution and missing rate of field values in your data tables.

What to do with the results: Discard features with high missing rates or abnormal values. Abnormal values may also indicate issues in log uploading, storage, or cleansing.

Analysis on item or user change rate

Counts daily increases and decreases for a specific field — for example, user_id in a user table.

What to do with the results:

  • If the number of new users significantly exceeds returning users, enable the new-user recommendation policy.

  • If daily new item counts are excessively high, enable the cold-start policy for items.

Analysis on statistical period of user preference

Determines the optimal lookback window k' for calculating user preference features and setting the sample training window. The task uses two metrics:

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

Adjust k until the recurrence rate reaches 80% or 90%. The resulting k' becomes your statistical period for user preference features and the number of days for sample training.

Important

When the recurrence rate over k' days is below 90%, more than 10% of users have been inactive for the past k' days. The system lacks recent data on their preferences — enable the cold-start policy for these users.

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

Two-table join analysis

Verifies the availability of behavioral data and features, and checks ID uniqueness. When a behavior table joins with an item table, feature values for some items may be NULL. Investigate the cause whenever this occurs.

Exception analysis

Analyzes upstream and downstream behavior relationships in behavior tables:

  • If "expose" behaviors are upstream, "click" and "add-to-cart" behaviors are downstream.

  • If "click" behaviors are upstream, "like" and "comment" behaviors are upstream.

To analyze both upstream and downstream behaviors at the same time, create two separate diagnostic tasks. If the exposure count or conversion rate for specific users or items is unusually high, review the user logs for those entries.

Create a data diagnostic task

  1. On the Data Diagnostics page, click the Task Management tab.

  2. Click Create Diagnostics Task.

  3. Select a task type and configure the task parameters.

View task logs

After creating a diagnostic task, click the Task Logs tab to monitor task progress.

Click the refresh icon to update the task status. In the Actions column, click View Log to see the log output, or click Configuration to review the task configuration.

Important

Each business time corresponds to one log entry. For example, a seven-day time window produces seven log entries.

View a diagnostic report

  1. On the Task Management tab of the Data Diagnostics page, find the task you want to review.

  2. In the Actions column, click Diagnostics Report.

  3. On the Diagnostics Report page, review the task type, task name, and data table.

  4. Set the Time Window. The default is Previous 14 Days (excluding the current day). For example, if today is 2023-09-06, the report covers 2023-08-22 to 2023-09-05. You can also select Previous 7 Days or specify a custom date range.

  5. After the page loads, the system highlights any dates within the selected range that have no data.

    • If the missing data has since been added to the data table, click Create Re-run Task, then click Confirm to rerun the diagnostic.

    • If you don't need to fill in the missing data, click Ignore to proceed to the report.

When Time Window is set to Previous 7 Days, click Start Diagnosis to display dates without data within the last seven days. The same options — Create Re-run Task and Ignore — apply.

What's next

For details about each diagnostic report type, see the following topics.