CN114925853A - Construction method, device, equipment and medium of gradient lifting tree model - Google Patents
Construction method, device, equipment and medium of gradient lifting tree model Download PDFInfo
- Publication number
- CN114925853A CN114925853A CN202210580412.1A CN202210580412A CN114925853A CN 114925853 A CN114925853 A CN 114925853A CN 202210580412 A CN202210580412 A CN 202210580412A CN 114925853 A CN114925853 A CN 114925853A
- Authority
- CN
- China
- Prior art keywords
- ciphertext
- node
- gradient
- sample
- split
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000010276 construction Methods 0.000 title claims abstract description 58
- 230000002776 aggregation Effects 0.000 claims abstract description 164
- 238000004220 aggregation Methods 0.000 claims abstract description 164
- 238000000034 method Methods 0.000 claims abstract description 55
- 230000006870 function Effects 0.000 claims description 32
- 238000004364 calculation method Methods 0.000 claims description 6
- 238000004590 computer program Methods 0.000 claims description 5
- 238000004891 communication Methods 0.000 abstract description 23
- 238000010586 diagram Methods 0.000 description 9
- 230000008569 process Effects 0.000 description 7
- 230000003287 optical effect Effects 0.000 description 6
- 238000012545 processing Methods 0.000 description 5
- 238000012549 training Methods 0.000 description 5
- 230000000694 effects Effects 0.000 description 4
- 230000009286 beneficial effect Effects 0.000 description 3
- 230000004931 aggregating effect Effects 0.000 description 2
- 238000003066 decision tree Methods 0.000 description 2
- 230000002093 peripheral effect Effects 0.000 description 2
- 230000000644 propagated effect Effects 0.000 description 2
- 238000003491 array Methods 0.000 description 1
- 238000013473 artificial intelligence Methods 0.000 description 1
- 230000005540 biological transmission Effects 0.000 description 1
- 125000004122 cyclic group Chemical group 0.000 description 1
- 239000000835 fiber Substances 0.000 description 1
- 230000003993 interaction Effects 0.000 description 1
- 238000002372 labelling Methods 0.000 description 1
- 239000013307 optical fiber Substances 0.000 description 1
- 230000008707 rearrangement Effects 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
- 238000012163 sequencing technique Methods 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 238000013526 transfer learning Methods 0.000 description 1
- 238000012795 verification Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N20/00—Machine learning
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L63/00—Network architectures or network communication protocols for network security
- H04L63/04—Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks
- H04L63/0428—Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the data content is protected, e.g. by encrypting or encapsulating the payload
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Computing Systems (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Computer Security & Cryptography (AREA)
- Computer Networks & Wireless Communication (AREA)
- Artificial Intelligence (AREA)
- Medical Informatics (AREA)
- Signal Processing (AREA)
- Computer Hardware Design (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Evolutionary Computation (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Mathematical Physics (AREA)
- Data Mining & Analysis (AREA)
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
Abstract
The embodiment of the invention discloses a method, a device, equipment and a medium for constructing a gradient lifting tree model. The method is applied to a service end and comprises the following steps: acquiring first sample data and sending a sample ciphertext tag to a data end; determining a first information gain based on leaf node weights, first sample data and sample labels in a previous tree model; the leaf node ciphertext weight in the last tree model is sent to the data end, so that the data end determines and sends a gradient ciphertext aggregation value based on the leaf node ciphertext weight, the second sample data and the sample ciphertext tag; determining a second information gain based on the gradient ciphertext aggregation value; performing node splitting on the node to be split based on the first information gain and the second information gain, and determining that the current tree model is constructed when a preset splitting stop condition is met; when the preset construction stopping condition is met, the gradient lifting tree model is obtained, so that the communication overhead can be reduced, the model construction efficiency is improved, and the data security is ensured.
Description
Technical Field
The embodiment of the invention relates to the technical field of privacy computation, in particular to the technical field of federal learning, and specifically relates to a method, a device, equipment and a medium for constructing a gradient lifting tree model.
Background
With the wider and wider application of artificial intelligence, data brings huge value in various industries, and meanwhile, the privacy and the safety of the data are more and more emphasized. Different data owners want to collaborate to exert the value of data, but are unwilling to share the data or can not share the data, which causes the data island problem. In order to solve the problem, a federal learning concept is proposed, and a plurality of participants are expected to share data, intermediate results and data cannot be reversely deduced while achieving the purpose of common modeling, so that the data security is guaranteed.
According to different characteristics of data held by different participants of federal learning, the data can be classified into horizontal federal learning, longitudinal federal learning, federal transfer learning and the like. Longitudinal federal learning is more widely applied and developed in a wind control scene, wherein the characteristics are that a sample label is only held by one party (namely a business end), and other parties only have partial characteristics of data (namely a data end). The Gradient Boosting Decision Tree (GBDT) can effectively solve the problem of insufficient performance caused by a single Decision Tree, integrates the strong learning capacity of a plurality of trees, can process both classification and regression problems, and is widely applied to wind control scenes. At present, a gradient lifting tree model is often constructed based on longitudinal federated learning, so that the performance of the model is improved, and the purpose of reducing risks is achieved.
However, in the process of implementing the present invention, the inventor finds that at least the following problems exist in the prior art:
in the process of constructing the gradient lifting tree model based on longitudinal federated learning, each time a service end constructs a tree model, a gradient ciphertext value of a predicted value corresponding to each sample data needs to be determined, and the gradient ciphertext value is transmitted to all data ends.
Disclosure of Invention
The embodiment of the invention provides a method, a device, equipment and a medium for constructing a gradient elevation tree model, which are used for reducing communication overhead, improving the construction efficiency of the gradient elevation tree model and ensuring data security.
In a first aspect, an embodiment of the present invention provides a method for constructing a gradient spanning tree model, which is applied to a service end, and includes:
acquiring first sample data subjected to sample alignment with a data terminal, encrypting a sample tag corresponding to the first sample data, and sending an encrypted sample ciphertext tag to the data terminal;
determining a first information gain of a node to be split in a current tree model to be constructed in a first splitting mode based on the leaf node weight in the last tree model constructed, the first sample data and the sample label;
encrypting the leaf node weights in the last tree model, and sending the encrypted leaf node ciphertext weights to the data end, so that the data end is based on the leaf node ciphertext weights, second sample data after sample alignment with the service end and the sample ciphertext tags, a gradient ciphertext aggregation value of the node to be split in a second splitting mode is determined, and the gradient ciphertext aggregation value is sent to the service end;
determining a second information gain of the node to be split in a second splitting mode based on the gradient ciphertext aggregation value;
performing node splitting on the node to be split based on the first information gain and the second information gain, and determining that the construction of the current tree model is completed when a preset splitting stop condition is met;
and when the preset construction stopping condition is met, obtaining a gradient lifting tree model based on each constructed tree model.
In a second aspect, an embodiment of the present invention further provides a method for constructing a gradient lifting tree model, which is applied to a data end, and includes:
acquiring second sample data after sample alignment with the service end;
receiving a sample ciphertext tag corresponding to the second sample data sent by the service end;
receiving leaf node ciphertext weights corresponding to the constructed last tree model sent by the service end;
determining a gradient ciphertext aggregation value of a node to be split in the current tree model to be constructed in a second splitting mode based on the leaf node ciphertext weight, the second sample data and the sample ciphertext label;
sending the gradient ciphertext aggregation value to the service end so that the service end determines a second information gain of the node to be split in a second splitting mode based on the gradient ciphertext aggregation value, performs node splitting on the node to be split based on a first information gain and the second information gain of the node to be split in a first splitting mode, and determines that the construction of a current tree model is completed when a preset splitting stop condition is met; and when the preset model construction stopping condition is met, obtaining a target gradient lifting tree model based on each constructed tree model.
In a third aspect, an embodiment of the present invention further provides a device for constructing a gradient spanning tree model, which is integrated at a service end, and includes:
the first sample data alignment module is used for acquiring first sample data subjected to sample alignment with a data terminal, encrypting a sample tag corresponding to the first sample data and sending the encrypted sample ciphertext tag to the data terminal;
the first information gain determining module is used for determining a first information gain of a node to be split in a first splitting mode in a current tree model to be constructed based on the leaf node weight in the last constructed tree model, the first sample data and the sample label;
a leaf node ciphertext weight sending module, configured to encrypt a leaf node weight in the previous tree model, and send the encrypted leaf node ciphertext weight to the data end, so that the data end is based on the leaf node ciphertext weight, second sample data after sample alignment with the service end, and the sample ciphertext tag, determine a gradient ciphertext aggregate value of the node to be split in a second splitting manner, and send the gradient ciphertext aggregate value to the service end;
the second information gain determining module is used for determining a second information gain of the node to be split in a second splitting mode based on the gradient ciphertext aggregation value;
the node splitting module is used for splitting the node to be split based on the first information gain and the second information gain and determining that the construction of the current tree model is completed when a preset splitting stop condition is met;
and the gradient lifting tree model determining module is used for obtaining the gradient lifting tree model based on each constructed tree model when a preset construction stopping condition is met.
In a fourth aspect, an embodiment of the present invention further provides a device for constructing a gradient spanning tree model, which is integrated at a data end, and includes:
the second sample data acquisition module is used for acquiring second sample data after sample alignment with the service end;
a sample ciphertext tag receiving module, configured to receive a sample ciphertext tag corresponding to the second sample data sent by the service end;
the leaf node ciphertext weight receiving module is used for receiving leaf node ciphertext weights corresponding to the constructed previous tree model sent by the service end;
the gradient ciphertext aggregation value determining module is used for determining a gradient ciphertext aggregation value of a node to be split in the current tree model to be constructed in a second splitting mode based on the leaf node ciphertext weight, the second sample data and the sample ciphertext tag;
the gradient ciphertext aggregation value sending module is used for sending the gradient ciphertext aggregation value to the service end so that the service end determines a second information gain of the node to be split in a second splitting mode based on the gradient ciphertext aggregation value, performs node splitting on the node to be split based on a first information gain and the second information gain of the node to be split in a first splitting mode, and determines that the construction of a current tree model is completed when a preset splitting stop condition is met; and when the preset model construction stopping condition is met, obtaining a target gradient lifting tree model based on each constructed tree model.
In a fifth aspect, an embodiment of the present invention further provides a system for constructing a gradient lifting tree model, where the system includes a service end and at least one data end;
the service end is used for realizing the construction method of the gradient lifting tree model provided by the first aspect;
the data end is used for realizing the construction method of the gradient lifting tree model provided by the second aspect.
In a sixth aspect, an embodiment of the present invention further provides an electronic device, where the electronic device includes:
one or more processors;
a memory for storing one or more programs;
when the one or more programs are executed by the one or more processors, the one or more processors implement the method for constructing the gradient lifting tree model according to any embodiment of the present invention.
In a seventh aspect, an embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the method for constructing a gradient lifting tree model according to any embodiment of the present invention.
The embodiment of the invention has the following advantages or beneficial effects:
the business end encrypts a sample tag corresponding to the first sample data, sends the encrypted sample ciphertext tag to the data end, determines a first information gain of a node to be split in a first splitting mode in the current tree model based on a leaf node weight, the first sample data and the sample tag in the constructed last tree model when constructing the current tree model, encrypts the leaf node weight in the last tree model, and sends the encrypted leaf node ciphertext weight to the data end. And the data terminal determines a gradient ciphertext aggregation value of the node to be split in the second splitting mode based on the received leaf node ciphertext weight, the second sample data after sample alignment with the service terminal and the received sample ciphertext tag, and sends the gradient ciphertext aggregation value to the service terminal. The service end determines a second information gain of the node to be split in a second splitting mode based on the received gradient ciphertext aggregation value, performs node splitting on the node to be split based on the first information gain and the second information gain, and determines that the construction of the current tree model is completed when a preset splitting stop condition is met, so that when the service end constructs one tree model, only leaf node ciphertext weight in the last tree model needs to be transmitted to the data end without transmitting the gradient ciphertext value corresponding to each sample data, thereby greatly reducing communication overhead, improving communication efficiency, further improving the construction efficiency of the gradient promotion tree model, and the service end sends the encrypted leaf node ciphertext weight and the sample ciphertext label to the data end, thereby ensuring the data security of the service end, and meanwhile, the data end sends the gradient ciphertext aggregation value to the service end, the service end can not obtain a single predicted value based on the gradient ciphertext aggregation value, and therefore data security of a data side is guaranteed.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, a brief description will be given below of the drawings required for the embodiments or the technical solutions in the prior art, and it is obvious that the drawings in the following description are some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to these drawings without creative efforts.
Fig. 1 is a flowchart of a method for constructing a gradient spanning tree model applied to a service end according to an embodiment of the present invention;
FIG. 2 is a flowchart of another gradient spanning tree model construction method applied to a service end according to an embodiment of the present invention;
FIG. 3 is a flowchart of a method for constructing a gradient lifting tree model applied to a data end according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of a device for constructing a gradient spanning tree model integrated in a service end according to an embodiment of the present invention;
FIG. 5 is a schematic structural diagram of an apparatus for constructing a gradient spanning tree model integrated at a data end according to an embodiment of the present invention;
FIG. 6 is a schematic structural diagram of a system for constructing a gradient spanning tree model according to an embodiment of the present invention;
fig. 7 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention. It should be further noted that, for the convenience of description, only some structures related to the present invention are shown in the drawings, not all of them.
Fig. 1 is a flowchart of a method for constructing a gradient tree model applied to a service end according to an embodiment of the present invention, and this embodiment is applicable to a case of constructing a gradient tree model based on longitudinal federated learning, and particularly applicable to a case of constructing a gradient tree model in a wind control scenario. The gradient lifting tree model can be formed by combining a plurality of tree models based on a Boosting mode, determining a loss function by adopting a gradient descending mode and finally obtaining a strong learner. The Boosting mode is to adjust the weight of a sample by comparing the error condition of each iteration result, train a new round of learner, and thus obtain the result of adding a plurality of tree models according to the weight. The gradient lifting tree model constructed in the embodiment may be a GBDT model or an XGBoost model or a LightGBM model obtained by improving the GBDT model. The method can be executed by a construction device of the gradient lifting tree model integrated at the service end, and the device can be realized by software and/or hardware. As shown in fig. 1, the method specifically includes the following steps:
s110, first sample data after sample alignment with the data end is obtained, a sample label corresponding to the first sample data is encrypted, and the encrypted sample ciphertext label is sent to the data end.
The data terminal may refer to a terminal device used by a data party having only the sample characteristics. The number of data terminals may be one or more. The service end can refer to a terminal device used by a service party possessing the sample characteristics and the sample label. The service end and each data end can store the characteristics of the same sample (such as the same user) in different dimensions, so that the service end can combine the data ends and perform longitudinal federal learning by means of the characteristics of the sample in the data end, the construction effect of the model is improved, and the risk is reduced. The first sample data may refer to sample feature information stored in the service end corresponding to the same sample owned by the service end and each data end. The sample label corresponding to the first sample data may refer to an actual result predicted based on the first sample data. For example, if user age information is predicted, the sample label may refer to the actual age of the user.
Specifically, based on a privacy set intersection manner, sample data in the service end and sample data in each data end may be subjected to sample alignment, that is, features belonging to the same data are corresponded, and the same sample identifier owned by the service end and each data end is determined, so that different sample features of the same sample are used for longitudinal federal learning. Through utilizing the privacy set to ask the mode of handing over, can further guarantee the data privacy and the security of sample alignment in-process, avoid data to reveal. Through the sample alignment operation, the service end and each data end can obtain n data intersections, that is, the service end can obtain aligned first sample data, and each data end can also obtain aligned second sample data. For example, if the sample data stored in the service end is: revenue characteristic information of user A, revenue characteristic information of user B and revenue characteristic information of user C; only one data end is provided, and the sample data stored in the data end is as follows: the asset characteristic information of the user a, the asset characteristic information of the user C, and the asset characteristic information of the user D, the first sample data obtained by the service end includes: revenue characteristic information of the user A and revenue characteristic information of the user C; the second sample data obtained by the data terminal comprises: asset characteristic information of user a and asset characteristic information of user C.
The service end may generate a public key and a private key based on a preset encryption mode, such as a Paillier homomorphic encryption mode, and after obtaining the first sample data, may use the public key to set { y ═ y ] for each sample label y corresponding to each first sample data 1 ,y 2 ,...,y n Carry out encryption Enc pk (y) and labeling each encrypted sample ciphertext tag [ y]={[y 1 ],[y 2 ],...,[y n ]Send to each data side. The public key can be transmitted to each data terminal in a broadcasting mode or a mode of transmitting the public key and the sample ciphertext tag together, so that each data terminal can directly perform operation on ciphertext information based on the public key.
S120, determining a first information gain of a node to be split in the current tree model to be constructed in the first splitting mode based on the leaf node weight, the first sample data and the sample label in the last tree model to be constructed.
The last tree model may be a last constructed tree model of a current tree model to be constructed, that is, a currently newly constructed tree model. The leaf node weight may refer to a predicted value corresponding to each leaf node in the previous tree model, which may be used to characterize a single predicted value obtained by each sample data in the previous tree model. It should be noted that the predicted value corresponding to each sample data is the sum of the single predicted values output by the constructed tree models. The first splitting pattern may refer to a pattern in which each sample feature in the first sample data performs node splitting at each split site threshold. For example, for each sample feature k in n pieces of first sample data of the service end, 1, …, d 1 Performing binning to obtain L quantile points S of each sample characteristic k ={s k1 ,…,s kL As candidate feature thresholds for splitting. A first splitting mode can be determined based on a sample characteristic and a candidate characteristic threshold value, so that a plurality of different first splitting methods can be determinedFormula (II) is shown. The first information gain may refer to a score obtained after the node to be split is split in each first splitting manner, and is used to characterize splitting quality corresponding to each first splitting manner. For example, if the first information gain corresponding to a certain first splitting manner is the highest, it indicates that the node splitting effect performed by the first splitting manner is the best.
Specifically, when the service end constructs a current tree model, that is, a T-th tree, for each node to be split, a current predicted value corresponding to each sample data corresponding to the node to be split may be determined based on a leaf node weight in a constructed last tree model (that is, the T-1 th tree) and a last predicted value (that is, a sum of output results of each tree model constructed before the T-1 th tree). For example, for each sample data corresponding to the node to be split, a target leaf node weight corresponding to the sample data corresponding to the node to be split may be determined based on a correspondence between each leaf node weight in the previous tree model and the first sample data, the target leaf node weight and the corresponding previous predicted value are added, and an obtained addition result is determined as the current predicted value corresponding to the sample data. Based on the current predicted value corresponding to each sample data corresponding to the node to be split and the corresponding sample label, the gradient aggregation value corresponding to each sub-node obtained by splitting the node to be split in each first splitting mode can be determined, and based on each gradient aggregation value, the first information gain of the node to be split in each first splitting mode can be determined.
It should be noted that the key to establish the gradient lifting tree model is: the construction of the current tree model (i.e. the T-th tree) is learned by taking the label residual of the previous tree model (i.e. the T-1 th tree) as a target, and in the construction of each tree, it is determined how each node is split and whether each node is split, and this process is realized by determining the information gain of each feature after each threshold is split by multiple cooperation and information exchange, and splitting based on the splitting mode of the maximum information gain.
S130, encrypting the leaf node weights in the last tree model, sending the encrypted leaf node ciphertext weights to the data end, enabling the data end to be based on the leaf node ciphertext weights, second sample data and sample ciphertext tags after sample alignment is conducted on the data end and the service end, determining a gradient ciphertext aggregation value of the node to be split in the second splitting mode, and sending the gradient ciphertext aggregation value to the service end.
The second splitting mode may refer to a mode in which each sample feature in the second sample data performs node splitting at a threshold value of each split point. For example, for each sample feature k of n second sample data at the data end is 1, …, d 1 Performing binning to obtain L quantile points S of each sample characteristic k ={s k1 ,…,s kL As candidate feature thresholds for splitting. A second split may be determined based on a sample feature and a candidate feature threshold, such that a plurality of different second split may be determined. And splitting the node to be split according to the splitting characteristic and the characteristic threshold value in each second splitting mode to obtain a plurality of child nodes, and determining a corresponding gradient ciphertext aggregation value for each child node. The gradient ciphertext aggregation value may be a result obtained by encrypting and aggregating the gradient information of each sample data corresponding to each child node. Each sample data corresponding to each child node may refer to a sample data set obtained by dividing the second sample data according to the splitting characteristic and the characteristic threshold in the second splitting manner.
Specifically, the service end may encrypt each leaf node weight in the previous tree model based on using the public key, and sequentially send each encrypted leaf node ciphertext weight to the data end according to the leaf node sequencing order. For example, if the tree model is a single-level binary tree, the weights of two leaf nodes of the previous tree model (i.e., the T-1 st tree) are weightedAndencrypting, and sequentially weighting the ciphertexts of the two leaf nodesAnd sending the data to a data end. The data end can determine a gradient ciphertext aggregation value of each node to be split in the second splitting mode based on the received leaf node ciphertext weight, the second sample data and the received sample ciphertext tag, and sends each gradient ciphertext aggregation value to the service end. In this embodiment, the service end only needs to send the ciphertext weight of each leaf node in the previous tree model to the data end, so that the data end can determine the gradient information locally, and further, the communication overhead of the service end for transmitting the gradient information to the data end is greatly reduced.
And S140, determining a second information gain of the node to be split in the second splitting mode based on the gradient ciphertext aggregation value.
The second information gain may refer to a score obtained after the node to be split is split in each second splitting manner, and is used to characterize splitting quality corresponding to each second splitting manner. For example, if the second information gain corresponding to a certain second splitting manner is the highest, it indicates that the node splitting effect performed by the second splitting manner is the best.
Specifically, the service end may decrypt each gradient ciphertext aggregation value of the to-be-split node sent by each data end in each second splitting manner based on the private key, and determine a second information gain of the to-be-split node in each second splitting manner based on the decrypted gradient aggregation value. It should be noted that, since the data end sends the gradient ciphertext aggregation value instead of the gradient ciphertext value obtained after aggregating each sample data, the service end cannot determine the predicted value corresponding to each sample data in the data end based on the gradient ciphertext aggregation value, thereby ensuring the privacy security of the data end.
S150, node splitting is carried out on the node to be split based on the first information gain and the second information gain, and the current tree model is determined to be constructed completely when the preset splitting stop condition is met.
Specifically, the service end may obtain the first information gain corresponding to each first splitting manner and each second information gain corresponding to each first splitting mannerAnd comparing the second information gains corresponding to the two splitting modes to obtain the maximum information gain, and splitting the nodes to be split according to the target splitting mode corresponding to the maximum information gain, thereby ensuring the splitting effect. After node splitting is performed on each node to be split, whether a preset splitting stop condition is met currently can be detected, for example, a leaf node capable of being split does not exist, or the depth of the tree reaches a preset maximum depth, if not, node splitting can be continuously performed on the next node to be split, and if yes, it can be determined that the current tree model f is m And (5) completing construction.
It should be noted that, after the current tree model is built, the service end may determine the leaf node weight corresponding to each leaf node based on the gradient aggregation value corresponding to the optimal split node in the current tree model, so as to build a next tree model based on the leaf node weight in the current tree model.
And S160, when the preset construction stopping condition is met, obtaining a gradient lifting tree model based on each constructed tree model.
Specifically, after the current tree model is constructed, it may be detected whether a preset framework stop condition is currently met, for example, the number of the currently constructed tree models is equal to a preset number, or the model performance of the currently constructed gradient-enhanced tree model verified based on the verification data set reaches a preset performance, if not, the next tree model is continuously constructed, if so, it may be indicated that the construction of the gradient-enhanced tree model is completed, and the obtained gradient-enhanced tree model is:wherein M represents the number of tree models; x i The ith data representing the input model.
Exemplarily, when the gradient lifting tree model to be constructed is an XGBoost model, the node classification in the tree model needs to determine information gain under each splitting mode based on a first-order gradient value g (i.e., loss function first-order gradient) and a second-order gradient value h (i.e., loss function second-order gradient), select the splitting mode with the largest information gain to split the node, complete one-time iterative training, and start the training of the next tree after reaching a preset splitting stopping condition. In the prior art, in order to obtain a first-order gradient aggregation value and a second-order gradient aggregation value, a service end needs to send a first-order gradient value and a second-order gradient value of each sample data to a data end. Assuming that n sample data exists after alignment, P data parties exist, and the communication cost is c, a tree model is established, and the communication cost for the service end to transmit the first-order gradient information and the second-order gradient information to the data end is as follows: 2 XnxnxPxc. Therefore, in the prior art, the communication overhead for transmitting the first-order and second-order gradient information is high, and the modeling process is influenced by the communication efficiency. For this reason, the service end in this embodiment only needs to send the leaf node ciphertext weight in the previous tree model to the data end, so that each data end determines a corresponding gradient aggregation value based on the leaf node ciphertext weight, and further determines the information gain based on the gradient aggregation value. Assuming that a leaf node of each tree contains s samples, a tree is constructed, and the communication overhead of the business end for transmitting the leaf node ciphertext weight to the data end is as follows: n/s.times.Pxc, wherein 1/s < 1. Therefore, the communication overhead for transmitting the leaf node ciphertext weight is far less than the overhead for transmitting the gradient information of all samples, so that the embodiment can greatly reduce the communication overhead and improve the communication efficiency. Moreover, the information interaction between the data end and the service end is encrypted information, so that the privacy information of the data end and the service end can not be exposed in a model training stage and a prediction stage, the communication overhead of parameter transmission is greatly reduced on the premise of ensuring the privacy of data, the communication efficiency is improved, and a safe and efficient federal learning mode is provided for practical application scenes.
According to the technical scheme, the service end encrypts the sample tag corresponding to the first sample data, sends the encrypted sample ciphertext tag to the data end, determines a first information gain of a node to be split in the current tree model in the first splitting mode based on the leaf node weight, the first sample data and the sample tag in the last tree model which are constructed when the current tree model is constructed, encrypts the leaf node weight in the last tree model, and sends the encrypted leaf node ciphertext weight to the data end. And the data terminal determines a gradient ciphertext aggregation value of the node to be split in the second splitting mode based on the received leaf node ciphertext weight, the second sample data after sample alignment with the service terminal and the received sample ciphertext tag, and sends the gradient ciphertext aggregation value to the service terminal. The service end determines a second information gain of the node to be split in a second splitting mode based on the received gradient ciphertext aggregation value, performs node splitting on the node to be split based on the first information gain and the second information gain, and determines that the construction of the current tree model is completed when a preset splitting stop condition is met, so that when the service end constructs one tree model, only leaf node ciphertext weight in the last tree model needs to be transmitted to the data end without transmitting the gradient ciphertext value corresponding to each sample data, thereby greatly reducing communication overhead, improving communication efficiency, further improving the construction efficiency of the gradient promotion tree model, and the service end sends the encrypted leaf node ciphertext weight and the sample ciphertext label to the data end, thereby ensuring the data security of the service end, and meanwhile, the data end sends the gradient ciphertext aggregation value to the service end, the service end can not obtain a single predicted value based on the gradient ciphertext aggregation value, and therefore data security of a data side is guaranteed.
Fig. 2 is a flowchart of another method for constructing a gradient spanning tree model applied to a service end according to an embodiment of the present invention, and this embodiment describes in detail a specific construction process of each tree model constructed by each iteration in the gradient spanning tree model on the basis of the foregoing embodiments. Wherein explanations of the same or corresponding terms as those of the above embodiments are omitted.
Referring to fig. 2, the method for constructing a gradient spanning tree model applied to a service end provided in this embodiment specifically includes the following steps:
s210, obtaining first sample data after sample alignment with the data end, encrypting a sample label corresponding to the first sample data, and sending the encrypted sample ciphertext label to the data end.
S211, obtaining a current node to be split in a current node set to be split corresponding to a current tree model to be constructed.
The current node set to be split may be dynamically updated based on the splitting operation, and is used to store each leaf node that needs to be split in the current tree model.
Specifically, when the current tree model is iteratively constructed for the first time, the current node set to be split only includes the root node, and at this time, the root node may be used as the current node to be split. When the iteration is not the first iteration, the current node set to be split comprises at least two nodes to be split, and any node to be split can be selected from the set to serve as the current node to be split.
S212, third sample data corresponding to the current node to be split is obtained from the first sample data.
The third sample data may refer to each sample data divided into the current node to be split in the first sample data.
Illustratively, S212 may include: if the first iteration is carried out, the first sample data is used as third sample data corresponding to the current node to be split; if not, acquiring third sample data corresponding to the current node to be split in the first sample data, and sending a sample identifier corresponding to the third sample data to the data end, so that the data end determines fourth sample data corresponding to the current node to be split from the second sample data based on the sample identifier.
For example, if the first sample data after sample alignment is 100 pieces of data, when the first iteration is performed, the current node to be split is a root node, and at this time, all the first sample data may be used as third sample data corresponding to the current node to be split, that is, the third sample data is 100 pieces of data. When the iteration is not performed for the first time, for example, the current node to be split is a child node of the root node, each first sample data may be divided in advance based on the splitting characteristic and the characteristic threshold corresponding to the root node, and all third sample data divided to the current node to be split, for example, 30 pieces of data among 100 pieces of data, are determined.
It should be noted that each sample data corresponds to a sample identifier, such as a user identifier, so as to distinguish different sample data based on the sample identifier. After the service end obtains each third sample data, each sample identifier corresponding to each third sample data can be sent to the data end, so that the data end can determine fourth sample data corresponding to the current node to be split from the second sample data after the samples are aligned based on each received sample identifier, data synchronization is achieved, and therefore the service end and the data end can use the sample data corresponding to the same sample when each node is split, and accuracy of tree model construction is guaranteed.
S213, determining a first gradient aggregation value corresponding to a first child node obtained by splitting the current node to be split in the first splitting mode based on the leaf node weight in the constructed last tree model, the third sample data and the sample label corresponding to the third sample data.
Specifically, for each first splitting manner, a current node to be split may be split based on a splitting characteristic and a characteristic threshold, and two split first child nodes, that is, a left node and a right node, are obtained. Based on the splitting characteristic and the characteristic threshold value, all the third sample data can be divided, and a sample data set divided to each first child node is determined. And determining a current predicted value corresponding to each sample data corresponding to each first child node based on the weight of the leaf node in the constructed last tree model (namely the T-1 st tree) and the last predicted value (namely the sum of output results of all tree models constructed before the T-1 st tree). For example, based on the correspondence between each sample data and the leaf node weight, a target leaf node weight corresponding to each sample data corresponding to each first child node is determined, the target leaf node weight and a previous predicted value corresponding to the sample data are added, and an obtained addition result is determined as a current predicted value corresponding to the sample data
In this embodiment, based on the preset loss function, the current predicted value corresponding to each sample data corresponding to each first child node is determinedAnd a sample label y, a first gradient aggregation value corresponding to each first child node can be determined. For example, when the XGBoost model is constructed, a first-order gradient aggregation value and a second-order gradient aggregation value corresponding to each first child node need to be determined. A gradient value corresponding to the ith sample data corresponding to each first sub-nodeCorresponding second order gradient value By a step gradient value g corresponding to each sample data i Adding to obtain the first-order gradient aggregation value corresponding to each first sub-node, namely G ═ Σ i∈I g i Wherein, I refers to a sample data set corresponding to the first child node. Similarly, the second-order gradient value h corresponding to each sample data i Adding to obtain a second-order gradient aggregate value corresponding to each first sub-node, namely H-sigma i∈I h i 。
For example, when the predetermined loss function is a mean square error function, a gradient value g i And a second order gradient value h i Can be determined by:
when the predetermined loss function is the cross entropy loss function and the Sigmod function, a gradient value g i And a second order gradient value h i Can be determined by:
s214, determining a first information gain of the current node to be split in the first splitting mode based on the first gradient aggregation value corresponding to the first child node.
Specifically, for each splitting manner, the service end may determine, based on each first gradient aggregation value corresponding to each first sub-node after splitting, a first information gain of the current node to be split in the first splitting manner. For example, a first information gain of the current node to be split in the first splitting manner may be determined based on the following formula:
wherein j represents one of the first child nodes after splitting, such as the first left child node, i.e. G j =G L λ and γ are both non-negative model parameters, and G is a first-order gradient aggregation value corresponding to the current node to be split, i.e. the sum of the first-order gradient aggregation values corresponding to the two first sub-nodes, i.e. G ═ G L +G R . H is a second-order gradient aggregation value corresponding to the current node to be split, i.e. the sum of the second-order gradient aggregation values corresponding to the two first sub-nodes, i.e. H ═ H L +H R . For example, based on the first-order gradient aggregation value and the second-order gradient aggregation value corresponding to the first left child node after the current node to be split is split and the first-order gradient aggregation value and the second-order gradient aggregation value corresponding to the first right child node, the first information Gain of the current node to be split in the first splitting mode can be determined through the above formula.
S215, encrypting the leaf node weights in the last tree model, sending the encrypted leaf node ciphertext weights to the data end, enabling the data end to be based on the leaf node ciphertext weights, second sample data and sample ciphertext tags after sample alignment is conducted on the data end and the service end, determining a gradient ciphertext aggregation value corresponding to a second sub node obtained by splitting the current node to be split in a second splitting mode, and sending the gradient ciphertext aggregation value to the service end.
Specifically, before the service end constructs the current tree model, leaf node weights in the previous tree model may be encrypted, and the encrypted leaf node ciphertext weights are sent to the data end, so that when the data end constructs the current tree model and performs each node splitting, gradient ciphertext aggregation values corresponding to two second sub-nodes obtained by splitting the current node to be split in each second splitting mode may be locally determined at the data end based on the leaf node ciphertext weights in the previous tree model, and the gradient ciphertext aggregation values are sent to the service end.
It should be noted that the execution sequence of step S215 is not limited herein, for example, step S215 may be executed sequentially after step S214, or before step S211, or may be executed simultaneously with step S211, so as to further improve the model building efficiency.
S216, decrypting the gradient ciphertext aggregation value corresponding to the second child node obtained by splitting the current node to be split in the second splitting mode to obtain a second gradient aggregation value corresponding to the decrypted second child node.
Specifically, the service end may split the received current node to be split in the second splitting manner based on the private key to obtain a gradient ciphertext aggregation value [ G ] corresponding to each second child node j ]Decrypting to obtain a second gradient aggregation value corresponding to each second child node, for example, a first-order gradient aggregation value G corresponding to a second left child node L =Dec sk ([G L ]And second order gradient aggregation value H L =Dec sk ([H L ]And the first-order gradient aggregation value G corresponding to the second right subnode R =Dec sk ([G R ]And second order gradient aggregation value H R =Dec sk ([H R ]。
S217, determining a second information gain of the current node to be split in a second splitting mode based on a second gradient aggregation value corresponding to the second child node.
Specifically, the service end may determine, based on the determination manner of the first information gain, a second information gain of the current node to be split in each second splitting manner according to the second gradient aggregation value corresponding to each second child node.
Exemplarily, S217 may include: and determining a second information gain of the current node to be split in the second splitting mode based on the first-order gradient aggregation value and the second-order gradient aggregation value corresponding to the second left child node and the first-order gradient aggregation value and the second-order gradient aggregation value corresponding to the second right child node.
Specifically, when the XGBoost model is constructed, based on the decrypted first-order gradient aggregation value and second-order gradient aggregation value corresponding to the second left child node after the current node to be split is split and the decrypted first-order gradient aggregation value and second-order gradient aggregation value corresponding to the second right child node, the second information Gain of the current node to be split in each second splitting mode may be determined through the information Gain determination formula.
And S218, determining the maximum information gain based on the first information gain and the second information gain.
Specifically, the service end may compare a first information gain corresponding to each first splitting manner with a second information gain corresponding to each second splitting manner, so as to obtain a maximum information gain of the first information gain and the second information gain.
And S219, if the maximum information gain is detected to be larger than a preset gain threshold value, node splitting is carried out on the current node to be split based on the target splitting mode corresponding to the maximum information gain.
The preset gain threshold may be a minimum value of information gain that is preset and allows node splitting. The target splitting pattern may be a first splitting pattern in the service end or a second splitting pattern in the data end.
Specifically, whether the current node to be split is determined by detecting whether the maximum information gain is greater than or equal to a preset gain threshold. For example, if the maximum information gain is greater than a preset gain threshold, node splitting is performed on a current node to be split based on whether a target splitting mode corresponding to the maximum information gain is located at a service end or a data end, and two split leaf nodes are obtained, so that privacy security of data is ensured. If the maximum information gain is smaller than the preset gain threshold, it indicates that the model performance obtained by the node to be split no matter based on the first splitting mode or the second splitting mode is not good, at this time, splitting of the current node to be split can be stopped, and the current node to be split is removed from the current node set to be split.
For example, the "node splitting is performed on the current node to be split based on the target splitting manner corresponding to the maximum information gain" in S219 may include: if the target splitting mode corresponding to the maximum information gain is the first splitting mode in the service end, performing local node splitting on the current node to be split based on the target splitting mode, and determining a target splitting characteristic and a characteristic threshold; and if the target splitting mode corresponding to the maximum information gain is a second splitting mode in the data end, sending identification information corresponding to the target splitting mode to the data end so that the data end splits the current node to be split based on the second splitting mode corresponding to the identification information, and determining target splitting characteristics and a characteristic threshold value.
Specifically, if the target splitting mode is the first splitting mode in the service end, it indicates that the target splitting characteristic is the sample characteristic in the service end, and at this time, the service end may perform local node splitting on the current node to be split based on the target splitting mode to obtain the optimal target splitting characteristic and the characteristic threshold. If the target splitting mode is a second splitting mode in a certain data end, it indicates that the target splitting characteristic is a sample characteristic in the data end, and at this time, the service end can send identification information corresponding to the target splitting mode to the data end, so that the data end can split a current node to be split in the data end based on the second splitting mode corresponding to the identification information, and determine an optimal target splitting characteristic and a characteristic threshold. It should be noted that, in the training process, the optimal target splitting characteristic and the characteristic threshold value need to be stored locally, and do not need to be disclosed to other terminals, so as to ensure privacy and security of data, and further, in actual application, joint prediction needs to be performed based on cooperation between the service terminal and each data terminal.
Exemplarily, after determining the target splitting feature and the feature threshold, further comprising: and dividing third sample data corresponding to the current node to be split based on the target splitting characteristic and the characteristic threshold value, and determining sample data corresponding to each split target child node.
Specifically, the service end or the data end performs node splitting on a current node to be split based on a target splitting mode to obtain two target sub-nodes, namely two new leaf nodes, divides third sample data corresponding to the current node to be split based on target splitting characteristics and a characteristic threshold value, and determines a sample data set corresponding to each target sub-node to perform node splitting on the corresponding target sub-node based on the sample data set subsequently. If the node splitting is performed at the service end, the service end needs to send the sample identifier sets corresponding to the sample data sets corresponding to each target child node after splitting to each data end, so as to implement data synchronization. If the node splitting is performed at the data end, the data end needs to send the sample identifier set corresponding to the sample data set corresponding to each target child node after splitting to the service end or other data ends, so as to implement data synchronization.
S220, adding the split target child nodes to the current node set to be split, and removing the current node set to be split from the current node set to be split.
Specifically, the service end adds the split target child node to the current node set to be split, and removes the current node to be split from the current node set to be split, so as to update the current node set to be split.
It should be noted that, if node splitting is performed at the data end, the service end only knows that the current node to be split is divided into two target child nodes, but the target splitting characteristic and the characteristic threshold value on which the splitting is based cannot be known.
S221, detecting whether a preset splitting stop condition is satisfied, if yes, executing step S222, otherwise, returning to execute step S211.
S222, determining that the construction of the current tree model is completed.
Specifically, for each leaf node of the current tree model, namely the T-th tree, node splitting is performed in a manner of performing the above steps S211 to S219 in a loop, until it is determined that the current tree model is completely constructed when a preset splitting stop condition is satisfied.
For the first-order gradient aggregation value and the second-order gradient aggregation value of the optimal splitting of the business side holding node, the optimal weight of each leaf node can be calculatedAnd finishing the construction of the T-th tree.
For example, in the building of the XGBoost model, after the current tree model is built, the service end may determine a leaf node weight corresponding to each leaf node based on a first-order gradient aggregation value and a second-order gradient aggregation value corresponding to an optimal split node in the current tree model, so that a next tree model may be built based on each leaf node weight in the current tree model. For example, the leaf node weight corresponding to each leaf node in the T-th tree may be determined by the following formula:
where j denotes the left leaf node 0 or the right leaf node 1.
And S223, when the preset construction stopping condition is met, obtaining a gradient lifting tree model based on each constructed tree model.
Specifically, after completing the construction training of the T-th tree, the service end may encrypt the weight based on the leaf node in the T-th treeRepeatedly executing the steps S211 to S222 to construct a T +1 th tree, that is, a next tree model, until a preset construction stop condition is met, for example, when the construction of M trees is completed, a complete gradient lifting tree model can be obtained:
according to the technical scheme, the business end sends the leaf node ciphertext weight in the last tree model to the data end, and conducts node splitting on each node to be split in the current tree model to be built in a circulating iteration mode to build the current tree model, so that the communication efficiency can be improved on the premise that the data privacy is guaranteed, and the building efficiency of the gradient-based promotion tree model is improved.
Fig. 3 is a flowchart of a method for constructing a gradient tree model applied to a data end according to the embodiment of the present invention, and this embodiment is applicable to a case of constructing a gradient tree model based on longitudinal federated learning, and particularly applicable to a case of constructing a gradient tree model in a wind control scenario. The method can be executed by a device for constructing the gradient lifting tree model integrated on the data end, and the device can be realized by software and/or hardware. Wherein explanations of the same or corresponding terms as those of the above embodiments are omitted. As shown in fig. 3, the method specifically includes the following steps:
and S310, acquiring second sample data after sample alignment with the service end.
Specifically, based on the data alignment method described in the foregoing embodiment, sample alignment may be performed on each data end and the service end, so that each data end may obtain second sample data after sample alignment.
And S320, receiving a sample ciphertext tag corresponding to second sample data sent by the service end.
Specifically, each data terminal may receive a sample ciphertext tag corresponding to each second sample data. Because the sample ciphertext tag is encrypted information, the information of the service end can be prevented from being revealed, and the data privacy security of the service end is ensured.
S330, receiving leaf node ciphertext weight corresponding to the constructed last tree model sent by the service end.
S340, determining a gradient ciphertext aggregation value of the node to be split in the current tree model to be constructed in the second splitting mode based on the leaf node ciphertext weight, the second sample data and the sample ciphertext label.
Specifically, each data end may determine, in a cyclic iteration manner, a gradient ciphertext aggregation value of each node to be split in each second splitting manner, for each node to be split that the service end needs to split when constructing the current tree model.
Illustratively, S340 may include steps S341-S343 as follows.
And S341, determining fourth sample data corresponding to the current node to be split from the second sample data.
Specifically, if the second sample data after sample alignment is 100 pieces of data, in the first iteration, the current node to be split is a root node, and at this time, all the second sample data may be used as fourth sample data corresponding to the current node to be split, that is, the second sample data is 100 pieces of data. During non-first iteration, for example, when the current node to be split is a child node of the root node, fourth sample data corresponding to the current node to be split, for example, 30 pieces of data in 100 pieces of data, may be determined from the second sample data after sample alignment by receiving the sample identifier sent by the service end and based on the sample identifier.
And S342, determining a current prediction ciphertext value corresponding to fourth sample data based on the corresponding relation between the leaf node ciphertext weight and the second sample data and the last prediction ciphertext value corresponding to the fourth sample data.
Specifically, after the previous tree model is constructed at each data end, the corresponding relationship between each leaf node ciphertext weight in the previous tree model and each second sample data and the previous predicted ciphertext value corresponding to each second sample data can be obtained, so that the current predicted ciphertext value corresponding to each fourth sample data can be determined based on the corresponding relationship and the previous predicted ciphertext value corresponding to each fourth sample data.
Exemplarily, S342 may include: determining a target leaf node ciphertext weight corresponding to fourth sample data based on a corresponding relation between the leaf node ciphertext weight and second sample data; and performing homomorphic addition on the last predicted ciphertext value corresponding to the fourth sample data and the target leaf node ciphertext weight to obtain the current predicted ciphertext value corresponding to the fourth sample data.
Specifically, based on the correspondence between each leaf node ciphertext weight and each second sample data, a leaf node ciphertext weight corresponding to the fourth sample data, that is, a target leaf node ciphertext weight, may be obtained. The last prediction ciphertext value corresponding to each fourth sample data(i.e., the sum of the output ciphertext results of each tree model constructed before the T-1 st tree) and the target leaf node ciphertext weight in the previous tree model (i.e., the T-1 st tree)Adding the same state to obtain the current prediction ciphertext value corresponding to each fourth sample dataNamely thatWhereinIs homomorphic addition, i.e., an addition operation on the ciphertext whose result is equal to the encrypted value of the sum of the plaintexts.
And S343, determining a gradient ciphertext aggregation value of the current node to be split in the second splitting mode based on the current prediction ciphertext value and the sample ciphertext tag corresponding to the fourth sample data.
Exemplarily, S343 may include: dividing fourth sample data based on a second splitting mode, and determining fifth sample data corresponding to a second child node obtained by splitting the current node to be split in the second splitting mode; determining a gradient ciphertext value corresponding to each fifth sample data according to the current prediction ciphertext value corresponding to each fifth sample data and the sample ciphertext tag based on a preset loss function; and determining a gradient ciphertext aggregation value corresponding to the second child node based on the gradient ciphertext value corresponding to each fifth sample data.
Specifically, each data terminal may split the current node to be split based on the splitting characteristic and the characteristic threshold value for each second splitting manner, so as to obtain two second sub-nodes after splitting, that is, a left node and a right node. Based on the splitting characteristic and the characteristic threshold, all fourth sample data can be divided, and a data set composed of the fifth sample data divided to each second child node is determined. For the data set corresponding to each second child node, the current prediction ciphertext value corresponding to each fifth sample data in the data set may be based onAnd sample ciphertext tag [ y ]]And determining corresponding gradient ciphertext values, and performing homomorphic addition on each gradient ciphertext value to obtain a gradient ciphertext aggregation value corresponding to each second child node.
Exemplarily, determining a gradient ciphertext value corresponding to each fifth sample data according to the current prediction ciphertext value and the sample ciphertext tag corresponding to each fifth sample data based on a preset loss function may include: determining a first-order gradient ciphertext value corresponding to each fifth sample data according to the current prediction ciphertext value corresponding to each fifth sample data and the sample ciphertext tag based on a first-order gradient calculation mode corresponding to a preset loss function; determining a second-order gradient ciphertext value corresponding to each fifth sample data according to the current prediction ciphertext value corresponding to each fifth sample data and the sample ciphertext tag based on a second-order gradient calculation mode corresponding to a preset loss function;
correspondingly, determining a gradient ciphertext aggregation value corresponding to the second child node based on the gradient ciphertext value corresponding to each fifth sample data may include: homomorphic addition is carried out on the first-order gradient ciphertext values corresponding to the fifth sample data, and a first-order gradient ciphertext aggregation value corresponding to the second child node is obtained; and homomorphic addition is carried out on the first-order gradient ciphertext values corresponding to the fifth sample data, and a second-order gradient ciphertext aggregation value corresponding to the second child node is obtained.
In particular, when the XGboost model is constructed, the XGboost model needs to be accurately constructedAnd determining a first-order gradient ciphertext aggregation value and a second-order gradient ciphertext aggregation value corresponding to each second child node. The first-order gradient ciphertext value corresponding to the ith fifth sample data corresponding to each second child node is [ g ] i ]The corresponding second order gradient ciphertext value is [ h ] i ]. The first-order gradient ciphertext value corresponding to each fifth sample data is ═ g i ]Adding to obtain the first-order gradient ciphertext aggregate value corresponding to each second child node, namelyWherein, I j Refers to a fifth sample data set corresponding to the jth second child node (the second left child node or the second right child node). Similarly, the second order gradient ciphertext value [ h ] corresponding to each fifth sample data i ]Adding to obtain a second-order gradient ciphertext aggregation value corresponding to each second child node, namely
For example, when the predetermined loss function is a mean square error function, the first order gradient ciphertext value [ g ] i ]And a second order gradient ciphertext value [ h ] i ]Can be determined by:
when the predetermined loss function is the cross entropy loss function and the Sigmod function, the data end can approximate the Sigmod function by performing taylor expansion (taking first-order taylor expansion as an example) at 0, and further obtain a first-order gradient ciphertext value [ g [ i ]And a second order gradient ciphertext value [ h ] i ]Can be determined by:
when the preset loss function contains more complex operations such as power operation, rational number division operation and the like, the expression can be subjected to second-order approximation by using the Taylor expansion expression and converted into a homomorphic encryption operable form.
S350, the gradient ciphertext aggregation value is sent to the service end, so that the service end determines a second information gain of the node to be split in a second splitting mode based on the gradient ciphertext aggregation value, node splitting is carried out on the node to be split based on a first information gain and a second information gain of the node to be split in a first splitting mode, and the fact that the construction of the current tree model is completed is determined when a preset splitting stop condition is met; and when the preset model construction stopping condition is met, obtaining a target gradient lifting tree model based on each constructed tree model.
According to the technical scheme, the service end encrypts the sample tag corresponding to the first sample data, sends the encrypted sample ciphertext tag to the data end, determines a first information gain of a node to be split in a first splitting mode in the current tree model based on the leaf node weight, the first sample data and the sample tag in the last tree model when the current tree model is built, encrypts the leaf node weight in the last tree model, and sends the encrypted leaf node ciphertext weight to the data end. And the data terminal determines a gradient ciphertext aggregation value of the node to be split in the second splitting mode based on the received leaf node ciphertext weight, second sample data after sample alignment with the service terminal and the received sample ciphertext label, and sends the gradient ciphertext aggregation value to the service terminal. The service end determines a second information gain of the node to be split in a second splitting mode based on the received gradient ciphertext aggregation value, performs node splitting on the node to be split based on the first information gain and the second information gain, and determines that the current tree model is constructed when a preset splitting stop condition is met, so that when the service end constructs one tree model, only leaf node ciphertext weight in the last tree model needs to be transmitted to the data end without transmitting gradient ciphertext value corresponding to each sample data, thereby greatly reducing communication overhead, improving communication efficiency, further improving construction efficiency of the gradient promotion tree model, and the service end transmits the encrypted leaf node ciphertext weight and the sample ciphertext label to the data end, so that data security of the service end is ensured, and the data end transmits the gradient ciphertext aggregation value to the service end, the service end can not obtain a single predicted value based on the gradient ciphertext aggregation value, and therefore data security of a data side is guaranteed.
The following is an embodiment of the apparatus for constructing a gradient spanning tree model integrated at a service end according to an embodiment of the present invention, which belongs to the same inventive concept as the method for constructing a gradient spanning tree model applied to a service end according to the foregoing embodiments, and reference may be made to the above embodiment of the method for constructing a gradient spanning tree model applied to a service end for details that are not described in detail in the embodiment of the apparatus for constructing a gradient spanning tree model integrated at a service end.
Fig. 4 is a schematic structural diagram of a device for building a gradient spanning tree model integrated at a service end according to an embodiment of the present invention, and as shown in fig. 4, the device specifically includes: a first sample data alignment module 410, a first information gain determination module 420, a leaf node ciphertext weight sending module 430, a second information gain determination module 440, a node splitting module 450, and a gradient lifting tree model determination module 460.
The first sample data alignment module 410 is configured to obtain first sample data subjected to sample alignment with the data end, encrypt a sample tag corresponding to the first sample data, and send the encrypted sample ciphertext tag to the data end; a first information gain determining module 420, configured to determine, based on the leaf node weight, the first sample data, and the sample label in the constructed previous tree model, a first information gain of a node to be split in the current tree model to be constructed in the first splitting manner; the leaf node ciphertext weight sending module 430 is configured to encrypt the leaf node weights in the previous tree model, send the encrypted leaf node ciphertext weights to the data end, enable the data end to be based on the leaf node ciphertext weights, second sample data and sample ciphertext tags after sample alignment is performed on the data end and the service end, determine a gradient ciphertext aggregate value of the node to be split in the second splitting mode, and send the gradient ciphertext aggregate value to the service end; the second information gain determining module 440 is configured to determine, based on the gradient ciphertext aggregation value, a second information gain of the node to be split in the second splitting manner; the node splitting module 450 is configured to split a node to be split based on the first information gain and the second information gain, and determine that the current tree model is constructed when a preset splitting stop condition is met; and a gradient lifting tree model determining module 460, configured to obtain a gradient lifting tree model based on each constructed tree model when a preset construction stop condition is met.
Optionally, the first information gain determining module 420 includes:
the current node to be split acquiring unit is used for acquiring a current node to be split in a current node set to be split corresponding to a current tree model to be constructed;
a third sample data obtaining unit, configured to obtain, from the first sample data, third sample data corresponding to the current node to be split;
the first gradient aggregation value determining unit is used for determining a first gradient aggregation value corresponding to a first child node obtained by splitting the current node to be split in a first splitting mode based on the leaf node weight in the constructed last tree model, the third sample data and a sample label corresponding to the third sample data;
and the first information gain determining unit is used for determining a first information gain of the current node to be split in the first splitting mode based on the first gradient aggregation value corresponding to the first child node.
Optionally, the current node to be split obtaining unit is specifically configured to:
if the first iteration is carried out, the first sample data is used as third sample data corresponding to the current node to be split; if not, acquiring third sample data corresponding to the current node to be split in the first sample data, and sending a sample identifier corresponding to the third sample data to the data end, so that the data end determines fourth sample data corresponding to the current node to be split from the second sample data based on the sample identifier.
Optionally, the second information gain determining module 440 includes:
the gradient ciphertext aggregation value decryption unit is used for decrypting a gradient ciphertext aggregation value corresponding to a second child node obtained by splitting the current node to be split in a second splitting mode to obtain a second gradient aggregation value corresponding to the second child node after decryption;
and the second information gain determining unit is used for determining a second information gain of the current node to be split in a second splitting mode based on a second gradient aggregation value corresponding to the second sub-node.
Optionally, the second information gain determining unit is specifically configured to: and determining a second information gain of the current node to be split in the second splitting mode based on the first-order gradient aggregation value and the second-order gradient aggregation value corresponding to the second left child node and the first-order gradient aggregation value and the second-order gradient aggregation value corresponding to the second right child node.
Optionally, the node splitting module 450 includes:
a maximum information gain determination unit for determining a maximum information gain based on the first information gain and the second information gain;
the node splitting unit is used for splitting the node of the current node to be split based on a target splitting mode corresponding to the maximum information gain if the maximum information gain is detected to be larger than or equal to a preset gain threshold value;
and the current node set to be split updating unit is used for adding the split target child nodes to the current node set to be split, removing the current nodes to be split from the current node set to be split, returning to the step of acquiring the current nodes to be split in the current node set to be split corresponding to the current tree model to be constructed, and determining that the construction of the current tree model is completed when a preset splitting stop condition is met.
Optionally, the node splitting unit is specifically configured to:
if the target splitting mode corresponding to the maximum information gain is the first splitting mode in the service end, performing local node splitting on the current node to be split based on the target splitting mode, and determining a target splitting characteristic and a characteristic threshold; and if the target splitting mode corresponding to the maximum information gain is a second splitting mode in the data end, sending identification information corresponding to the target splitting mode to the data end so that the data end splits the current node to be split based on the second splitting mode corresponding to the identification information, and determining target splitting characteristics and a characteristic threshold value.
The device for constructing the gradient lifting tree model integrated at the service end, provided by the embodiment of the invention, can execute the method for constructing the gradient lifting tree model applied to the service end, provided by any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the method for constructing the gradient lifting tree model applied to the service end.
It should be noted that, in the embodiment of the apparatus for constructing a gradient spanning tree model integrated at a service end, each included unit and each included module are only divided according to functional logic, but are not limited to the above division, as long as corresponding functions can be implemented; in addition, the specific names of the functional units are only for the convenience of distinguishing from each other, and are not used for limiting the protection scope of the present invention.
The following is an embodiment of the apparatus for constructing a gradient lifting tree model integrated at a data end according to an embodiment of the present invention, which belongs to the same inventive concept as the method for constructing a gradient lifting tree model applied at a data end according to the above embodiments, and reference may be made to the above embodiment of the method for constructing a gradient lifting tree model applied at a data end for details that are not described in detail in the embodiment of the apparatus for constructing a gradient lifting tree model integrated at a data end.
Fig. 5 is a schematic structural diagram of a device for constructing a gradient spanning tree model integrated at a data end according to an embodiment of the present invention, as shown in fig. 5, the device specifically includes: a second sample data obtaining module 510, a sample ciphertext tag receiving module 520, a leaf node ciphertext weight receiving module 530, a gradient ciphertext aggregation value determining module 540, and a gradient ciphertext aggregation value sending module 550.
The second sample data obtaining module 510 is configured to obtain second sample data after sample alignment with the service end; a sample ciphertext tag receiving module 520, configured to receive a sample ciphertext tag corresponding to second sample data sent by the service end; a leaf node ciphertext weight receiving module 530, configured to receive a leaf node ciphertext weight corresponding to the constructed previous tree model sent by the service end; the gradient ciphertext aggregation value determining module 540 is configured to determine a gradient ciphertext aggregation value of a node to be split in the current tree model to be constructed in the second splitting mode based on the leaf node ciphertext weight, the second sample data and the sample ciphertext tag; the gradient ciphertext aggregation value sending module 550 is configured to send the gradient ciphertext aggregation value to the service end, so that the service end determines, based on the gradient ciphertext aggregation value, a second information gain of the node to be split in the second splitting manner, performs node splitting on the node to be split based on the first information gain and the second information gain of the node to be split in the first splitting manner, and determines that the current tree model is constructed when a preset splitting stop condition is met; and when the preset model construction stopping condition is met, obtaining a target gradient lifting tree model based on each constructed tree model.
Optionally, the gradient ciphertext aggregation value determining module 540 includes:
a fourth sample data determining unit, configured to determine fourth sample data corresponding to the current node to be split from the second sample data;
a current prediction ciphertext value determining unit, configured to determine a current prediction ciphertext value corresponding to fourth sample data based on a correspondence between the leaf node ciphertext weight and the second sample data and a last prediction ciphertext value corresponding to the fourth sample data;
and the gradient ciphertext aggregation value determining unit is used for determining a gradient ciphertext aggregation value of the current node to be split in the second splitting mode based on the current prediction ciphertext value corresponding to the fourth sample data and the sample ciphertext tag.
Optionally, the current prediction ciphertext value determining unit is specifically configured to:
determining a target leaf node ciphertext weight corresponding to fourth sample data based on a corresponding relation between the leaf node ciphertext weight and second sample data; and homomorphic addition is carried out on the last prediction ciphertext value corresponding to the fourth sample data and the target leaf node ciphertext weight to obtain the current prediction ciphertext value corresponding to the fourth sample data.
Optionally, the gradient ciphertext aggregation value determining unit includes:
a fifth sample data determining subunit, configured to divide fourth sample data based on the second splitting manner, and determine fifth sample data corresponding to a second child node obtained by splitting the current node to be split in the second splitting manner;
the gradient ciphertext value determining subunit is configured to determine, based on a preset loss function, a gradient ciphertext value corresponding to each fifth sample data according to the current prediction ciphertext value corresponding to each fifth sample data and the sample ciphertext tag;
and the gradient ciphertext aggregation value determining subunit is used for determining a gradient ciphertext aggregation value corresponding to the second child node based on the gradient ciphertext value corresponding to each fifth sample data.
Optionally, the gradient ciphertext value determining subunit is specifically configured to: determining a first-order gradient ciphertext value corresponding to each fifth sample data according to the current prediction ciphertext value corresponding to each fifth sample data and the sample ciphertext tag based on a first-order gradient calculation mode corresponding to a preset loss function; determining a second-order gradient ciphertext value corresponding to each fifth sample data according to the current prediction ciphertext value corresponding to each fifth sample data and the sample ciphertext tag based on a second-order gradient calculation mode corresponding to a preset loss function;
the gradient ciphertext aggregation value determining subunit is specifically configured to: homomorphic addition is carried out on the first-order gradient ciphertext value corresponding to each fifth sample data, and a first-order gradient ciphertext aggregation value corresponding to the second child node is obtained; and homomorphic addition is carried out on the first-order gradient ciphertext values corresponding to the fifth sample data, and a second-order gradient ciphertext aggregation value corresponding to the second child node is obtained.
The device for constructing the gradient lifting tree model integrated on the data end, provided by the embodiment of the invention, can execute the method for constructing the gradient lifting tree model applied to the data end, provided by any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the method for constructing the gradient lifting tree model applied to the data end.
It should be noted that, in the embodiment of the above apparatus for constructing a gradient spanning tree model integrated at a data end, the included units and modules are only divided according to functional logic, but are not limited to the above division, as long as the corresponding functions can be realized; in addition, specific names of the functional units are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present invention.
Fig. 6 is a schematic structural diagram of a system for constructing a gradient lifting tree model according to an embodiment of the present invention, which is applicable to a case of constructing a gradient lifting tree model based on longitudinal federal learning, and especially applicable to a case of constructing a gradient lifting tree model in a wind control scene. As shown in fig. 6, the system specifically includes: a service end 610 and at least one data end 620.
The service end 610 is configured to implement the method for constructing a gradient lifting tree model applied to the service end, which is provided in the foregoing embodiment. Each data end 620 is used to implement the construction method of the gradient lifting tree model applied to the data end as provided in the above embodiments.
In the system for constructing a gradient lifting tree model in this embodiment, the service end encrypts the sample tag corresponding to the first sample data, and sends the encrypted sample ciphertext tag to the data end, and when constructing the current tree model, determines, based on the leaf node weight, the first sample data and the sample tag in the last tree model that have been constructed, the first information gain of the node to be split in the first splitting manner in the current tree model, and encrypts the leaf node weight in the last tree model, and sends the encrypted leaf node ciphertext weight to the data end. And the data terminal determines a gradient ciphertext aggregation value of the node to be split in the second splitting mode based on the received leaf node ciphertext weight, second sample data after sample alignment with the service terminal and the received sample ciphertext label, and sends the gradient ciphertext aggregation value to the service terminal. The service end determines a second information gain of the node to be split in a second splitting mode based on the received gradient ciphertext aggregation value, performs node splitting on the node to be split based on the first information gain and the second information gain, and determines that the construction of the current tree model is completed when a preset splitting stop condition is met, so that when the service end constructs one tree model, only leaf node ciphertext weight in the last tree model needs to be transmitted to the data end without transmitting the gradient ciphertext value corresponding to each sample data, thereby greatly reducing communication overhead, improving communication efficiency, further improving the construction efficiency of the gradient promotion tree model, and the service end sends the encrypted leaf node ciphertext weight and the sample ciphertext label to the data end, thereby ensuring the data security of the service end, and meanwhile, the data end sends the gradient ciphertext aggregation value to the service end, the service end can not obtain a single predicted value based on the gradient ciphertext aggregation value, and therefore data security of a data side is guaranteed.
Fig. 7 is a schematic structural diagram of an electronic device according to an embodiment of the present invention. FIG. 7 illustrates a block diagram of an exemplary electronic device 12 suitable for use in implementing embodiments of the present invention. The electronic device 12 shown in fig. 7 is only an example and should not bring any limitation to the function and the scope of use of the embodiment of the present invention.
As shown in FIG. 7, electronic device 12 is embodied in the form of a general purpose computing device. The components of the electronic device 12 may include, but are not limited to: one or more processors or processing units 16, a system memory 28, and a bus 18 that couples various system components including the system memory 28 and the processing unit 16.
The system memory 28 may include computer system readable media in the form of volatile memory, such as Random Access Memory (RAM)30 and/or cache memory 32. The electronic device 12 may further include other removable/non-removable, volatile/nonvolatile computer system storage media. By way of example only, storage system 34 may be used to read from and write to non-removable, nonvolatile magnetic media (not shown in FIG. 7, and commonly referred to as a "hard drive"). Although not shown in FIG. 7, a magnetic disk drive for reading from and writing to a removable, nonvolatile magnetic disk (e.g., a "floppy disk") and an optical disk drive for reading from or writing to a removable, nonvolatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to bus 18 by one or more data media interfaces. System memory 28 may include at least one program product having a set (e.g., at least one) of program modules that are configured to carry out the functions of embodiments of the invention.
A program/utility 40 having a set (at least one) of program modules 42 may be stored, for example, in system memory 28, such program modules 42 including but not limited to an operating system, one or more application programs, other program modules, and program data, each of which or some combination of which may comprise an implementation of a network environment. Program modules 42 generally carry out the functions and/or methodologies of the described embodiments of the invention.
The processing unit 16 executes programs stored in the system memory 28 to execute various functional applications and data processing, for example, to implement the method for constructing the gradient lifting tree model provided in the embodiment of the present invention.
Of course, those skilled in the art can understand that the processor may also implement the technical solution of the method for determining the reserved inventory provided in any embodiment of the present invention.
The present embodiment provides a computer-readable storage medium, on which a computer program is stored, which when executed by a processor implements the method for constructing a gradient lifting tree model according to any embodiment of the present invention.
Computer storage media for embodiments of the invention may employ any combination of one or more computer-readable media. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. The computer-readable storage medium may be, for example but not limited to: an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
A computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations for aspects of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
It will be understood by those skilled in the art that the modules or steps of the present invention described above can be implemented by a general purpose computing device, they can be centralized in a single computing device or distributed over a network of multiple computing devices, and they can alternatively be implemented by program code executable by a computing device, so that they can be stored in a storage device and executed by a computing device, or they can be separately fabricated into various integrated circuit modules, or multiple modules or steps thereof can be fabricated into a single integrated circuit module. Thus, the present invention is not limited to any specific combination of hardware and software.
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present invention and the technical principles employed. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present invention has been described in some detail by the above embodiments, the invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the invention, and the scope of the invention is determined by the scope of the appended claims.
Claims (17)
1. A method for constructing a gradient lifting tree model is applied to a service end, and comprises the following steps:
acquiring first sample data subjected to sample alignment with a data terminal, encrypting a sample tag corresponding to the first sample data, and sending an encrypted sample ciphertext tag to the data terminal;
determining a first information gain of a node to be split in a current tree model to be constructed in a first splitting mode based on the leaf node weight in the last tree model constructed, the first sample data and the sample label;
encrypting the leaf node weight in the last tree model, and sending the encrypted leaf node ciphertext weight to the data end, so that the data end determines a gradient ciphertext aggregation value of the node to be split in a second splitting mode based on the leaf node ciphertext weight, second sample data after sample alignment with the service end and the sample ciphertext tag, and sends the gradient ciphertext aggregation value to the service end;
determining a second information gain of the node to be split in a second splitting mode based on the gradient ciphertext aggregation value;
performing node splitting on the node to be split based on the first information gain and the second information gain, and determining that the construction of the current tree model is completed when a preset splitting stop condition is met;
and when the preset construction stopping condition is met, obtaining a gradient lifting tree model based on each constructed tree model.
2. The method of claim 1, wherein determining a first information gain of a node to be split in a first splitting mode in a current tree model to be constructed based on leaf node weights in a last tree model constructed, the first sample data and the sample labels comprises:
acquiring a current node to be split in a current node set to be split corresponding to a current tree model to be constructed;
acquiring third sample data corresponding to the current node to be split from the first sample data;
determining a first gradient aggregation value corresponding to a first child node obtained by splitting a node to be split currently in a first splitting mode based on the weight of a leaf node in a constructed last tree model, the third sample data and a sample label corresponding to the third sample data;
and determining a first information gain of the current node to be split in a first splitting mode based on the first gradient aggregation value corresponding to the first child node.
3. The method according to claim 2, wherein the obtaining third sample data corresponding to the node to be split currently from the first sample data comprises:
if the first iteration is carried out, the first sample data is used as third sample data corresponding to the current node to be split;
if not, acquiring third sample data corresponding to the node to be split currently in the first sample data, and sending a sample identifier corresponding to the third sample data to the data end, so that the data end determines fourth sample data corresponding to the node to be split currently in the second sample data based on the sample identifier.
4. The method according to claim 2, wherein the determining a second information gain of the node to be split in a second splitting manner based on the gradient ciphertext aggregation value comprises:
decrypting a gradient ciphertext aggregation value corresponding to a second child node obtained by splitting the current node to be split in a second splitting mode to obtain a decrypted second gradient aggregation value corresponding to the second child node;
and determining a second information gain of the current node to be split in a second splitting mode based on a second gradient aggregation value corresponding to the second child node.
5. The method according to claim 4, wherein the determining a second information gain of the current node to be split in a second splitting manner based on a second gradient aggregation value corresponding to the second child node comprises:
and determining a second information gain of the current node to be split in the second splitting mode based on the first-order gradient aggregation value and the second-order gradient aggregation value corresponding to the second left child node and the first-order gradient aggregation value and the second-order gradient aggregation value corresponding to the second right child node.
6. The method according to claim 2, wherein the node splitting the node to be split based on the first information gain and the second information gain, and determining that the current tree model is completely constructed when a preset splitting stop condition is met comprises:
determining a maximum information gain based on the first information gain and the second information gain;
if the maximum information gain is detected to be larger than or equal to a preset gain threshold value, node splitting is carried out on the current node to be split based on a target splitting mode corresponding to the maximum information gain;
and adding the split target child node to the current node set to be split, removing the current node to be split from the current node set to be split, returning to execute the step of obtaining the current node to be split in the current node set to be split corresponding to the current tree model to be constructed, and determining that the construction of the current tree model is completed when a preset splitting stop condition is met.
7. The method according to claim 6, wherein the node splitting is performed on the current node to be split based on the target splitting manner corresponding to the maximum information gain, and the method comprises:
if the target splitting mode corresponding to the maximum information gain is the first splitting mode in the service end, performing local node splitting on the current node to be split based on the target splitting mode, and determining a target splitting characteristic and a characteristic threshold;
and if the target splitting mode corresponding to the maximum information gain is the second splitting mode in the data end, sending the identification information corresponding to the target splitting mode to the data end so that the data end splits the current node to be split based on the second splitting mode corresponding to the identification information and determines the target splitting characteristic and the characteristic threshold.
8. A construction method of a gradient lifting tree model is applied to a data end, and comprises the following steps:
acquiring second sample data after sample alignment with the service end;
receiving a sample ciphertext tag corresponding to the second sample data sent by the service end;
receiving leaf node ciphertext weights corresponding to the constructed last tree model sent by the service end;
determining a gradient ciphertext aggregation value of a node to be split in the current tree model to be constructed in a second splitting mode based on the leaf node ciphertext weight, the second sample data and the sample ciphertext tag;
sending the gradient ciphertext aggregation value to the service end so that the service end determines a second information gain of the node to be split in a second splitting mode based on the gradient ciphertext aggregation value, performs node splitting on the node to be split based on a first information gain and the second information gain of the node to be split in a first splitting mode, and determines that the construction of a current tree model is completed when a preset splitting stop condition is met; and when the preset model construction stopping condition is met, obtaining a target gradient lifting tree model based on each constructed tree model.
9. The method of claim 8, wherein determining a gradient ciphertext aggregation value for a node to be split in the current tree model to be constructed in a second splitting manner based on the leaf node ciphertext weight, the second sample data, and the sample ciphertext tag comprises:
determining fourth sample data corresponding to the current node to be split from the second sample data;
determining a current prediction ciphertext value corresponding to the fourth sample data based on the corresponding relation between the leaf node ciphertext weight and the second sample data and a last prediction ciphertext value corresponding to the fourth sample data;
and determining a gradient ciphertext aggregation value of the current node to be split in the second splitting mode based on the current prediction ciphertext value and the sample ciphertext tag corresponding to the fourth sample data.
10. The method of claim 9, wherein determining a current prediction ciphertext value corresponding to the fourth sample data based on a correspondence between the leaf node ciphertext weight and the second sample data and a last prediction ciphertext value corresponding to the fourth sample data comprises:
determining a target leaf node ciphertext weight corresponding to the fourth sample data based on the corresponding relationship between the leaf node ciphertext weight and the second sample data;
and homomorphic addition is carried out on the last prediction ciphertext value corresponding to the fourth sample data and the target leaf node ciphertext weight to obtain the current prediction ciphertext value corresponding to the fourth sample data.
11. The method according to claim 9, wherein the determining a gradient ciphertext aggregation value of the current node to be split in the second splitting mode based on the current prediction ciphertext value and the sample ciphertext tag corresponding to the fourth sample data comprises:
dividing the fourth sample data based on a second splitting mode, and determining fifth sample data corresponding to a second child node obtained by splitting the current node to be split in the second splitting mode;
determining a gradient ciphertext value corresponding to each fifth sample data according to the current prediction ciphertext value corresponding to each fifth sample data and a sample ciphertext tag based on a preset loss function;
and determining a gradient ciphertext aggregation value corresponding to the second child node based on the gradient ciphertext value corresponding to each fifth sample data.
12. The method of claim 11, wherein the determining a gradient ciphertext value corresponding to each of the fifth sample data according to the current prediction ciphertext value and the sample ciphertext tag corresponding to each of the fifth sample data based on a preset loss function comprises:
determining a first-order gradient ciphertext value corresponding to each fifth sample data according to a current prediction ciphertext value corresponding to each fifth sample data and a sample ciphertext tag based on a first-order gradient calculation mode corresponding to a preset loss function;
determining a second-order gradient ciphertext value corresponding to each fifth sample data according to a current prediction ciphertext value corresponding to each fifth sample data and a sample ciphertext tag based on a second-order gradient calculation mode corresponding to a preset loss function;
the determining, based on the gradient ciphertext value corresponding to each fifth sample data, a gradient ciphertext aggregation value corresponding to the second child node includes:
homomorphic addition is carried out on the first-order gradient ciphertext values corresponding to the fifth sample data, and a first-order gradient ciphertext aggregation value corresponding to the second child node is obtained;
and homomorphic addition is carried out on the first-order gradient ciphertext values corresponding to the fifth sample data, so that a second-order gradient ciphertext aggregation value corresponding to the second child node is obtained.
13. A gradient lifting tree model building device is characterized by being integrated at a service end and comprising:
the first sample data alignment module is used for acquiring first sample data subjected to sample alignment with a data terminal, encrypting a sample tag corresponding to the first sample data and sending the encrypted sample ciphertext tag to the data terminal;
the first information gain determining module is used for determining a first information gain of a node to be split in a first splitting mode in a current tree model to be constructed based on the leaf node weight in the last tree model constructed, the first sample data and the sample label;
a leaf node ciphertext weight sending module, configured to encrypt a leaf node weight in the previous tree model, and send the encrypted leaf node ciphertext weight to the data end, so that the data end is based on the leaf node ciphertext weight, second sample data after sample alignment with the service end, and the sample ciphertext tag, determine a gradient ciphertext aggregate value of the node to be split in a second splitting manner, and send the gradient ciphertext aggregate value to the service end;
the second information gain determining module is used for determining a second information gain of the node to be split in a second splitting mode based on the gradient ciphertext aggregation value;
the node splitting module is used for splitting the node to be split based on the first information gain and the second information gain and determining that the construction of the current tree model is completed when a preset splitting stop condition is met;
and the gradient lifting tree model determining module is used for obtaining the gradient lifting tree model based on each constructed tree model when a preset construction stopping condition is met.
14. A construction device of a gradient lifting tree model is characterized by being integrated at a data end and comprising:
the second sample data acquisition module is used for acquiring second sample data after sample alignment with the service end;
a sample ciphertext tag receiving module, configured to receive a sample ciphertext tag corresponding to the second sample data sent by the service end;
the leaf node ciphertext weight receiving module is used for receiving leaf node ciphertext weights corresponding to the constructed previous tree model sent by the service end;
the gradient ciphertext aggregation value determining module is used for determining a gradient ciphertext aggregation value of a node to be split in the current tree model to be constructed in a second splitting mode based on the leaf node ciphertext weight, the second sample data and the sample ciphertext tag;
the gradient ciphertext aggregation value sending module is used for sending the gradient ciphertext aggregation value to the service end so that the service end determines a second information gain of the node to be split in a second splitting mode based on the gradient ciphertext aggregation value, performs node splitting on the node to be split based on a first information gain and the second information gain of the node to be split in a first splitting mode, and determines that the construction of a current tree model is completed when a preset splitting stop condition is met; and when the preset model construction stopping condition is met, obtaining a target gradient lifting tree model based on each constructed tree model.
15. A construction system of a gradient lifting tree model is characterized by comprising a service end and at least one data end;
the service end is used for realizing the construction method of the gradient lifting tree model according to any one of claims 1-7;
the data terminal is used for implementing the construction method of the gradient lifting tree model according to any one of claims 8-12.
16. An electronic device, characterized in that the electronic device comprises:
one or more processors;
a memory for storing one or more programs;
when executed by the one or more processors, cause the one or more processors to implement a method of constructing a gradient lifting tree model as claimed in any one of claims 1 to 12.
17. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out a method of constructing a gradient boosting tree model according to any one of claims 1 to 12.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210580412.1A CN114925853A (en) | 2022-05-25 | 2022-05-25 | Construction method, device, equipment and medium of gradient lifting tree model |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210580412.1A CN114925853A (en) | 2022-05-25 | 2022-05-25 | Construction method, device, equipment and medium of gradient lifting tree model |
Publications (1)
Publication Number | Publication Date |
---|---|
CN114925853A true CN114925853A (en) | 2022-08-19 |
Family
ID=82810168
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210580412.1A Pending CN114925853A (en) | 2022-05-25 | 2022-05-25 | Construction method, device, equipment and medium of gradient lifting tree model |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114925853A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113516513A (en) * | 2021-07-20 | 2021-10-19 | 重庆度小满优扬科技有限公司 | Data analysis method and device, computer equipment and storage medium |
CN115563564A (en) * | 2022-12-02 | 2023-01-03 | 腾讯科技(深圳)有限公司 | Processing method and device of decision tree model, computer equipment and storage medium |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113657471A (en) * | 2021-07-30 | 2021-11-16 | 深圳前海微众银行股份有限公司 | Construction method and device of multi-classification gradient lifting tree and electronic equipment |
CN113722739A (en) * | 2021-09-06 | 2021-11-30 | 京东科技控股股份有限公司 | Gradient lifting tree model generation method and device, electronic equipment and storage medium |
CN114529108A (en) * | 2022-04-22 | 2022-05-24 | 北京百度网讯科技有限公司 | Tree model based prediction method, apparatus, device, medium, and program product |
-
2022
- 2022-05-25 CN CN202210580412.1A patent/CN114925853A/en active Pending
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113657471A (en) * | 2021-07-30 | 2021-11-16 | 深圳前海微众银行股份有限公司 | Construction method and device of multi-classification gradient lifting tree and electronic equipment |
CN113722739A (en) * | 2021-09-06 | 2021-11-30 | 京东科技控股股份有限公司 | Gradient lifting tree model generation method and device, electronic equipment and storage medium |
CN114529108A (en) * | 2022-04-22 | 2022-05-24 | 北京百度网讯科技有限公司 | Tree model based prediction method, apparatus, device, medium, and program product |
Non-Patent Citations (2)
Title |
---|
XIAOLIN CHEN等: "Fed-EINI:An Efficient and Interpretable Inference Framework for Decision Tree Ensembles in Vertical Federated Learning", 《2021 IEEE INTERNATIONAL CONFERENCE ON BIG DATA》, 13 January 2022 (2022-01-13), pages 1242 - 1248 * |
江佳伟等: "面向高维特征和多分类的分布式梯度提升树", 《软件学报》, vol. 30, no. 3, 31 March 2019 (2019-03-31), pages 784 - 798 * |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113516513A (en) * | 2021-07-20 | 2021-10-19 | 重庆度小满优扬科技有限公司 | Data analysis method and device, computer equipment and storage medium |
CN113516513B (en) * | 2021-07-20 | 2023-04-07 | 重庆度小满优扬科技有限公司 | Data analysis method and device, computer equipment and storage medium |
CN115563564A (en) * | 2022-12-02 | 2023-01-03 | 腾讯科技(深圳)有限公司 | Processing method and device of decision tree model, computer equipment and storage medium |
CN115563564B (en) * | 2022-12-02 | 2023-03-17 | 腾讯科技(深圳)有限公司 | Processing method and device of decision tree model, computer equipment and storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110084377B (en) | Method and device for constructing decision tree | |
CN109284313B (en) | Federal modeling method, device and readable storage medium based on semi-supervised learning | |
CN114925853A (en) | Construction method, device, equipment and medium of gradient lifting tree model | |
CN110569359B (en) | Training and application method and device of recognition model, computing equipment and storage medium | |
CN109101664B (en) | Data transmission method, device, equipment and medium for lightweight node | |
CN111753996A (en) | Optimization method, device, equipment and storage medium of scheme determination model | |
CN114329127B (en) | Feature binning method, device and storage medium | |
CN111610938B (en) | Distributed data code storage method, electronic device and computer readable storage medium | |
CN116306905A (en) | Semi-supervised non-independent co-distributed federal learning distillation method and device | |
CN111435452B (en) | Model training method, device, equipment and medium | |
CN112346737B (en) | Method, device and equipment for training programming language translation model and storage medium | |
CN112541548B (en) | Method, device, computer equipment and storage medium for generating relational network | |
CN114707663A (en) | Distributed machine learning method and device, electronic equipment and storage medium | |
CN110517045B (en) | Block chain data processing method, device, equipment and storage medium | |
CN113537361B (en) | Cross-sample feature selection method in federal learning system and federal learning system | |
CN113923006B (en) | Equipment data authentication method and device and electronic equipment | |
CN114648073B (en) | Data processing method based on XGBoost model of cross-feature federation | |
CN112330278B (en) | Integrated system construction method based on modularized subsystem | |
CN114186669B (en) | Training method, device, equipment and storage medium of neural network model | |
CN114048804B (en) | Classification model training method and device | |
WO2023050778A1 (en) | Model training method and system, and electronic device and computer-readable storage medium | |
CN115438734B (en) | Model training method and system, computer readable storage medium and electronic device | |
CN113824546B (en) | Method and device for generating information | |
An | Mathematical Model and Genetic Algorithm in Computer Programming Optimization and Network Topology Structure | |
CN117332872A (en) | Training method and device for longitudinal federal learning model, electronic equipment and medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |