A model online updating method and device
By updating the copy of the online tree model, the problems of model recession and business suspension are solved, and efficient model updates and business processing efficiency are achieved.
Patent Information
- Application Number
- CN202111397100.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-23
- Publication Date
- 2025-01-03
- Estimated Expiration
- 2041-11-23
AI Technical Summary
Existing tree models are prone to model decline after they are launched, resulting in poor prediction effects on new data. The offline update process requires pause of online services, which reduces business processing efficiency.
Update by obtaining a copy of the tree model running online, keeping the model structure unchanged, only the output value of the leaf nodes is updated, and weights are determined based on the attention of the new training sample set, weights are calculated and the output value is updated, and new replicas are formed. The tree model is then deployed online to replace the original model.
This enables the online tree model to be updated without offline, reduces business pause time, improves business processing efficiency, avoids increasing model complexity, and improves prediction accuracy.
Smart Images

Figure CN114091670B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present specification relate to the field of computer application technology, and more particularly to a method and device for online model updating. Background Art
[0002] At present, boosted tree models and gradient boosted decision tree models are widely used in various business scenarios, such as fraud identification scenarios. However, these tree models may have model degradation problems after they are launched. For example, the prediction effect on new data is poor.
[0003] In order to deal with the problem of model decay, the online tree model can be updated with new data. Usually, the online tree model needs to be processed offline before being updated.
[0004] During the offline update process, the related business of the online tree model will be suspended, reducing the business processing efficiency. Summary of the invention
[0005] In order to solve the above technical problems, the embodiments of this specification provide a model online updating method and device. The technical solution is as follows.
[0006] In a first aspect, an embodiment of the present specification provides a model online updating method, which specifically includes the following steps:
[0007] Obtain a copy of a preset tree model and a new training sample set; the preset tree model is: a boosted tree model currently running online or a gradient boosted decision tree model currently running online;
[0008] Determine the current leaf node output value of the replica as the old leaf node output value;
[0009] While keeping the replica structure unchanged, updating the leaf node output value of the replica according to the new training sample set, and determining the updated leaf node output value as the new leaf node output value;
[0010] Determining a first weight of the output value of the new leaf node and a second weight of the output value of the old leaf node according to the degree of attention paid to the new training sample set;
[0011] Using the determined first weight and second weight, for each leaf node of the replica, calculate a weighted sum of a corresponding new leaf node output value and a corresponding old leaf node output value, and update the output value of the leaf node to the weighted sum, to obtain a new replica tree model;
[0012] The new replica tree model is deployed online, and the new replica tree model is used to replace the preset tree model under preset circumstances.
[0013] Optionally, updating the leaf node output value of the replica according to the new training sample set includes:
[0014] Inputting the new training sample set into the replica, and determining the new training sample to which each leaf node in the replica is divided;
[0015] Update the output value of each leaf node according to the new training sample label value to which each leaf node is divided.
[0016] Optionally, maintaining the replica structure unchanged includes: maintaining conditions and thresholds for dividing each tree structure node in the replica unchanged.
[0017] Optionally, determining the first weight of the new leaf node output value and the second weight of the old leaf node output value according to the degree of attention to the new training sample set includes:
[0018] Determining the number of samples in the old training sample set used to train the preset tree model;
[0019] Determine the sum of the number of samples between the old training sample set and the new training sample set;
[0020] Determine the ratio of the number of samples in the old training sample set to the sum of the number of samples as the second weight of the output value of the old leaf node;
[0021] The ratio of the number of samples in the new training sample set to the sum of the number of samples is determined as the first weight of the output value of the new leaf node.
[0022] Optionally, the sum of the first weight and the second weight is a fixed value.
[0023] In a second aspect, the embodiments of this specification provide another model online updating method, which specifically includes the following steps:
[0024] Obtaining the leaf node output value of the preset tree model as the old leaf node output value; the preset tree model is: the boosted tree model currently running online or the gradient boosted decision tree model currently running online;
[0025] Acquire a new training sample set, and send the new training sample set online, so as to update the leaf node output value of the preset tree model according to the new training sample set while keeping the preset tree model structure unchanged;
[0026] Obtain the updated leaf node output value of the preset tree model as the new leaf node output value;
[0027] Determining a first weight of the output value of the new leaf node and a second weight of the output value of the old leaf node according to the degree of attention paid to the new training sample set;
[0028] Using the determined first weight and second weight, for each leaf node of the preset tree model, the weighted sum of the corresponding new leaf node output value and the corresponding old leaf node output value is calculated, and the weighted sum is sent online to update the output value of the leaf node to the weighted sum.
[0029] In a third aspect, the embodiments of this specification provide a model online updating device, which specifically includes the following units:
[0030] A copy acquisition unit is used to acquire a copy of a preset tree model and a new training sample set; the preset tree model is: a boosted tree model currently running online or a gradient boosted decision tree model currently running online; and the current leaf node output value of the copy is determined as the old leaf node output value;
[0031] A replica updating unit, configured to update the leaf node output value of the replica according to the new training sample set while keeping the replica structure unchanged, and determine the updated leaf node output value as the new leaf node output value;
[0032] A weighted sum unit, used to determine a first weight of the output value of the new leaf node and a second weight of the output value of the old leaf node according to the degree of attention to the new training sample set; using the determined first weight and second weight, for each leaf node of the replica, calculate the weighted sum of the corresponding new leaf node output value and the corresponding old leaf node output value, and update the output value of the leaf node to the weighted sum, so as to obtain a new replica tree model;
[0033] The online deployment unit is used to deploy the new replica tree model online, and the new replica tree model is used to replace the preset tree model under preset circumstances.
[0034] Optionally, the replica updating unit includes:
[0035] An input subunit, used to input the new training sample set into the replica, and determine the new training sample to which each leaf node in the replica is divided;
[0036] The updating subunit is used to update the output value of each leaf node according to the new training sample label value to which each leaf node is divided.
[0037] Optionally, the replica updating unit is used to: keep the conditions and thresholds for dividing each tree structure node in the replica unchanged.
[0038] Optionally, the weighted sum unit is used to:
[0039] Determining the number of samples in the old training sample set used to train the preset tree model;
[0040] Determine the sum of the number of samples between the old training sample set and the new training sample set;
[0041] Determine the ratio of the number of samples in the old training sample set to the sum of the number of samples as the second weight of the output value of the old leaf node;
[0042] The ratio of the number of samples in the new training sample set to the sum of the number of samples is determined as the first weight of the output value of the new leaf node.
[0043] Optionally, the sum of the first weight and the second weight is a fixed value.
[0044] In a fourth aspect, the embodiments of this specification provide another model online updating device, which specifically includes the following units:
[0045] An old output value acquisition unit, used to acquire the leaf node output value of a preset tree model as the old leaf node output value; the preset tree model is: a boosted tree model currently running online or a gradient boosted decision tree model currently running online;
[0046] A new output value acquisition unit is used to acquire a new training sample set and send the new training sample set online, so as to update the leaf node output value of the preset tree model according to the new training sample set while keeping the preset tree model structure unchanged; and acquire the updated leaf node output value of the preset tree model as a new leaf node output value;
[0047] A weight determination unit, configured to determine a first weight of the output value of the new leaf node and a second weight of the output value of the old leaf node according to the degree of attention paid to the new training sample set;
[0048] An updating unit is used to calculate the weighted sum of the corresponding new leaf node output value and the corresponding old leaf node output value for each leaf node of the preset tree model using the determined first weight and second weight, and send the weighted sum online to update the output value of the leaf node to the weighted sum.
[0049] The above technical solution can be updated by obtaining a copy of the preset tree model running online, and then deploying the updated copy tree model online to complete the update, so that the tree model running online does not need to be updated offline, reducing the time when the online tree model suspends business and improving business processing efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] In order to more clearly illustrate the embodiments of this specification or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the embodiments of this specification. For ordinary technicians in this field, other drawings can also be obtained based on these drawings.
[0051] Figure 1 It is a structural diagram of a preset tree model provided in an embodiment of this specification;
[0052] Figure 2 It is a flowchart of a model online updating method provided in an embodiment of this specification;
[0053] Figure 3 This is a schematic diagram of the principle of updating a leaf node provided by an embodiment of this specification;
[0054] Figure 4 It is a flowchart of another model online updating method provided in an embodiment of this specification;
[0055] Figure 5 It is a structural diagram of a model online updating device provided in an embodiment of this specification;
[0056] Figure 6 It is a structural schematic diagram of another model online updating device provided in an embodiment of this specification;
[0057] Figure 7 It is a structural diagram of a device used to configure the method of the embodiment of this specification. DETAILED DESCRIPTION
[0058] In order to enable those skilled in the art to better understand the technical solutions in the embodiments of this specification, the technical solutions in the embodiments of this specification will be described in detail below in conjunction with the drawings in the embodiments of this specification. Obviously, the described embodiments are only part of the embodiments of this specification, not all of the embodiments. Based on the embodiments in this specification, all other embodiments obtained by ordinary technicians in this field should belong to the scope of disclosure.
[0059] At present, boosted tree models and gradient boosted decision tree models can be widely used in various business scenarios, such as fraud identification scenarios.
[0060] The following explains the boosted tree model and the gradient boosted decision tree model respectively.
[0061] 1) The boosted tree model can contain multiple tree structures, and the tree structures have a sequence. Usually, the latter tree structure is used to fit the residual of the previous tree structure. When using the latter tree structure for fitting, it is usually necessary to determine the sample residual of the previous tree structure as the new sample label.
[0062] Each tree structure can be a regression decision tree, which is used to classify the input sample features. Specifically, any tree node can be divided according to the threshold of a certain sample feature. Different tree nodes can be divided according to different sample features, and the input samples are gradually divided into leaf nodes. Then, for each leaf node, the output value is determined according to the divided sample label. Specifically, the average value or mean square error can be calculated according to the label value of the divided sample as the output value, and then the residual between the label value and the output value can be determined for the divided sample according to the determined output value, and the residual is determined as the new label value of the sample, so as to facilitate the fitting of the next tree structure until the preset stop condition is met.
[0063] When using the boosted tree model for prediction, the feature data can be input into each tree structure of the boosted tree, and the output value of the leaf node where the feature data is divided is determined for each tree structure, and the determined output values are added together to obtain the predicted value.
[0064] 2) The gradient boosting decision tree model is similar to the boosting tree model. The difference is that in the gradient boosting decision tree model, the latter tree structure is used to fit the gradient of the loss function of the previous tree structure.
[0065] The gradient boosting decision tree model can contain multiple tree structures, and the tree structures have a sequence. Usually, the latter tree structure is used to fit the gradient of the loss function of the previous tree structure. When using the latter tree structure for fitting, it is usually necessary to determine the gradient of the loss function of the previous tree structure as the new sample label.
[0066] Each tree structure can be a regression decision tree, which is used to classify the input sample features. Specifically, it can be divided according to the threshold of a certain sample feature, and the input sample is gradually divided into leaf nodes. Then, for each leaf node, the output value is determined according to the divided sample label. Specifically, the average value or mean square error can be calculated according to the label value of the divided sample as the output value. Then, according to the determined output value, the gradient of the loss function can be determined for the divided sample, and the gradient is determined as the new label value of the sample, so as to facilitate the fitting of the next tree structure until the gradient of the loss function meets the preset stop condition.
[0067] When the gradient boosting decision tree model is used for prediction, the feature data can be input into each tree structure of the gradient boosting decision tree, the output value of the leaf node where the feature data is divided is determined for each tree structure, and the determined output values are added to obtain the predicted value.
[0068] For ease of understanding, Figure 1 As shown, it is a schematic diagram of the structure of a preset tree model provided in an embodiment of this specification. The preset tree model can specifically be a boosted tree model or a gradient boosted decision tree model. It includes 3 tree structures, namely tree structures 1-3. The order of the tree structures includes: from front to back, tree structure 1, tree structure 2 and tree structure 3.
[0069] After the preset tree model is trained, the feature threshold of the node division is determined, wherein the feature threshold of the node division in tree structure 1 is 5, the feature threshold of the node division in tree structure 2 is 9, and the feature threshold of the node division in tree structure 3 is 6.
[0070] Correspondingly, the output value of the leaf node corresponding to the eigenvalue greater than or equal to 5 in tree structure 1 is 2, and the output value of the leaf node corresponding to the eigenvalue less than 5 is 9. The output value of the leaf node corresponding to the eigenvalue greater than or equal to 9 in tree structure 2 is -1, and the output value of the leaf node corresponding to the eigenvalue less than 9 is 2. The output value of the leaf node with an eigenvalue greater than or equal to 6 in tree structure 3 is -0.3, and the output value of the leaf node corresponding to the eigenvalue less than 6 is 0.6.
[0071] Therefore, for data feature 7, the corresponding leaf node output values 2, 2 and -0.3 can be obtained in the three tree structures respectively, so that the predicted value 3.7 can be obtained.
[0072] In fraud identification scenarios, it is usually necessary to use a boosted tree model or a gradient boosted decision tree model based on the user's business data to determine the probability that the user has been defrauded, so as to identify whether the user has been defrauded.
[0073] For example, user business data may include the user's personal information (age range, gender, history of fraud, etc.), and may also include business information (business risk, business amount, business party credit, etc.).
[0074] In the boosted tree model, users can be divided into any leaf node of each tree structure based on age range, number of frauds, business risk, etc.
[0075] By adding up the output values of the leaf nodes to be divided, we can get the predicted value of the probability of the user being defrauded.
[0076] Specifically, a user's data may include: age 90, fraudulent 3 times, high business risk. If the age range is greater than 80, the user is divided into leaf node 1, and the output value of leaf node 1 is 0.8; if the number of frauds is greater than 1, the user is divided into leaf node 2, and the output value of leaf node 2 is +0.09; if the business risk is high, the user is divided into leaf node 3, and the output value of leaf node 3 is +0.03.
[0077] Therefore, the predicted value of the probability of the user being defrauded is 0.8+0.09+0.03=0.92.
[0078] Based on the above explanation, boosted tree models and gradient boosted decision tree models are usually run online to perform related tasks, such as calculating the probability prediction value of a user being defrauded.
[0079] However, this type of tree model may suffer from model degradation after it is launched, for example, poor prediction results for new data.
[0080] Causes of model degradation may include adversarial sample attacks from the black industry or fluctuations or drifts in feature data.
[0081] For example, in an adversarial sample attack, subtle perturbations that are imperceptible to some people are deliberately added to the input sample, causing the boosted tree model or gradient boosted decision tree model to give an incorrect output with high confidence.
[0082] In addition, feature data may fluctuate or drift over time, resulting in a decrease in the prediction effect of the boosted tree model or the gradient boosted decision tree model.
[0083] For example, in a fraud identification scenario, fraud can be identified based on average salary levels, but average salary levels can grow over time, which may cause the prediction accuracy of the boosted tree model to decrease.
[0084] For example, when dividing nodes according to age range, it is generally believed that people aged 30-50 are more vigilant, while people aged 50-80 are less vigilant because they are not adapted to social changes. However, as they age, people who were originally 30-50 years old will also become 50-80 years old, but because they understand social changes, their vigilance usually does not decrease, so the original boosting tree model prediction accuracy decreases.
[0085] In order to deal with problems such as model degradation and decreased accuracy, new data or adversarial samples can be used to continue training and updating based on the existing tree model, so that the updated tree model can learn this part of new data or adversarial samples and improve the prediction effect and prediction accuracy.
[0086] When performing training updates, it is usually necessary to change the structure of the boosted tree model or the gradient boosted decision tree model. Therefore, it is usually necessary to perform offline processing on the boosted tree model or the gradient boosted decision tree model running online before performing training updates.
[0087] During specific training updates, the original model has a poor prediction effect on new data, which is usually manifested as a large difference between the predicted value and the actual label value, that is, a large residual. Therefore, when training and updating the boosted tree model or gradient boosted decision tree model, the new tree structure is usually fitted based on the residual or loss function gradient of the new data, so that the model can be updated quickly. In other words, the boosted tree model or gradient boosted decision tree model is continuously improved.
[0088] However, during the offline training and updating process, the related business of the online tree model will be suspended, which reduces the business processing efficiency.
[0089] In addition, although the model can be updated quickly by fitting with a new tree structure, frequent model updates often lead to increasing model complexity.
[0090] In some scenarios, adversarial sample attacks usually occur frequently, and feature data may fluctuate or drift frequently, resulting in the need for frequent iterative training of the tree model, which in turn leads to an increasing number of tree structures.
[0091] For example, in the scenario of fraud identification, the characteristic data of fraud events may change every day, and attacks by adversarial samples may also occur every day. If the boosted tree model or gradient boosted decision tree model is iteratively updated and trained every day, a large number of new tree structures will be required, and the complexity of the tree model will be high.
[0092] Therefore, if the boosted tree model or gradient boosted decision tree model adds several new tree structures every time the training is updated, it is easy to cause the expansion of the tree model, increase the complexity of the model, and lead to a decrease in computational efficiency and a decrease in prediction speed.
[0093] In order to avoid the reduction of service processing effect caused by offline update, the embodiment of this specification provides a model online update method. The method updates the preset tree model, which can be the boosted tree model or gradient boosted decision tree model currently running online.
[0094] In this method, a copy of the preset tree model running online can be obtained and trained and updated for the copy, thereby eliminating the need for offline processing of the preset tree model currently running online. After the copy training and update is completed, it can also be directly deployed online to complete the update, thereby ensuring that the related business of the online tree model will not be suspended, thereby improving business processing efficiency.
[0095] In addition, in this method, in order to avoid the complexity of the preset tree model being continuously increased due to training updates, during iterative training, only the output values of the leaf nodes of the preset tree model are updated, and the structure of the preset tree model is not updated, and no new tree structure is added to the preset tree model, thereby avoiding increasing the complexity of the preset tree model, improving the stability of the preset tree model, and realizing fast iterative training and saving computing resources.
[0096] A model online updating method provided in an embodiment of this specification is explained in detail below with reference to the accompanying drawings.
[0097] like Figure 2 FIG. 1 is a flow chart of a model online update method provided in an embodiment of the present specification. The method can be applied to electronic devices, for example, to update a client, an update server, etc.
[0098] The method can be used to update an online preset tree model. The preset tree model can specifically include a boosted tree model currently running online or a gradient boosted decision tree model currently running online. The method can include the following steps.
[0099] S101: Obtain a copy of a preset tree model and a new training sample set.
[0100] S102: Determine the current leaf node output value of the replica as the old leaf node output value; while keeping the replica structure unchanged, update the leaf node output value of the replica according to the new training sample set, and determine the updated leaf node output value as the new leaf node output value.
[0101] S103: Determine a first weight of the output value of the new leaf node and a second weight of the output value of the old leaf node according to the degree of attention paid to the new training sample set.
[0102] S104: Using the determined first weight and second weight, for each leaf node of the replica, calculate the weighted sum of the corresponding new leaf node output value and the corresponding old leaf node output value, and update the output value of the targeted leaf node to the calculated weighted sum to obtain a new replica tree model.
[0103] S105: deploying a new replica tree model online, where the new replica tree model is used to replace the preset tree model under preset circumstances.
[0104] The above method process obtains a copy of the preset tree model for training and updating, so that the preset tree model currently running online does not need to be processed offline, thereby eliminating the need to suspend related businesses of the preset tree model, thereby improving business processing efficiency.
[0105] In addition, when training and updating a copy of the preset tree model, the above method process only updates the leaf node output value of the copy, but does not update the structure of the copy, so that there is no need to add a new tree structure for training and updating, avoiding the continuous increase in the complexity of the preset tree model after the update.
[0106] The following is a detailed explanation of each step.
[0107] S101: Obtain a copy of a preset tree model and a new training sample set.
[0108] Optionally, the preset tree model may specifically include a boosted tree model currently running online or a gradient boosted decision tree model currently running online.
[0109] The method flow does not limit how to obtain the new training sample set. It can be obtained from data that generates characteristic data fluctuations or drifts, or it can be obtained by automatically constructing adversarial samples. In an optional embodiment, the new training sample set can be labeled. In an optional embodiment, the new training sample set can include only newly acquired new training samples, or it can include new training samples and old training samples used to train a preset tree model.
[0110] In an optional embodiment, a copy of the preset tree model may be obtained, and the copy may be completely identical to the preset tree model. Specifically, all data of the preset tree model may be copied to obtain a copy of the preset tree model.
[0111] Optionally, the replica has the same structure as the preset tree model. To make it easier to clarify the structure of the replica, the replica may also be referred to as a replica tree model.
[0112] Optionally, the structure of the replica tree model may include: tree structure, nodes in the tree structure, conditions and thresholds for node division, etc. If the structure of the replica tree model is the same as that of the preset tree model, it can be explained that the number and order of tree structures between the replica tree model and the preset tree model are the same, and the tree structures of the same order are also the same. Specifically, the number of nodes, node positions, and conditions and thresholds for node division in the tree structures of the same order are all the same, etc.
[0113] It should be noted that in the process of training the preset tree model, it takes the longest time to determine the threshold for node division, which requires constant adjustment and trial, and consumes the most computing resources.
[0114] Optionally, the replica can be used to perform training updates based on the acquired new training sample set. Using the replica for training updates can avoid suspending online business processing due to updating the preset tree model while the preset tree model is deployed online, thereby improving business processing efficiency.
[0115] S102: Determine the current leaf node output value of the replica as the old leaf node output value; while keeping the replica structure unchanged, update the leaf node output value of the replica according to the new training sample set, and determine the updated leaf node output value as the new leaf node output value.
[0116] In the process of this method, the specific training and updating of the replica tree model needs to comprehensively consider the influence of the original model and the new training sample set, and because only the leaf node output value of the replica tree model is updated, it is necessary to first determine the new leaf node output value and the old leaf node output value.
[0117] In an optional embodiment, for the old leaf node output value, optionally, the leaf node output value of the preset tree model can be directly obtained and determined as the old leaf node output value; optionally, since the copy tree model can be exactly the same as the preset tree model, the current leaf node output value of the copy tree model can be directly determined as the old leaf node output value.
[0118] In an optional embodiment, the output value of the new leaf node may be determined according to the new training sample set.
[0119] Optionally, updating the leaf node output value of the replica tree model according to the new training sample set may include: inputting the new training sample set into the replica tree model, determining the new training sample to which each leaf node in the replica tree model is divided; and updating the output value of the leaf node according to the new training sample label value to which each leaf node is divided.
[0120] The method flow does not limit the specific method of updating the leaf node output value according to the sample label value.
[0121] Optionally, updating the output value of each leaf node according to the new training sample label value to which each leaf node is divided may include: determining, for each leaf node, a comprehensive calculation result of the new training sample label value to which the leaf node is divided, and updating the output value of the leaf node to the determined comprehensive calculation result. The comprehensive calculation result may include an average value, a mean square error, a mode, etc.
[0122] Optionally, updating the output value of each leaf node according to the new training sample label value to which each leaf node is divided may include: for each leaf node, determining the comprehensive calculation result of the new training sample label value to which the leaf node is divided, then calculating the weighted sum of the comprehensive calculation result and the output value of the old leaf node corresponding to the leaf node, and updating the output value of the leaf node to the calculated weighted sum. The comprehensive calculation result may include an average value, a mean square error, a mode, etc.
[0123] Optionally, when calculating the weighted sum of the comprehensive calculation result and the output value of the old leaf node corresponding to the leaf node, this embodiment does not limit the specific method of determining the weight. Optionally, it can be adjusted based on experience, determined based on the importance or attention of the new training sample set, or determined based on the proportion of the number of samples.
[0124] In an optional embodiment, the replica tree model after updating the leaf node output value is trained based on a new training sample set, and has a better fitting effect on the new training sample set, thereby learning new data or adversarial samples.
[0125] In an optional embodiment, the replica tree model after updating the leaf node output value is trained based on the new training sample set, and has a better fitting effect on the new training sample set, thereby learning new data or adversarial samples. In addition, the new training sample set may also include training samples for training the preset tree model, so that the influence of new and old data can be combined, the number of samples can be increased, and the training effect and the fitting effect of the updated replica tree model on new and old data can be improved.
[0126] Alternatively, when updating the leaf node output value of the replica tree model, the sample label value and the old leaf node output value can be comprehensively considered to calculate the weighted sum, thereby also integrating the influence of new and old data, improving the training effect and the fitting effect of the updated replica tree model on the new and old data.
[0127] In a specific scenario, for example, in a fraud method identification scenario, the fraud methods can be continuously updated, and the fraud methods in the old data also need to be identified. Therefore, when updating the replica tree model, the new data and the old data can be combined for updating.
[0128] In an optional embodiment, keeping the replica structure unchanged may specifically include: keeping the conditions and thresholds for dividing each tree structure node in the replica unchanged.
[0129] For ease of understanding, in an optional embodiment, in any tree structure of the replica tree model, any parent node can be divided by conditions and thresholds to divide the input data into different child nodes. For example, a parent node can be connected to two child nodes, namely the first child node and the second child node. According to the condition with a threshold that the age range is greater than 60, the data in the input data that meets this condition is divided into the first child node; according to the condition with a threshold that the age range is less than or equal to 60, the data in the input data that meets this condition is divided into the second child node. Until the leaf node is divided, the output value corresponding to the leaf node can be determined.
[0130] Optionally, the tree structure included in the replica tree model may not be added, and specifically, the number and order of the tree structures in the replica tree model may be kept unchanged.
[0131] During iterative training, when training a newly added tree structure, it usually consumes more computing resources to determine the conditions and thresholds for node division, and the training time is longer. For example, on the conditions for any node division, you can try to change the condition type, adjust the threshold, etc. to determine the loss situation, so that you can adjust it again. This training method is more cumbersome and consumes more computing resources.
[0132] Therefore, while keeping the replica structure unchanged, there is no need to add a new tree structure, nor to change the conditions and thresholds for node division in the replica tree model, thereby saving computing resources and reducing training time, so that iterative updates can be quickly achieved, avoiding model expansion and increasing model complexity.
[0133] S103: Determine a first weight of the output value of the new leaf node and a second weight of the output value of the old leaf node according to the degree of attention paid to the new training sample set.
[0134] After the new and old leaf node output values are determined in S102, the old leaf node output value can represent the original preset tree model, and the new leaf node output value can represent the updated copy tree model. Therefore, the new and old leaf node output values can be comprehensively considered to determine the final tree model to be updated.
[0135] Of course, in an optional embodiment, the updated replica tree model may be directly determined as the final tree model to be updated for online updating.
[0136] In another optional embodiment, weights can be determined for the new and old leaf node output values respectively, so as to facilitate the calculation of the weighted sum. Obviously, the weight of the old leaf node output value can be determined as 0, so that the updated replica tree model can be directly determined as the final tree model to be updated.
[0137] In the process of this method, the specific method of determining the weight is not limited.
[0138] Optionally, the first weight of the new leaf node output value and the second weight of the old leaf node output value may be determined based on experience, or the importance of the new training sample set, or the degree of attention paid to the new training sample set.
[0139] For example, if there is an actual business demand in the acquired new training sample set and it is necessary to focus on fitting this new training sample set, the first weight of the output value of the new leaf node can be increased based on experience.
[0140] For another example, if the acquired new training sample set requires the prediction accuracy of the new training sample set to reach 90%, the first weight of the output value of the new leaf node may be determined according to the importance of the new training sample set.
[0141] Correspondingly, the second weight of the old leaf node output value can also be determined based on experience, or the importance or attention level of the old data.
[0142] In an optional embodiment, the first weight and the second weight may be determined according to the number of samples used for training.
[0143] Optionally, the number of samples in the old training sample set used to train the preset tree model can be determined; the sum of the number of samples between the old training sample set and the new training sample set can be determined; the ratio of the number of samples in the old training sample set to the sum of the number of samples is determined as the second weight of the output value of the old leaf node; and the ratio of the number of samples in the new training sample set to the sum of the number of samples is determined as the first weight of the output value of the new leaf node.
[0144] In addition, since the determined weight can be used to calculate the weighted sum of the new leaf node output value and the old leaf node output value in subsequent steps, in order to ensure that the weighted sum can be used as the output value of the leaf node, in an optional embodiment, the sum of the first weight and the second weight can be a fixed value. Optionally, the sum of the first weight and the second weight can be 1.
[0145] Correspondingly, optionally, after determining the first weight of the output value of the new leaf node, the second weight may be determined directly according to the fixed value, and specifically, the difference between the fixed value and the first weight may be determined as the second weight.
[0146] By limiting the sum of the weights of the new leaf node output value and the old leaf node output value to a fixed value, it is convenient to weigh the relationship between the updated copy tree model and the original preset tree model, and specifically, it is convenient to weigh the degree of influence between the new data and the old data.
[0147] When the second weight of the old leaf node output value is 0, the update of the leaf node output value of the preset tree model is completely determined by the updated replica tree model. The updated replica tree model can be directly determined as the final tree model to be updated for model online update.
[0148] S104: Using the determined first weight and second weight, for each leaf node of the replica, calculate the weighted sum of the corresponding new leaf node output value and the corresponding old leaf node output value, and update the output value of the targeted leaf node to the calculated weighted sum to obtain a new replica tree model.
[0149] In an optional embodiment, since the structure of the replica tree model does not change before and after the leaf node output value is updated, the replica tree model before and after the update still maintains the same structure as the preset tree model. Specifically, the leaf nodes at the same position of the replica tree model and the preset tree model can correspond to each other.
[0150] Optionally, when the current leaf node output value of the preset tree model is obtained and determined to be the old leaf node output value, the old leaf node output value corresponding to each leaf node of the copy may be the output value of the leaf node of the preset tree model corresponding to each leaf node of the copy.
[0151] S104 can calculate the weighted sum of the output values of the new and old leaf nodes, and then complete the update of the replica tree model to obtain the final tree model to be updated, that is, the new replica tree model.
[0152] It should be noted that the replica tree model has updated the leaf node output values according to the new training sample set to obtain new leaf node output values in S102. S104 can be regarded as the second update of the leaf node output values of the replica tree model, which is specifically an update that combines the new and old leaf node output values.
[0153] In an optional embodiment, S103 and S104 can be combined into: for each leaf node of the replica, calculate the weighted sum of the corresponding new leaf node output value and the corresponding old leaf node output value, and update the output value of the targeted leaf node to the calculated weighted sum to obtain a new replica tree model.
[0154] In this embodiment, the method for determining the weights of the output values of the new and old leaf nodes is not limited, and the weights may be determined according to the method of S103.
[0155] S105: deploying a new replica tree model online, where the new replica tree model is used to replace the preset tree model under preset circumstances.
[0156] In an optional embodiment, a new replica tree model that has learned a new training sample set may be deployed online to facilitate subsequent online updates.
[0157] The method flow does not limit the method of performing online update. Specifically, the method flow does not limit the preset situation.
[0158] Optionally, an AB test may be performed on the new replica tree model and the preset tree model, so as to select a tree model with better prediction effect to continue to perform related services online. Correspondingly, the preset situation may include: the prediction effect of the new replica number model online is better than the preset tree model.
[0159] Optionally, the new replica tree model may be directly substituted for the preset tree model without testing. Correspondingly, the preset situation may include: the situation where the new replica tree model is deployed online.
[0160] The new replica tree model can slow down the model decay problem and improve prediction accuracy by learning new data or adversarial samples.
[0161] On the one hand, the above method process improves the efficiency of business processing by training and updating the copy of the preset tree model without suspending the related business of the preset tree model running online, and can also avoid directly modifying the preset tree model. On the other hand, by keeping the structure of the preset tree model unchanged, only the output value of the leaf node in the preset tree model is updated according to the new training sample set. On the basis of using the new training sample set to help alleviate the problem of model decay, it can avoid adding several tree structures to the preset tree model, avoid model expansion, avoid increasing model complexity, and also realize fast iterative training, reduce the loss of computing resources, and increase the update speed.
[0162] It should be noted that if frequent iterative updates are required, the above method flow can be used to update each new set of training samples obtained each time. Only the output values of the leaf nodes can be updated without adding a new tree structure, thereby avoiding model expansion caused by adding a new tree structure.
[0163] For ease of understanding, the embodiments of this specification also provide an application embodiment.
[0164] like Figure 3 FIG. 1 is a schematic diagram of a leaf node update principle provided by an embodiment of the present specification, which includes a preset tree model and a replica tree model.
[0165] The preset tree model is obtained by training the old training sample set, including two tree structures, namely tree structure 1 and 2. The node division threshold of tree structure 1 is 4, the output value of the leaf node corresponding to the eigenvalue greater than or equal to 4 is 5, and the output value of the leaf node corresponding to the eigenvalue less than 4 is 10. The node division threshold of tree structure 2 is 9, the output value of the leaf node corresponding to the eigenvalue greater than or equal to 9 is -1, and the output value of the leaf node corresponding to the eigenvalue less than 9 is 1.
[0166] The structure of the replica tree model is consistent with that of the preset tree model. However, after the replica tree model is trained based on the new training sample set, the output value of the leaf node in each tree structure can be updated. Specifically, it can be determined that in tree structure 1, the output value of the leaf node corresponding to the eigenvalue greater than or equal to 4 is 4, and the output value of the leaf node corresponding to the eigenvalue less than 4 is 12. In tree structure 2, the output value of the leaf node corresponding to the eigenvalue greater than or equal to 9 is -3, and the output value of the leaf node corresponding to the eigenvalue less than 9 is 2.
[0167] Afterwards, the weights of the preset tree model and the replica tree model can be determined respectively, which can be determined based on the importance of the new training sample set or the proportion of the sample quantity.
[0168] Finally, it can be determined that the weight of the preset tree model is 0.5, that is, the weight of the old leaf node output value of the preset tree model is 0.5, while the weight of the copy tree model is 0.5, and the weight of the new leaf node output value of the copy tree model is 0.5.
[0169] Then, the weighted sum of the leaf node output values can be calculated according to the weights. Specifically, in tree structure 1, the output value of the leaf node corresponding to the eigenvalue greater than or equal to 4 is 4.5 (5*0.5+4*0.5=4.5), and the output value of the leaf node corresponding to the eigenvalue less than 4 is 11 (10*0.5+12*0.5). In tree structure 2, the output value of the leaf node corresponding to the eigenvalue greater than or equal to 9 is -2 (-1*0.5+-3*0.5), and the output value of the leaf node corresponding to the eigenvalue less than 9 is 1.5 (1*0.5+2*0.5).
[0170] Therefore, the leaf node output values of the preset tree model can be updated according to the calculated weighted sum to obtain an updated preset tree model.
[0171] In addition, when specifically updating the preset tree model, since the structure of the preset tree model can be kept unchanged and only the leaf node output values of the preset tree model are updated, in an optional embodiment, it is possible not to use a copy for updating and directly update the online preset tree model according to the new leaf node output values.
[0172] Since there is no structural change involved, only the data is changed, online updates can be completed quickly, with less impact on business processing, improving business processing efficiency and reducing operational complexity.
[0173] like Figure 4 As shown, it is a flowchart of another model online update method provided by an embodiment of this specification. The method can be applied to electronic devices. For example, update client, update server, etc. The method can include the following steps.
[0174] S201: Obtain the leaf node output value of the preset tree model as the old leaf node output value.
[0175] Optionally, the preset tree model is: a boosted tree model currently running online or a gradient boosted decision tree model currently running online.
[0176] Optionally, it is possible to directly communicate with the online system to directly obtain the leaf node output value of the preset tree model and determine it as the old leaf node output value.
[0177] S202: Obtain a new training sample set and send the new training sample set online so that the leaf node output values of the preset tree model can be updated according to the new training sample set while keeping the preset tree model structure unchanged, and the leaf node output values of the updated preset tree model can be obtained as new leaf node output values.
[0178] For the explanation of obtaining a new training sample set, please refer to the explanation of S101 above.
[0179] In an optional embodiment, the data is usually sent online and processed by a preset tree model, and prediction can be made directly. Optionally, a new training sample set is sent online, which can trigger a specific program to update the leaf node output value of the preset tree model according to the new training sample set.
[0180] For a detailed explanation of the updating process, please refer to the explanation of S102 above.
[0181] Optionally, the online preset tree model can directly update its leaf node output value. Since there is no need to change the structure, only the leaf node output value data is changed, so fast updates can be achieved without offline processing, thus improving business processing efficiency.
[0182] Optionally, the online preset tree model can also retain the original leaf node output value first, and add the updated leaf node output value. On the one hand, the original leaf node output value can continue to be used for business processing to avoid business fluctuations and improve business processing efficiency. On the other hand, the updated leaf node output value can also be obtained and sent locally for subsequent calculation of weighted sum.
[0183] Optionally, when updating the output value of a leaf node, the online preset tree model can input a new training sample set into the preset tree model running online to determine the new training sample to which each leaf node in the preset tree model is divided; and update the output value of the leaf node according to the label value of the new training sample to which each leaf node is divided.
[0184] Optionally, after the online preset tree model updates the leaf node output value, the leaf node output value after the preset tree model is updated can be directly obtained online and determined as the new leaf node output value.
[0185] S203: Determine a first weight of the output value of the new leaf node and a second weight of the output value of the old leaf node according to the degree of attention paid to the new training sample set.
[0186] The explanation of determining the first weight and the second weight may refer to the explanation of S103 above.
[0187] S204: Using the determined first weight and second weight, for each leaf node of the preset tree model, calculate the weighted sum of the corresponding new leaf node output value and the corresponding old leaf node output value, and send the calculated weighted sum online to update the output value of the leaf node to the weighted sum.
[0188] After the weighted sum is obtained by local calculation, it can be sent directly to the online site, and the leaf node output values of the preset tree model can be directly updated to obtain the updated preset tree model.
[0189] It should be noted that in the process of this method, the online preset tree model is updated twice. The first update is performed in S202 according to the new training sample set, and the second update is to directly update the leaf node output value of the preset tree model to the weighted sum.
[0190] For the explanation of calculating the weighted sum, please refer to the explanation of S104 above.
[0191] Optionally, since the preset tree model only updates the leaf node output value data without changing the structure, the online preset tree model can be quickly updated without offline processing. Specifically, the current leaf node output value of the preset tree model can be replaced with the corresponding weighted sum during the gap in business execution to complete the update, thereby improving business processing efficiency.
[0192] The detailed explanation of the above method flow S201-S204 can refer to the explanation of S101-S105.
[0193] In an optional embodiment, the explanations of steps S101 - S105 and S201 - S204 may complement each other and may be combined into different embodiments.
[0194] In addition, since the above-mentioned technical solution keeps the structure of the preset tree model unchanged and only updates the output values of the leaf nodes in the preset tree model according to the new training sample set, the above-mentioned technical solution can also be updated directly online by directly transmitting the new leaf node output values for updating, and there is no need to update other data of the preset tree model, thereby reducing the time when the online tree model suspends business and improving business processing efficiency.
[0195] In addition to using new training sample sets to help mitigate the problem of model decay, it can also prevent the tree model from expanding due to the addition of new tree structures and increase model complexity.
[0196] Corresponding to the above method flow, the embodiments of this specification also provide device embodiments.
[0197] like Figure 5FIG. 1 is a schematic diagram of a structure of a model online updating device provided in an embodiment of the present specification. The device may include the following units.
[0198] The copy acquisition unit 301 is used to obtain a copy of the preset tree model and a new training sample set; the preset tree model is: the boosted tree model currently running online or the gradient boosted decision tree model currently running online; and the current leaf node output value of the copy is determined as the old leaf node output value.
[0199] The replica updating unit 302 is used to update the leaf node output value of the replica according to the new training sample set while keeping the replica structure unchanged, and determine the updated leaf node output value as the new leaf node output value.
[0200] The weighted sum unit 303 is used to determine the first weight of the new leaf node output value and the second weight of the old leaf node output value according to the degree of attention paid to the new training sample set; using the determined first weight and second weight, for each leaf node of the copy, the weighted sum of the corresponding new leaf node output value and the corresponding old leaf node output value is calculated, and the output value of the leaf node is updated to the calculated weighted sum to obtain a new copy tree model.
[0201] The online deployment unit 304 is used to deploy the new replica tree model online, and the new replica tree model is used to replace the preset tree model under preset circumstances.
[0202] Optionally, the replica updating unit 302 includes: an input subunit 302a, configured to input a new training sample set into the replica, and determine a new training sample to which each leaf node in the replica is divided.
[0203] The updating subunit 302b is used to update the output value of each leaf node according to the new training sample label value to which each leaf node is divided.
[0204] Optionally, the replica updating unit 302 is used to keep the conditions and thresholds for dividing each tree structure node in the replica unchanged.
[0205] Optionally, the weighted sum unit 303 is used to: determine the number of samples in the old training sample set used to train the preset tree model; determine the sum of the number of samples between the old training sample set and the new training sample set; determine the ratio of the number of samples in the old training sample set to the sum of the number of samples as the second weight of the output value of the old leaf node; determine the ratio of the number of samples in the new training sample set to the sum of the number of samples as the first weight of the output value of the new leaf node.
[0206] Optionally, the sum of the first weight and the second weight is a fixed value.
[0207] like Figure 6FIG. 1 is a schematic diagram of another model online updating device provided in an embodiment of the present specification. The device may include the following units.
[0208] The old node acquisition unit 401 is used to obtain the leaf node output value of the preset tree model as the old leaf node output value; the preset tree model is: the boosted tree model currently running online or the gradient boosted decision tree model currently running online.
[0209] The new output value acquisition unit 402 is used to acquire a new training sample set and send the new training sample set online so as to update the leaf node output value of the preset tree model according to the new training sample set while keeping the preset tree model structure unchanged; the leaf node output value of the updated preset tree model is acquired as the new leaf node output value.
[0210] The weight determination unit 403 is used to determine the first weight of the new leaf node output value and the second weight of the old leaf node output value according to the attention level of the new training sample set.
[0211] The updating unit 404 is used to calculate the weighted sum of the corresponding new leaf node output value and the corresponding old leaf node output value for each leaf node of the preset tree model using the determined first weight and second weight, and send the weighted sum online to update the output value of the leaf node to the weighted sum.
[0212] The specific explanation of the above two device embodiments can be found in the above method flow.
[0213] An embodiment of the present specification also provides a computer device, which includes at least a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the model online update method described in any of the above embodiments is implemented.
[0214] Figure 7 A more specific hardware structure diagram of a computer device provided in an embodiment of this specification is shown, and the device may include: a processor 1010, a memory 1020, an input / output interface 1030, a communication interface 1040, and a bus 1050. The processor 1010, the memory 1020, the input / output interface 1030, and the communication interface 1040 are connected to each other through the bus 1050 in the device.
[0215] The processor 1010 can be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this specification.
[0216] The memory 1020 may be implemented in the form of ROM (Read Only Memory), RAM (Random Access Memory), static storage device, dynamic storage device, etc. The memory 1020 may store an operating system and other application programs. When the technical solutions provided in the embodiments of this specification are implemented by software or firmware, the relevant program codes are stored in the memory 1020 and are called and executed by the processor 1010.
[0217] The input / output interface 1030 is used to connect the input / output module to realize information input and output. The input / output module can be configured in the device as a component (not shown in the figure), or it can be externally connected to the device to provide corresponding functions. The input device may include a keyboard, a mouse, a touch screen, a microphone, various sensors, etc., and the output device may include a display, a speaker, a vibrator, an indicator light, etc.
[0218] The communication interface 1040 is used to connect a communication module (not shown) to realize communication interaction between the device and other devices. The communication module can realize communication through a wired mode (such as USB, network cable, etc.) or a wireless mode (such as mobile network, WIFI, Bluetooth, etc.).
[0219] The bus 1050 includes a path that transmits information between the various components of the device (eg, the processor 1010, the memory 1020, the input / output interface 1030, and the communication interface 1040).
[0220] It should be noted that, although the above device only shows the processor 1010, the memory 1020, the input / output interface 1030, the communication interface 1040 and the bus 1050, in the specific implementation process, the device may also include other components necessary for normal operation. In addition, it can be understood by those skilled in the art that the above device may also only include the components necessary for implementing the embodiments of the present specification, and does not necessarily include all the components shown in the figure.
[0221] The embodiments of the present specification also provide a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the model online updating method described in any of the above embodiments is implemented.
[0222] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0223] It can be known from the above description of the implementation mode that the technicians in this field can clearly understand that the embodiments of this specification can be implemented by means of software plus the necessary general hardware platform. Based on such an understanding, the technical solution of the embodiments of this specification can be essentially or the part that contributes to the prior art can be embodied in the form of a software product, which can be stored in a storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments of this specification.
[0224] The systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer, which may be in the form of a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email transceiver, a game console, a tablet computer, a wearable device or a combination of any of these devices.
[0225] Each embodiment in this specification is described in a progressive manner, and the same and similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment. The device embodiment described above is merely schematic, wherein the modules described as separate components may or may not be physically separated, and the functions of each module can be implemented in the same one or more software and / or hardware when implementing the embodiment scheme of this specification. It is also possible to select some or all of the modules according to actual needs to achieve the purpose of the embodiment scheme. A person of ordinary skill in the art can understand and implement it without paying creative labor.
[0226] The above is only a specific implementation of the embodiments of this specification. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the embodiments of this specification. These improvements and modifications should also be regarded as protection for the embodiments of this specification.
Claims
1. A model online updating method, comprising: Get a copy of the preset tree model and a new set of training samples; The preset tree model is: a boosted tree model currently running online or a gradient boosted decision tree model currently running online; the new training sample set includes the business data of the user; the preset tree model is used to determine the predicted value of the probability of the user being defrauded according to the business data of the user; the business data includes at least one of the following items: historical experience of being defrauded, business risk and credit of the business party; Determine the current leaf node output value of the replica as the old leaf node output value; While keeping the replica structure unchanged, updating the leaf node output value of the replica according to the new training sample set, and determining the updated leaf node output value as the new leaf node output value; Determining a first weight of the output value of the new leaf node and a second weight of the output value of the old leaf node according to the degree of attention paid to the new training sample set; Using the determined first weight and second weight, for each leaf node of the replica, calculate a weighted sum of a corresponding new leaf node output value and a corresponding old leaf node output value, and update the output value of the leaf node to the weighted sum, to obtain a new replica tree model; The new replica tree model is deployed online, and the new replica tree model is used to replace the preset tree model under preset circumstances.
2. The method according to claim 1, wherein updating the leaf node output value of the replica according to the new training sample set comprises: Inputting the new training sample set into the replica, and determining the new training sample to which each leaf node in the replica is divided; Update the output value of each leaf node according to the new training sample label value to which each leaf node is divided.
3. The method according to claim 1, wherein keeping the replica structure unchanged comprises: The conditions and thresholds for dividing each tree structure node in the copy are kept unchanged.
4. The method according to claim 1, wherein determining the first weight of the new leaf node output value and the second weight of the old leaf node output value according to the degree of attention to the new training sample set comprises: Determining the number of samples in the old training sample set used to train the preset tree model; Determine the sum of the number of samples between the old training sample set and the new training sample set; Determine the ratio of the number of samples in the old training sample set to the sum of the number of samples as the second weight of the output value of the old leaf node; The ratio of the number of samples in the new training sample set to the sum of the number of samples is determined as the first weight of the output value of the new leaf node. The method according to claim 1 , wherein the sum of the first weight and the second weight is a fixed value.
6. A model online updating method, comprising: Get the leaf node output value of the preset tree model as the old leaf node output value; The preset tree model is: a boosted tree model currently running online or a gradient boosted decision tree model currently running online; the preset tree model is used to determine the predicted value of the probability of the user being defrauded according to the user's business data; the business data includes at least one of the following items: historical experience of being defrauded, business risk, and credit of the business party; Acquire a new training sample set, and send the new training sample set online, so as to update the leaf node output value of the preset tree model according to the new training sample set while keeping the preset tree model structure unchanged; The new training sample set includes the user's business data; Obtain the updated leaf node output value of the preset tree model as the new leaf node output value; Determining a first weight of the output value of the new leaf node and a second weight of the output value of the old leaf node according to the degree of attention paid to the new training sample set; Using the determined first weight and second weight, for each leaf node of the preset tree model, the weighted sum of the corresponding new leaf node output value and the corresponding old leaf node output value is calculated, and the weighted sum is sent online to update the output value of the leaf node to the weighted sum.
7. A model online updating device, comprising: A copy acquisition unit, used to acquire a copy of a preset tree model and a new training sample set; The preset tree model is: a boosted tree model currently running online or a gradient boosted decision tree model currently running online; the current leaf node output value of the replica is determined as the old leaf node output value; the new training sample set includes the user's business data; the preset tree model is used to determine the predicted value of the user's probability of being defrauded according to the user's business data; the business data includes at least one of the following items: historical experience of being defrauded, business risk, and business party credit; A replica updating unit, configured to update the leaf node output value of the replica according to the new training sample set while keeping the replica structure unchanged, and determine the updated leaf node output value as the new leaf node output value; A weighted sum unit, used to determine a first weight of the output value of the new leaf node and a second weight of the output value of the old leaf node according to the degree of attention paid to the new training sample set; Using the determined first weight and second weight, for each leaf node of the replica, calculate a weighted sum of a corresponding new leaf node output value and a corresponding old leaf node output value, and update the output value of the leaf node to the weighted sum, to obtain a new replica tree model; The online deployment unit is used to deploy the new replica tree model online, and the new replica tree model is used to replace the preset tree model under preset circumstances.
8. A model online updating device, comprising: An old output value acquisition unit, used for acquiring the leaf node output value of the preset tree model as the old leaf node output value; The preset tree model is: a boosted tree model currently running online or a gradient boosted decision tree model currently running online; the preset tree model is used to determine the predicted value of the probability of the user being defrauded according to the user's business data; the business data includes at least one of the following items: historical experience of being defrauded, business risk, and credit of the business party; A new output value acquisition unit is used to acquire a new training sample set and send the new training sample set online, so as to update the leaf node output value of the preset tree model according to the new training sample set while keeping the preset tree model structure unchanged; Obtain the updated leaf node output value of the preset tree model as the new leaf node output value; The new training sample set includes the user's business data; A weight determination unit, configured to determine a first weight of the output value of the new leaf node and a second weight of the output value of the old leaf node according to the degree of attention paid to the new training sample set; An updating unit is used to calculate the weighted sum of the corresponding new leaf node output value and the corresponding old leaf node output value for each leaf node of the preset tree model using the determined first weight and second weight, and send the weighted sum online to update the output value of the leaf node to the weighted sum.
9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the method according to any one of claims 1 to 6 is implemented.
10. A computer-readable storage medium having a computer program stored thereon, wherein when the program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.
