Business model training and online updating method and device
By performing gradient orthogonal decomposition and weight update of the new base learner in the gradient enhancement tree model, the problems of online update efficiency and computing efficiency of business models under the gradient enhancement tree architecture are solved, and the continuous adaptation of the model and efficient business processing are achieved. .
Patent Information
- Application Number
- CN202411069844.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-05
- Publication Date
- 2024-11-12
AI Technical Summary
In artificial intelligence applications, with the increase in online data volume and update speed, the online update efficiency, feasibility and equipment performance consumption of business models have become important technical challenges, especially under the gradient improvement tree architecture, the scale of the prediction model has infinitely increased. , resulting in a decrease in computing efficiency and making it difficult to continuously adapt to new business data.
By performing gradient orthogonal decomposition of the new foundation learner during the training stage of the gradient-enhancing tree model, it can only fit components with less correlation with the known foundation learner, expand the functional space of the foundation learner, and in The weight coefficient of the base learner is updated in the online prediction stage to avoid the infinite increase in the scale of the prediction model and optimize the business processing results.
The continuous online update of the gradient enhancement tree model is realized, the business processing efficiency of the prediction model is maintained, the business processing efficiency is ensured, the new business data is continuously adapted to new business data, the unlimited increase in the scale of the prediction model is avoided, and the business processing results are optimized.
Smart Images

Figure CN118940860A_ABST
Abstract
Description
Technical Field
[0001] One or more embodiments of the present specification relate to the field of computer technology, and in particular, to a method and device for business model training and online updating. Background Art
[0002] With the popularization of artificial intelligence applications, the amount of business data and the speed of updating are also increasing. Generally, artificial intelligence relies on machine learning models to process data and provide users with real-time, intelligent, and personalized business processing. The process of using machine learning models for real-time business processing can also be called online prediction. With the increase in the amount of online data and the speed of updating, the online update efficiency, feasibility, and equipment performance consumption of business models are all important technical contents in the field of artificial intelligence applications. Summary of the invention
[0003] One or more embodiments of this specification describe a method and device for business model training and online updating, which are used to solve one or more problems mentioned in the background technology.
[0004] According to a first aspect, a business model training method is provided, wherein the business model is a weighted form of several base learners, and the method comprises a plurality of training cycles for adding base learners, wherein in a single training cycle: obtaining each training sample, wherein a single training sample corresponds to a business feature, a business target value, and a predicted value obtained by processing the business feature by the current business model; determining a first gradient vector of the current business model on each training sample, wherein a single element of the first gradient vector corresponds to a gradient determined based on a single training sample; performing an orthogonal decomposition of the first gradient vector on each base learner in the current business model, respectively, so as to update the first gradient vector through a gradient component perpendicular to each base vector, wherein a single base vector is composed of the predicted value of each training sample by the corresponding single base learner; obtaining a new base learner and its weight with the goal of minimizing the residual determined according to the updated first gradient vector, thereby updating the current business model.
[0005] In one embodiment, determining the first gradient vector of the current business model on each training sample includes: based on the comparison between the business target value and the predicted value of each training sample, determining the predicted loss by the sum of the losses of the current business model on each training sample; and determining the first gradient vector according to the partial derivative of the predicted result under each training sample according to the predicted loss.
[0006] In one embodiment, the current business model includes a first basis learner, and the orthogonal decomposition of the first gradient vector is performed on each basis learner in the current business model to update the first gradient vector through a gradient component perpendicular to each basis vector, including: determining a first basis vector corresponding to the first basis learner, a single dimension of the first basis vector being a processing result of a single training sample processed by the first basis learner; determining a first component of the first gradient vector in the direction of the first basis vector according to the product of the first gradient vector and the first basis vector; and updating the first gradient vector by using the difference between the first gradient vector and the first component as a second component of the first gradient vector in a direction perpendicular to the first basis vector.
[0007] In a further embodiment, the first component is the product of the first basis vector and a first coefficient, and the first coefficient is: the ratio of the product of the first gradient vector and the first basis vector to the modulus of the first basis vector.
[0008] In a further embodiment, the first base learner corresponds to a first weight, and the method further includes: taking the first coefficient as a gradient corresponding to the first weight, and updating the first coefficient along the gradient direction at a predetermined learning rate.
[0009] In one embodiment, the step of obtaining a new base learner and its weight with the goal of minimizing the residual determined according to the updated first gradient vector, thereby updating the current business model includes: determining a second base learner as a new base learner with the goal of minimizing the prediction loss on each training sample after adding the base learner; determining a second weight corresponding to the second base learner with the goal of minimizing the prediction loss of the current business model on each training sample and the fitting result of the new base learner to the residual; and updating the current business model according to the product of the second weight and the second base learner.
[0010] According to the second aspect, a method for online updating of a business model is provided, wherein the business model is a weighted sum of several base learners and is trained in the manner described in the first aspect; the method comprises: determining several first samples of a training set and several second samples of a test set according to current incremental data; updating the weights corresponding to the respective base learners using the several first samples; and verifying the model indicators of the updated business model using the several second samples to determine whether to add new base learners to the business model according to the indicator values of the model indicators.
[0011] In one embodiment, the use of the first samples to update the weights corresponding to the base learners includes: determining the gradient of each weight according to the business processing result of each first sample by the business model; and updating each weight according to the corresponding gradient at a predetermined learning rate.
[0012] In one embodiment, each base learner includes a third base learner, and the third base learner corresponds to a third weight. Determining the gradient of each weight based on the business processing result of the business model for each first sample includes: obtaining the first prediction loss of the business model using the business processing result of the business model for each first sample; determining the gradients corresponding to each weight under the first prediction loss, wherein, for a single weight, the corresponding gradient is determined in the following manner: determining the first-order derivative and second-order derivative of the first prediction loss with respect to the single weight; and obtaining the gradient of the single weight by multiplying the inverse of the second-order derivative by the first-order derivative.
[0013] In one embodiment, when the model indicator does not meet the predetermined conditions, a new base learner and corresponding weights are added to the business model using the method described in the first aspect to update the business model.
[0014] According to a third aspect, a business model training device is provided, wherein the business model is a weighted form of several basis learners, and the device comprises:
[0015] An acquisition unit is configured to acquire each training sample, each training sample corresponding to a business feature, a business target value, and a predicted value obtained by processing the business feature through a current business model;
[0016] A determining unit, configured to determine a first gradient vector of the current business model on each training sample, wherein a single element of the first gradient vector corresponds to a single training sample;
[0017] a decomposition unit configured to perform orthogonal decomposition of the first gradient vector for each base learner in the current business model, so as to update the first gradient vector by a gradient component perpendicular to each base vector, wherein a single base vector is composed of a prediction value of a corresponding single base learner for each training sample;
[0018] An updating unit is configured to obtain a new base learner and its weight with the goal of minimizing the residual determined according to the updated first gradient vector, thereby updating the current business model.
[0019] According to a fourth aspect, a device for online updating of a business model is provided, wherein the business model is a weighted sum of a plurality of base learners and is trained via the device according to the third aspect; the online updating device comprises:
[0020] A sample determination unit, configured to determine a plurality of first samples of a training set and a plurality of second samples of a test set according to current incremental data;
[0021] A weight updating unit, configured to update the weights corresponding to the base learners respectively using the first samples;
[0022] The indicator detection unit is configured to use the plurality of second samples to verify the model indicator of the updated business model, so as to determine whether to add a new base learner to the business model according to the indicator value of the model indicator.
[0023] According to a fifth aspect, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed in a computer, the computer is caused to execute the method of the first aspect or the second aspect.
[0024] According to a sixth aspect, a computing device is provided, including a memory and a processor, wherein the memory stores executable code, and when the processor executes the executable code, the method of the first aspect or the second aspect is implemented.
[0025] Through the device and method provided by the embodiments of this specification, for the business model under the gradient boosting tree architecture, in the model training stage, for the newly added base learner used to fit the residual, the orthogonal decomposition of the gradient is used to make it only fit the components with less correlation with the known base learner, thereby expanding the function space of the base learner and making the weight coefficients of each base learner learnable. In the online prediction stage, the weight coefficients of each base learner can be updated using streaming data, thereby providing an effective solution for the continuous online update of the gradient boosting tree model, avoiding the unlimited increase in the scale of the prediction model, and optimizing the business processing results of the prediction model while maintaining the business processing efficiency of the prediction model, so that it can continuously adapt to new business data. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative work.
[0027] Figure 1 A schematic diagram of a specific implementation scenario of this specification is shown;
[0028] Figure 2 A schematic diagram of the gradient orthogonal decomposition principle under the technical concept of this specification is shown;
[0029] Figure 3A schematic diagram of a process of business model training according to an embodiment of this specification is shown;
[0030] Figure 4 A schematic diagram of a process of online updating of a business model according to an embodiment of this specification is shown;
[0031] Figure 5 A structural block diagram of a device for business model training according to an embodiment of this specification is shown;
[0032] Figure 6 A structural block diagram of a device for online updating of a business model according to an embodiment of the present specification is shown. DETAILED DESCRIPTION
[0033] The solution provided in this specification is described below in conjunction with the accompanying drawings.
[0034] Figure 1 A specific implementation scenario in the technical solution of this specification is shown. This implementation scenario is a user transaction business (such as shopping, resource exchange, etc.) scenario involving online data and financial security. Specifically, users can conduct transaction business through the transaction business platform, and the data monitoring platform can monitor the user behavior on the transaction business platform to predict whether there are risky operations such as user fraud and gray market transactions. The user behavior here may include, for example, the context information of the user's current transaction, and the transaction context information may include, for example, the user's transaction amount, transaction method (payment method, collection method, etc.), account status, etc. The above user behavior information can be combined with the user's historical transaction information, user attribute information, etc. to determine whether there is a risky operation. Historical transaction information includes, for example, historical transaction frequency, historical transaction preferences, historical transaction context information, etc. User attribute information may include basic information such as user registration duration, user registration location, occupation, etc. By aggregating user behavior information, the risk of user operations can be predicted.
[0035] exist Figure 1In the implementation scenario shown, in order to have a higher prediction accuracy, the prediction model of online prediction can be implemented by the gradient boosting tree (Boosting machine learning algorithm) mechanism. Under the gradient boosting tree mechanism, a single base learner (such as a decision tree) attempts to correct the prediction error (such as residual) of the current model, thereby iteratively training multiple base learners, and finally weighting the prediction results of each base learner obtained to obtain the final prediction model. Specifically, in a single training step, the current prediction value obtained by processing the training sample through the current model is used to determine the residual of the current model (the difference between the prediction value and the sample label, the initial prediction value can be the mean of the sample label, etc.), add a base learner to fit the residual (using the residual as a learning target), find the optimal value of the current step size (learning rate) through cross-validation or linear search, and use the current step size as the weight of the newly added base learner, superimposed on the prediction model to update the current model and the prediction value. The process of fitting the residual using the base learner can be understood as the model loss (Loss) moving in the direction of gradient descent, and each additional base learner corresponds to an update of the gradient descent.
[0036] Some conventional gradient boosting tree algorithms (such as LightGBM, XGBoost, etc.) need to use the full amount of data to train a new base learner (such as a decision tree) to fit the residual in a single iteration. In the online prediction process, the data is streaming (updated in real time, or updated at smaller time intervals), such as once a minute, once an hour, and so on. Therefore, if you want to update the prediction model based on the gradient boosting tree online (Online Learning), since the training data is streaming data, you cannot obtain the full amount of data during the training process. In addition, if you fit the residual by adding base learners, the number of base learners will continue to increase, thereby reducing the computational efficiency of the prediction model.
[0037] In view of this, the present specification provides a method for updating a business model, and a method for performing business processing using a business model, for business processing based on a gradient boosting tree architecture. Specifically, each base learner is regarded as a basis function in a harmonic analysis, and the weight of the base learner is equivalent to the coefficient corresponding to the basis function. In the process of training the gradient boosting tree model, the gradient is orthogonally decomposed, and the new base learner only learns the gradient information in the new direction, so that the correlation between the base learners is as small as possible, thereby covering each implicit dimension as much as possible, expanding the model space where the base learner is located, and making the weighted coefficients of each base learner learnable.
[0038] refer to Figure 2As shown, assuming that y is the target to be learned, b1 is the linear space where the existing base learner is located, and the residual of the data space is -g1. Conventional boosting methods may directly learn the data residual -g1, but under the technical concept of this specification, the residual -g1 can be orthogonally decomposed, so that the two components obtained are parallel and perpendicular to b1 respectively. Among them, the vertical component is recorded as -g1', and the vertical component -g1' is the gradient data component to be fitted by the new base learner. The component parallel to b1 can be superimposed on b1. In this case, the weight coefficients of each base learner can also be used as adjustable parameters.
[0039] In this way, in the online prediction stage, the streaming data can be used to update the weight coefficients of each base learner, thereby providing an effective solution for the continuous online update of the gradient boosting tree model, avoiding the unlimited increase in the scale of the prediction model, and optimizing the business processing results of the prediction model while maintaining the business processing efficiency of the prediction model, so that it can continuously adapt to new business data.
[0040] Combine the following Figure 3 , Figure 4 The technical concept of this specification is described in detail through the embodiments shown in the figure.
[0041] Figure 3 A flow chart of business model training according to an embodiment is shown. The execution subject of the process can be a computer, device, or server with certain computing power. The business model here can be implemented based on a gradient boosting tree and include several base learners of a tree structure. The number of base learners can increase with the increase of training cycles. The business model training process provided in the embodiment of this specification can be used for model updates in the offline training stage of the business model. The business model training process can include multiple training cycles for updating the business model using offline data. A single base learner is added in a single training cycle.
[0042] like Figure 3 As shown, in a single training cycle, the following steps may be included: Step 301, obtaining each training sample, wherein a single training sample corresponds to a business feature, a business target value, and a predicted value obtained by processing the corresponding business feature through the current business model; Step 302, determining the first gradient vector of the current business model on each training sample, wherein a single element of the first gradient vector corresponds to a gradient determined based on a single training sample; Step 303, for each base learner in the current business model, performing an orthogonal decomposition of the first gradient vector respectively, so as to update the first gradient vector through a gradient component perpendicular to each base vector, wherein a single base vector is composed of the predicted value of each training sample by the corresponding single base learner; Step 304, with the goal of minimizing the residual determined according to the updated first gradient vector, obtaining a new base learner and its weight, thereby updating the current business model.
[0043] First, in step 301, each training sample is obtained, and each training sample corresponds to a business feature, a business target value, and a predicted value obtained by processing the corresponding business feature through the current business model.
[0044] The training samples may be determined by pre-collected business data. For example, a single training sample may correspond to a business feature and a business target value (such as a sample label value). The business data may be related to a specific business scenario. For example Figure 1 In the business scenario involving online data and fund security shown, when the prediction target of the business model is whether there is user fraud, gray market transactions and other risky operations, the business data of a single training sample may include: context information of the user's current transaction, historical transaction information, user attribute information, whether the current transaction involves risky operations, etc. Among them, the corresponding business features (such as x) can be extracted based on the context information, historical transaction information, and user attribute information of the user's current transaction, and the business target value (such as y) can be determined based on whether the current transaction involves risky operations, such as 1 if risky operations are involved, and 0 otherwise. Business features and target values used to describe whether there are risky operations such as user fraud, gray market transactions, etc. can constitute training samples.
[0045] It can be understood that under the gradient boosting tree mechanism, the business model can be continuously updated by adding base learners. The current business model is the business model after the base learners are added after the training of the previous training cycle. For example, if the current cycle is the mth training cycle, the current business model can be recorded as F m-1 (x). Assuming that the initial base learner is recorded as f0(x) = cont, the current business model can be recorded as Among them, f j is the base learner determined in the jth training cycle, for example, denoted as the jth base learner, ρ j is the weight of the jth base learner, and cont is a constant term, for example, the initial learner f0(x) can be determined by the mean of the target values of each training sample. In the current training cycle, the current business model F m (x) Process the business characteristics of each training sample to obtain each prediction value, such as F m-1 (x1), F m-1 (x2)……F m-1 (x n ), where n is the number of training samples. Each prediction value may be predetermined (eg, determined after updating the service model in the previous training cycle), or may be determined in the current training cycle, which is not limited here.
[0046] Then, through step 302, the first gradient vector of the current business model on each training sample is determined.
[0047] It can be understood that the gradient describes the slope of the model loss of the current business model at the corresponding point. In the sample space composed of training samples, a single training sample can correspond to a single point. The corresponding gradient can be determined by the derivative of the model loss to a single predicted value. The model loss is the comparison result of the corresponding single predicted value and the single target value. For example, the current business model is f(x) = F m-1 (x), according to the predicted value f(x) of the i-th training sample i ) and the target value y i Determine the corresponding model loss as L(y i ,f(x i ))(Model loss can be determined by square loss, absolute loss, cross entropy loss, etc.), then the gradient corresponding to the i-th training sample can be recorded as: Determine the corresponding gradients for n training samples respectively, and then get the first gradient vector of n dimensions: g = (g1, g2, ..., g n ) T .
[0048] Next, through step 303, orthogonal decomposition of the first gradient vector is performed for each basis learner in the current business model, so as to update the first gradient vector through the gradient components perpendicular to each basis vector.
[0049] Here, a single basis vector can be composed of the prediction values of the corresponding single basis learner for each training sample. For example, the jth basis learner f j (x), the predicted values obtained by processing each training sample are f j (x1),f j (x2)……f j (x n ), let f j (x i )=b ji , where i = 1, 2, ... n, then the corresponding basis vector can be recorded as b j =(b j1 , b j2 , ... b jn ).
[0050] In order to obtain a new base learner with the lowest similarity to the existing base learner, the first gradient vector can be shifted in the direction of the basis vector (such as Figure 2 b1 direction in the figure) and the direction perpendicular to the basis vectors (such as Figure 2 The -g1' direction in the orthogonal decomposition is recorded as: g = g ⊥ +g|| Among them, g || Represents the gradient in the direction of the basis vector, which can be used as the component of the linear weighted summation on the basis vector, g ⊥ The direction perpendicular to the basis vector is the gradient component that can be retained to construct a new basis learner. The orthogonal decomposition method can be any reasonable decomposition method, and this specification uses matrix multiplication as an example for description.
[0051] Those skilled in the art will appreciate that the weight coefficients of each base learner are recorded as a weight vector P = (ρ1, ρ2, ... ρ m-1 ) T , each basis vector can form a basis matrix B = (b1, b2, ... b m-1 ) T , then: g || =P·B. From this we can get: Among them, ||b j || 2 =b j b j , that is, P is a function of the gradient vector g, g·b j It can be seen as the first gradient vector g to the basis vector b j the mapping length of the mapping, Describes the mapping length and basis vector b j The ratio of the moduli δρ j , then the gradient vector g is in the basis vector b j The components of can be: δρ j b j . In this way, the weight vector P can be updated based on the gradient vector g.
[0052] According to one embodiment, on the one hand, the gradient g is subtracted from the basis vector b j The component in the direction is retained perpendicular to b j The component of the direction, the gradient can be updated as: g = g-δρ j b j On the other hand, the ratio δρ j It is also the weight ρ j Parallel to the basis vector b j The gradient component of the direction, based on the direction parallel to the basis vector b j The gradient component δρ in the direction j The weights can be updated as follows: j =ρ j -l r δ ρj , l ris the preset learning rate. In this way, for each base learner, the gradient can be orthogonally decomposed in turn, and the first gradient vector g can be cumulatively updated, and the respective weight coefficients ρ can be updated respectively. j .
[0053] In other embodiments, the first gradient vector may be orthogonally decomposed in other ways, which will not be described in detail here.
[0054] Furthermore, in step 304, a new base learner and its weight are obtained with the goal of minimizing the residual determined according to the updated first gradient vector, thereby updating the current business model.
[0055] According to the technical concept of this specification, the new base learner is to learn the updated gradient. Therefore, the residual to be fitted by the new base learner can be determined according to the updated first gradient vector, as recorded as Among them, g is an n-dimensional vector, corresponding to n training samples, so the residual can be determined for: Where i is the i-th training sample, is the gradient component corresponding to the i-th training sample in the updated first gradient vector,
[0056] Furthermore, in order to fit the residual, a new base learner f can be set m (x), so that the model loss corresponding to the new base learner f(x) is minimized. The model loss corresponding to the base learner f(x) can be the predicted value f obtained by processing each training sample. m (x i )(i=1、2……n) and the sum of the comparisons of their respective residuals, such as Among them, β is the base learner f m (x). In order to minimize the new base learner f m (x) For the residual fitting results, β and f can be adjusted m The parameters in (x) minimize the prediction loss, as written as: argmin(f, β) means taking the f and β that minimize the subsequent polynomials about f and β, denoted by f m (x), β m .
[0057] Therefore, add a base learner f to the current business model m (x), an updated business model can be obtained In some optional embodiments, it is possible to further fix the basis learner f m (x), the base learner f is updated as follows mThe weight of (x) minimizes the prediction loss under the new business model. The updated weight is denoted as ρ m :
[0058]
[0059] In this way, after multiple training cycles, M base learners can be obtained to form a gradient boosting tree model for offline training under corresponding business scenarios (such as business scenarios involving online data and financial security). Among them, M can be a preset hyperparameter, such as 100, or it can be the number of training cycles obtained according to the actual training process when the training end condition is met. The training end condition can be, for example, that the similarity between the current gradient vector and at least one basis vector is greater than a predetermined threshold. It can be understood that at this time, the current gradient vector is close to a certain basis vector, and it is meaningless to learn a new basis learner, and only the weight of the base learner can be updated.
[0060] In the gradient boosting tree model obtained through offline training in the above embodiment, since the correlation between the base learners is small, the function space where the base learners are located can be expanded to meet the online business processing process similar to the distribution of training sample data, and the model can be continuously fine-tuned by updating the weights.
[0061] It is understandable that the trained gradient boosting tree model can be used as a business model for online business processing, such as detecting whether there are risky operations such as user fraud and gray market transactions. In order to ensure the accuracy of online predictions, the business model can be dynamically adapted and updated using online business data. It is understandable that online data is usually streaming data, which can be updated once a minute, once an hour, and so on. In this way, the incremental data generated online can be used to update the business model online.
[0062] Figure 4 FIG. 1 shows a flow chart of online updating of a business model according to an embodiment. The execution subject of the flow can be a computer, device, or server with certain computing capabilities. Figure 4 As shown, the process of online updating of the business model may include the following steps: step 401, determining a number of first samples of the training set and a number of second samples of the test set according to the current incremental data; step 402, using each first sample to update the weight of each base learner; step 403, using each second sample to verify the model index of the updated business model, so as to determine whether to add a new base learner to the business model according to the index value of the model index.
[0063] First, in step 401, a number of first samples of a training set and a number of second samples of a test set are determined according to the current incremental data.
[0064] It can be understood that online business data is streaming data, which can be collected at predetermined time intervals, such as once every 10 minutes, once every hour, and so on. The data collected within a single predetermined time interval is recorded as a batch of incremental data. Each batch of incremental data can be used to update the business model once. A batch of incremental data currently used to update the business model can be recorded as current incremental data.
[0065] Among them, the specific business data can be determined according to the corresponding business scenario. For example, in the business scenario involving online data and fund security, when the prediction target of the business model is whether there are risk operations such as user fraud and gray market transactions, the business data of a single training sample may include: context information of the user's current transaction, historical transaction information, user attribute information, whether the current transaction involves risk operations, etc. The corresponding business features can be extracted from the business data, and the target value describing whether there are risk operations such as user fraud and gray market transactions is determined. The business features and target values constitute the training samples.
[0066] According to the current value-added data, two sample sets can be determined, one as a training set and the other as a test set. For the convenience of description, the samples in the training set can be recorded as the first sample, and the samples in the prediction set can be recorded as the second sample.
[0067] Then, through step 402, the weights of the base learners are updated using the first samples.
[0068] It can be understood that the predicted value of the business model is determined by the business model f(x), and the prediction loss L is determined by the comparison between the predicted value and the target value y, such as L(y, f(x)). In order to update the weights, the business model is regarded as a function of the weights and business features, and the model parameters in each base learner are regarded as fixed values, then the prediction loss can be further recorded as L(y, ρ, x). According to the prediction loss, each weight ρ can be determined j The gradient of (j=1, 2, ..., M'), where M' represents the current number of base learners of the business model, which is greater than or equal to M.
[0069] According to a possible design, the corresponding prediction loss and the weights ρ under the corresponding samples and prediction losses can be determined by using each first sample in turn. j When the weight is updated by using the gradient, for a single weight, the gradient corresponding to a single first sample can be used to update it, or the gradient mean corresponding to multiple first samples can be used to update it.
[0070] According to some other possible designs, in order to better optimize the gradient of each weight, the gradient can be expressed using the Taylor series expansion and based on the Taylor series expansion. For example, the current weight is recorded as ρ0, and the second-level Taylor expansion is expressed as:
[0071]
[0072] in, is the change in the weight vector ρ at ρ0, and ΔL(y, x, ρ0) are the first and second derivatives of the prediction loss L with respect to the weight vector ρ. From this, we can know that: In this way, the gradient of the weight vector ρ can be determined based on the first-order derivative and second-order derivative of the weight vector ρ at ρ0
[0073] In order to make the sustainable update of each base learner in the business model more clear, we use ρ *-1 Represents the weight after the previous update, with ρ * represents the updated value in the current update cycle. Let ρ be *-1 The first-order derivative at is denoted as g * , then: Therefore, the weight vector ρ composed of the weights of each base learner can be updated to: ρ t =ρ t-1 -l r v t , l r is the preset learning rate.
[0074] In other possible designs, the weights of each base learner can be updated in other ways, which will not be described here one by one. The update of the weight is the update of the business model.
[0075] Furthermore, in step 403, each second sample is used to check the model index of the updated business model to determine whether to add a new base learner to the business model according to the index value of the model index.
[0076] In order to detect whether the updated business model is adapted to the new business data requirements, the model indicators of the updated business model can be tested using each second sample and measured with the indicator value. The model indicator here can be prediction accuracy, AUC indicator, PR curve, etc. The indicator value corresponding to the model indicator can be used to describe the performance of the updated business model on the second sample in the test set.
[0077] Usually, if the model indicators meet the predetermined conditions, the business model with updated weights can be used for subsequent business processing, such as continuing to predict whether there are risky operations such as user fraud and gray market transactions. If the model indicators do not meet the predetermined conditions, a new base learner can be added to the business model to adapt to the new business data distribution requirements. Figure 3 The method shown is carried out and will not be repeated here.
[0078] Reviewing the above process, the method for updating the business model provided under the technical concept of this specification is used to update the business model under the gradient boosting tree architecture. The business model may include several base learners, and the method for updating the business model may include two parts: offline update and online update. In order to enable the business model to be stably updated in the online prediction stage, the technical solution provided in this specification is based on the training concept of gradually increasing the number of base learners based on the gradient boosting tree when training the business model offline. For the newly added base learners used to fit the residuals, the orthogonal decomposition of the gradient is used to make it only fit the components with less correlation with the known base learners, thereby expanding the model space of the base learners and making the weighted coefficients of each base learner learnable.
[0079] In this way, in the online prediction stage, the streaming data can be used to update the weight coefficients of each base learner, thereby providing an effective solution for the continuous online update of the gradient boosting tree model, avoiding the unlimited increase in the scale of the prediction model, and optimizing the business processing results of the prediction model while maintaining the business processing efficiency of the prediction model, so that it can continuously adapt to new business data.
[0080] According to another embodiment, a device for training a business model is also provided. The device can be provided on a computer, terminal, or server with a certain computing capability. The business model here can be a weighted form of several base learners based on a gradient boosting tree architecture. Figure 5 An apparatus 500 for business model training according to one embodiment is shown.
[0081] like Figure 5 As shown, the apparatus 500 may include:
[0082] An acquisition unit 51 is configured to acquire each training sample, wherein each training sample corresponds to a business feature, a business target value, and a predicted value obtained by processing the business feature through a current business model;
[0083] A determining unit 52 is configured to determine a first gradient vector of the current business model on each training sample, wherein a single element of the first gradient vector corresponds to a single training sample;
[0084] A decomposition unit 53 is configured to perform orthogonal decomposition of the first gradient vector for each base learner in the current business model, so as to update the first gradient vector by a gradient component perpendicular to each base vector, wherein a single base vector is composed of a prediction value of a corresponding single base learner for each training sample;
[0085] The updating unit 54 is configured to obtain a new base learner and its weight with the goal of minimizing the residual determined according to the updated first gradient vector, thereby updating the current business model.
[0086] via Figure 5 The business model trained by the device shown can be used for online business processing, such as detecting whether there are risky operations such as user fraud, gray market transactions, etc. In order to ensure the accuracy of online predictions, the business model can be dynamically adapted and updated using online business data. Figure 6 A device for online updating of a business model according to an embodiment of the present specification is shown. The device can be set in a computer, terminal, or server with certain computing capabilities, such as a server that provides support for a platform for asset transactions for users.
[0087] like Figure 6 As shown, according to an embodiment, a device 600 for updating a business model online may include:
[0088] A sample determination unit 61 is configured to determine a number of first samples of a training set and a number of second samples of a test set according to current incremental data;
[0089] A weight updating unit 62 is configured to update the weights corresponding to the base learners respectively using the first samples;
[0090] The indicator detection unit 63 is configured to use a number of second samples to check the model indicator of the updated business model to determine whether to add a new base learner to the business model according to the indicator value of the model indicator.
[0091] It is worth mentioning that Figure 5 , Figure 6 The devices 500 and 600 shown are respectively Figure 3 , Figure 4 The method described corresponds to Figure 3 , Figure 4 The corresponding description in the illustrated method embodiment is also applicable to the devices 500 and 600 and will not be repeated here.
[0092] According to another embodiment, there is also provided a computer-readable storage medium having a computer program stored thereon, which, when executed in a computer, causes the computer to execute a combination of Figure 3 , Figure 4 The method described by et al.
[0093] According to another embodiment of the present invention, a computing device is provided, including a memory and a processor, wherein the memory stores executable code, and when the processor executes the executable code, the Figure 3 , Figure 4 The method described by et al.
[0094] Those skilled in the art should be aware that in one or more of the above examples, the functions described in the embodiments of this specification can be implemented by hardware, software, firmware, or any combination thereof. When implemented by software, these functions can be stored in a computer-readable medium or transmitted as one or more instructions or codes on a computer-readable medium.
[0095] The specific implementation methods described above further illustrate the purpose, technical solutions and beneficial effects of the technical concept of this specification. It should be understood that the above description is only the specific implementation method of the technical concept of this specification, and is not used to limit the protection scope of the technical concept of this specification. Any modifications, equivalent substitutions, improvements, etc. made on the basis of the technical solutions of the embodiments of this specification should be included in the protection scope of the technical concept of this specification.
Claims
1. A method for training a business model, wherein the business model is a weighted form of a plurality of base learners, and the method comprises a plurality of training cycles of adding base learners, and in a single training cycle: Acquire each training sample, each training sample corresponding to a business feature, a business target value, and a predicted value obtained by processing the business feature through the current business model; Determine a first gradient vector of the current business model on each training sample, wherein a single element of the first gradient vector corresponds to a gradient determined based on a single training sample; For each base learner in the current business model, respectively perform orthogonal decomposition of the first gradient vector to update the first gradient vector through a gradient component perpendicular to each base vector, wherein a single base vector is composed of a prediction value of a corresponding single base learner for each training sample; With the goal of minimizing the residual determined according to the updated first gradient vector, a new base learner and its weight are obtained, thereby updating the current business model.
2. The method according to claim 1, wherein determining the first gradient vector of the current business model on each training sample comprises: Based on the comparison between the business target value and the predicted value of each training sample, the prediction loss is determined by the sum of the losses of the current business model on each training sample; The first gradient vector is determined according to the partial derivative of the prediction loss with respect to the prediction result under each training sample.
3. The method of claim 1, wherein: The current business model includes a first basis learner, and the orthogonal decomposition of the first gradient vector is performed on each basis learner in the current business model to update the first gradient vector through a gradient component perpendicular to each basis vector, including: Determine a first basis vector corresponding to the first basis learner, where a single dimension of the first basis vector is a processing result of processing a single training sample by the first basis learner; determining a first component of the first gradient vector in the direction of the first basis vector according to the product of the first gradient vector and the first basis vector; The first gradient vector is updated by using a difference between the first gradient vector and the first component as a second component of the first gradient vector in a direction perpendicular to the first basis vector.
4. The method of claim 3, wherein: The first component is the product of the first basis vector and a first coefficient, and the first coefficient is: the ratio of the product of the first gradient vector and the first basis vector to the modulus of the first basis vector.
5. The method of claim 4, wherein: The first base learner corresponds to a first weight, and the method further includes: The first coefficient is used as the gradient corresponding to the first weight, and the first coefficient is updated along the gradient direction at a predetermined learning rate.
6. The method of claim 1, wherein: The step of obtaining a new base learner and its weight with the goal of minimizing the residual determined according to the updated first gradient vector, thereby updating the current business model includes: Determine the second base learner as the new base learner with the goal of minimizing the prediction loss on each training sample after adding the base learner; Determine a second weight corresponding to the second base learner with the goal of minimizing the prediction loss of the current business model on each training sample and the fitting result of the new base learner to the residual; The current service model is updated according to the product of the second weight and the second base learner.
7. A method for online updating of a business model, wherein the business model is a weighted sum of a plurality of base learners and is trained in the manner of claim 1; the method comprising: Determine a number of first samples of a training set and a number of second samples of a test set according to the current incremental data; Using the first samples, updating the weights corresponding to the base learners; The model index of the updated business model is tested by using the plurality of second samples, so as to determine whether to add a new base learner to the business model according to the index value of the model index.
8. The method of claim 7, wherein: The updating of the weights corresponding to the base learners respectively by using the first samples comprises: Determining the gradient of each weight according to the business processing result of each first sample by the business model; At a predetermined learning rate, each weight is updated according to the corresponding gradient.
9. The method of claim 7, wherein: Each base learner includes a third base learner, and the third base learner corresponds to a third weight. The determining the gradient of each weight according to the business processing result of each first sample by the business model includes: Using the business model to process the business results of each first sample, obtain a first predicted loss of the business model; Determine the gradients corresponding to each weight under the first prediction loss, wherein, for a single weight, the corresponding gradient is determined in the following manner: determine the first-order derivative and the second-order derivative of the first prediction loss with respect to the single weight; and obtain the gradient of the single weight by multiplying the inverse of the second-order derivative by the first-order derivative.
10. The method of claim 7, wherein: When the model indicators do not meet the predetermined conditions, a new base learner and corresponding weights are added to the business model using the method described in claim 1 to update the business model.
11. A business model training device, wherein the business model is a weighted form of several base learners, and the device comprises: An acquisition unit is configured to acquire each training sample, each training sample corresponding to a business feature, a business target value, and a predicted value obtained by processing the business feature through a current business model; A determining unit, configured to determine a first gradient vector of the current business model on each training sample, wherein a single element of the first gradient vector corresponds to a single training sample; a decomposition unit configured to perform orthogonal decomposition of the first gradient vector for each base learner in the current business model, so as to update the first gradient vector by a gradient component perpendicular to each base vector, wherein a single base vector is composed of a prediction value of a corresponding single base learner for each training sample; An updating unit is configured to obtain a new base learner and its weight with the goal of minimizing the residual determined according to the updated first gradient vector, thereby updating the current business model.
12. A device for online updating of a business model, wherein the business model is a weighted sum of a plurality of base learners and is trained by the device according to claim 11; the device for online updating comprises: A sample determination unit, configured to determine a plurality of first samples of a training set and a plurality of second samples of a test set according to current incremental data; A weight updating unit, configured to update the weights corresponding to the base learners respectively using the first samples; The indicator detection unit is configured to use the plurality of second samples to verify the model indicator of the updated business model, so as to determine whether to add a new base learner to the business model according to the indicator value of the model indicator.
13. A computer-readable storage medium having a computer program stored thereon, which, when executed in a computer, causes the computer to execute the method according to any one of claims 1 to 10.
14. A computing device comprising a memory and a processor, characterized in that: The memory stores executable codes, and when the processor executes the executable codes, the method according to any one of claims 1 to 10 is implemented.
Citation Information
Cited By
Systems and methods for improving accuracy of a primary predictive model based on a residual model
EP4745851A1
