# US 2025/0061345 A1 · Model stability detection method, apparatus, and device

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2025/0061345 A1
- Document ID: US20250061345A1
- Status: Published application
- Kind: A1
- Application number: 18/807,530
- Filed: 2024-08-16
- Published: 2025-02-20
- Earliest claimed: 2023-08-18
- Applicants: Beijing Volcano Engine Technology Co., Ltd.
- Inventors: Guolong Song; Xuan Luo
- Web page: https://patentgrep.com/patent/US20250061345A1

## CPC

- G06N 5/01: Dynamic search techniques; Heuristics; Dynamic trees; Branch-and-bound
- G06N 20/00: Machine learning
- G06N 20/20: Ensemble learning
- G06N: COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS

## Abstract

Disclosed herein a model stability detection method and apparatus, and a device. Base period labeled samples and base period unlabeled samples at a base period time point, and current period unlabeled samples at a current period time point are obtained. A base period decision tree model is trained using the base period labeled samples. The base period decision tree model includes at least one path from a root node to a leaf node. Applying the base period decision tree model to form a first set of numerical values and second set of numerical values. Due to a distribution change of the input data in the samples, the sample statistics are different. Therefore, occurrence of data drift can be determined based on a first distribution difference result of the first set of numerical values and the second set of numerical values, to implement model stability detection.

## Claims

### Claim 1

A model stability detecting method, comprising:
obtaining base period labeled samples and base period unlabeled samples at a base period time point, and current unlabeled samples at a current period time point, the base period time point preceding the current period time point;
training a decision tree model based on the base period labeled samples, to obtain a base period decision tree model, the base period decision tree model comprising at least one path from a root node to a leaf node;
applying the base period decision tree model to predict the base period unlabeled samples, obtaining a first sample statistic corresponding to each of the at least one path after the predicting, and forming a first set of numerical values by first sample statistics corresponding to respective paths in the at least one path;
applying the base period decision tree model to predict the current period unlabeled samples, obtaining a second sample statistic corresponding to each of the at least one path after the predicting, and forming a second set of numerical values by second sample statistics corresponding to respective paths in the at least one path, the first sample statistic and the second sample statistic being of a same type; and
obtaining a first distribution difference result of the first set of numerical values and the second set of numerical values, and determining, in response to the first distribution difference result meeting a first preset condition, that data drift has occurred.

### Claim 2 (depends on 1)

The method of claim 1, wherein obtaining the first distribution difference result of the first set of numerical values and the second set of numerical values, and determining, in response to the first distribution difference result meeting the first preset condition, that the data drift has occurred, comprise:
calculating a first KL divergence of the first set of numerical values and the second set of numerical values based on the first sample statistics corresponding to the respective paths in the first set of numerical values and the second sample statistics corresponding to the respective paths in the second set of numerical values; and
determining, in response to the first KL divergence meeting a first threshold range, that the data drift has occurred.

### Claim 3 (depends on 1)

The method of claim 1, wherein obtaining the first sample statistic corresponding to each of the at least one path after the predicting, and forming the first set of numerical values by the first sample statistics corresponding to the respective paths, comprise:
calculating a first proportion corresponding to each of the at least one path after the predicting, and forming the first set of numerical values by first proportions corresponding to the respective paths, the first proportion corresponding to the path being a proportion of a number of base period unlabeled samples passing through the path to a total number of the base period unlabeled samples after the predicting; and
wherein obtaining the second sample statistic corresponding to each of the at least one path after the predicting, and forming the second set of numerical values by second sample statistics corresponding to the respective paths, comprise:
calculating a second proportion corresponding to each of the at least one path after the predicting, and forming the second set of numerical values by second proportions corresponding to the respective paths, the second proportion corresponding to the path being a proportion of a number of current period unlabeled samples passing through the path to a total number of the current period unlabeled samples after the predicting.

### Claim 4 (depends on 3)

The method of claim 3, wherein the samples comprise input data features, and the method further comprises:
calculating a difference between the first proportion and the second proportion corresponding to each of the at least one path; and
determining a path with the difference meeting a difference range as a first target path, and determining that input data features associated with the first target path are related to the data drift.

### Claim 5 (depends on 1)

The method of claim 1, further comprising:
obtaining current period labeled samples at the current period time point;
applying the base period decision tree model to predict the base period labeled samples, and forming a first set of labels by numbers of sample labels corresponding to the respective paths after the predicting;
applying the base period decision tree model to predict the current period labeled samples, and forming a second set of labels by numbers of sample labels corresponding to the respective paths after the predicting; and
obtaining a second distribution difference result of the first set of labels and the second set of labels, and determining, in response to the second distribution difference result meeting a second preset condition, that concept drift has occurred.

### Claim 6 (depends on 5)

The method of claim 5, wherein obtaining the second distribution difference result of the first set of labels and the second set of labels, and determining, in response to the second distribution difference result meeting the second preset condition, that the concept drift has occurred, comprise:
calculating a third proportion of the number of sample labels in the first set of labels corresponding to each of the at least one path to a total number of the base period labeled samples;
calculating a fourth proportion of the number of sample labels in the first set of labels corresponding to each of the at least one path to a total number of the current period labeled samples;
calculating a second KL divergence corresponding to each of the at least one path, based on the third proportion and the fourth proportion corresponding to each of the at least one path;
selecting a maximum KL divergence in second KL divergences corresponding to the respective paths; and
determining, in response to the maximum KL divergence meeting a second threshold range, that the concept drift has occurred.

### Claim 7 (depends on 6)

The method of claim 6, wherein the samples comprise input data features, and the method further comprises:
determining a second target path corresponding to the maximum KL divergence; and
determining that input data features associated with the second target path are related to the concept drift if the maximum KL divergence meets a third threshold range.

### Claim 8

An electronic device, comprising:
one or more processors; and
a memory having one or more programs stored thereon,
wherein the one or more programs, when executed by the one or more processors, cause the one or more processors to implement a model stability detecting method comprising:
obtaining base period labeled samples and base period unlabeled samples at a base period time point, and current unlabeled samples at a current period time point, the base period time point preceding the current period time point;
training a decision tree model based on the base period labeled samples, to obtain a base period decision tree model, the base period decision tree model comprising at least one path from a root node to a leaf node;
applying the base period decision tree model to predict the base period unlabeled samples, obtaining a first sample statistic corresponding to each of the at least one path after the predicting, and forming a first set of numerical values by first sample statistics corresponding to respective paths in the at least one path;
applying the base period decision tree model to predict the current period unlabeled samples, obtaining a second sample statistic corresponding to each of the at least one path after the predicting, and forming a second set of numerical values by second sample statistics corresponding to respective paths in the at least one path, the first sample statistic and the second sample statistic being of a same type; and
obtaining a first distribution difference result of the first set of numerical values and the second set of numerical values, and determining, in response to the first distribution difference result meeting a first preset condition, that data drift has occurred.

### Claim 9 (depends on 8)

The electronic device of claim 8, wherein obtaining the first distribution difference result of the first set of numerical values and the second set of numerical values, and determining, in response to the first distribution difference result meeting the first preset condition, that the data drift has occurred, comprise:
calculating a first KL divergence of the first set of numerical values and the second set of numerical values based on the first sample statistics corresponding to the respective paths in the first set of numerical values and the second sample statistics corresponding to the respective paths in the second set of numerical values; and
determining, in response to the first KL divergence meeting a first threshold range, that the data drift has occurred.

### Claim 10 (depends on 8)

The electronic device of claim 8, wherein obtaining the first sample statistic corresponding to each of the at least one path after the predicting, and forming the first set of numerical values by the first sample statistics corresponding to the respective paths, comprise:
calculating a first proportion corresponding to each of the at least one path after the predicting, and forming the first set of numerical values by first proportions corresponding to the respective paths, the first proportion corresponding to the path being a proportion of a number of base period unlabeled samples passing through the path to a total number of the base period unlabeled samples after the predicting; and
wherein obtaining the second sample statistic corresponding to each of the at least one path after the predicting, and forming the second set of numerical values by second sample statistics corresponding to the respective paths, comprise:
calculating a second proportion corresponding to each of the at least one path after the predicting, and forming the second set of numerical values by second proportions corresponding to the respective paths, the second proportion corresponding to the path being a proportion of a number of current period unlabeled samples passing through the path to a total number of the current period unlabeled samples after the predicting.

### Claim 11 (depends on 10)

The electronic device of claim 10, wherein the samples comprise input data features, and the method further comprises:
calculating a difference between the first proportion and the second proportion corresponding to each of the at least one path; and
determining a path with the difference meeting a difference range as a first target path, and determining that input data features associated with the first target path are related to the data drift.

### Claim 12 (depends on 8)

The electronic device of claim 8, wherein the method further comprises:
obtaining current period labeled samples at the current period time point;
applying the base period decision tree model to predict the base period labeled samples, and forming a first set of labels by numbers of sample labels corresponding to the respective paths after the predicting;
applying the base period decision tree model to predict the current period labeled samples, and forming a second set of labels by numbers of sample labels corresponding to the respective paths after the predicting; and
obtaining a second distribution difference result of the first set of labels and the second set of labels, and determining, in response to the second distribution difference result meeting a second preset condition, that concept drift has occurred.

### Claim 13 (depends on 12)

The electronic device of claim 12, wherein obtaining the second distribution difference result of the first set of labels and the second set of labels, and determining, in response to the second distribution difference result meeting the second preset condition, that the concept drift has occurred, comprise:
calculating a third proportion of the number of sample labels in the first set of labels corresponding to each of the at least one path to a total number of the base period labeled samples;
calculating a fourth proportion of the number of sample labels in the first set of labels corresponding to each of the at least one path to a total number of the current period labeled samples;
calculating a second KL divergence corresponding to each of the at least one path, based on the third proportion and the fourth proportion corresponding to each of the at least one path;
selecting a maximum KL divergence in second KL divergences corresponding to the respective paths; and
determining, in response to the maximum KL divergence meeting a second threshold range, that the concept drift has occurred.

### Claim 14 (depends on 13)

The electronic device of claim 13, wherein the samples comprise input data features, and the method further comprises:
determining a second target path corresponding to the maximum KL divergence; and
determining that input data features associated with the second target path are related to the concept drift if the maximum KL divergence meets a third threshold range.

### Claim 15

A non-transitory computer readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements a model stability detecting method comprising:
obtaining base period labeled samples and base period unlabeled samples at a base period time point, and current unlabeled samples at a current period time point, the base period time point preceding the current period time point;
training a decision tree model based on the base period labeled samples, to obtain a base period decision tree model, the base period decision tree model comprising at least one path from a root node to a leaf node;
applying the base period decision tree model to predict the base period unlabeled samples, obtaining a first sample statistic corresponding to each of the at least one path after the predicting, and forming a first set of numerical values by first sample statistics corresponding to respective paths in the at least one path;
applying the base period decision tree model to predict the current period unlabeled samples, obtaining a second sample statistic corresponding to each of the at least one path after the predicting, and forming a second set of numerical values by second sample statistics corresponding to respective paths in the at least one path, the first sample statistic and the second sample statistic being of a same type; and
obtaining a first distribution difference result of the first set of numerical values and the second set of numerical values, and determining, in response to the first distribution difference result meeting a first preset condition, that data drift has occurred.

### Claim 16 (depends on 15)

The non-transitory computer readable storage medium of claim 15, wherein obtaining the first distribution difference result of the first set of numerical values and the second set of numerical values, and determining, in response to the first distribution difference result meeting the first preset condition, that the data drift has occurred, comprise:
calculating a first KL divergence of the first set of numerical values and the second set of numerical values based on the first sample statistics corresponding to the respective paths in the first set of numerical values and the second sample statistics corresponding to the respective paths in the second set of numerical values; and
determining, in response to the first KL divergence meeting a first threshold range, that the data drift has occurred.

### Claim 17 (depends on 15)

The non-transitory computer readable storage medium of claim 15, wherein obtaining the first sample statistic corresponding to each of the at least one path after the predicting, and forming the first set of numerical values by the first sample statistics corresponding to the respective paths, comprise:
calculating a first proportion corresponding to each of the at least one path after the predicting, and forming the first set of numerical values by first proportions corresponding to the respective paths, the first proportion corresponding to the path being a proportion of a number of base period unlabeled samples passing through the path to a total number of the base period unlabeled samples after the predicting; and
wherein obtaining the second sample statistic corresponding to each of the at least one path after the predicting, and forming the second set of numerical values by second sample statistics corresponding to the respective paths, comprise:
calculating a second proportion corresponding to each of the at least one path after the predicting, and forming the second set of numerical values by second proportions corresponding to the respective paths, the second proportion corresponding to the path being a proportion of a number of current period unlabeled samples passing through the path to a total number of the current period unlabeled samples after the predicting.

### Claim 18 (depends on 17)

The non-transitory computer readable storage medium of claim 17, wherein the samples comprise input data features, and the method further comprises:
calculating a difference between the first proportion and the second proportion corresponding to each of the at least one path; and
determining a path with the difference meeting a difference range as a first target path, and determining that input data features associated with the first target path are related to the data drift.

### Claim 19 (depends on 15)

The non-transitory computer readable storage medium of claim 15, wherein the method further comprises:
obtaining current period labeled samples at the current period time point;
applying the base period decision tree model to predict the base period labeled samples, and forming a first set of labels by numbers of sample labels corresponding to the respective paths after the predicting;
applying the base period decision tree model to predict the current period labeled samples, and forming a second set of labels by numbers of sample labels corresponding to the respective paths after the predicting; and
obtaining a second distribution difference result of the first set of labels and the second set of labels, and determining, in response to the second distribution difference result meeting a second preset condition, that concept drift has occurred.

### Claim 20 (depends on 19)

The non-transitory computer readable storage medium of claim 19, wherein obtaining the second distribution difference result of the first set of labels and the second set of labels, and determining, in response to the second distribution difference result meeting the second preset condition, that the concept drift has occurred, comprise:
calculating a third proportion of the number of sample labels in the first set of labels corresponding to each of the at least one path to a total number of the base period labeled samples;
calculating a fourth proportion of the number of sample labels in the first set of labels corresponding to each of the at least one path to a total number of the current period labeled samples;
calculating a second KL divergence corresponding to each of the at least one path, based on the third proportion and the fourth proportion corresponding to each of the at least one path;
selecting a maximum KL divergence in second KL divergences corresponding to the respective paths; and
determining, in response to the maximum KL divergence meeting a second threshold range, that the concept drift has occurred.
