Decision tree construction method and device based on federated learning system and electronic equipment
1. A decision tree construction method based on a federated learning system, wherein the federated learning system comprises a first participant device with label information and at least one second participant device, and the method is applied to the first participant device and comprises the following steps:
acquiring a training sample and a type of a decision tree to be constructed, and determining reference data for constructing a split point of the decision tree based on the training sample and the type;
compressing the reference data to obtain first compressed data, and sending the first compressed data to second participant equipment;
receiving split point data sent by second participant equipment, wherein the split point data is obtained by constructing split points corresponding to the decision tree by the second participant equipment based on the first compressed data;
and determining a global split point of the decision tree based on the split point data, and constructing the decision tree based on the global split point.
2. The method according to claim 1, wherein the compressing the reference data to obtain first compressed data comprises:
based on the type of the decision tree, determining a corresponding compression control parameter, the compression control parameter comprising at least one of: homomorphic maximum integer digits, floating point fixed-point precision, label number and sample number;
determining a compression parameter based on the compression control parameter and the bit length of the reference data;
and compressing the reference data based on the compression parameters to obtain first compressed data.
3. The method of claim 2, wherein when the decision tree is a gradient boosting decision tree, the reference data is a sample gradient, and the compression control parameters include the homomorphic maximum integer number of bits, the floating point number fix-point precision, and the sample number;
determining a compression parameter based on the compression control parameter and the bit length of the reference data, comprising:
based on the floating point number fixed point precision, carrying out fixed point processing on the sample gradient to obtain a fixed point integer corresponding to the sample gradient, and based on the sample number and the fixed point integer, determining the occupation corresponding to the sample gradient;
summing the occupation of the sample gradients to determine a total compressed occupation;
performing integer division processing on the homomorphic maximum integer digit and the total compressed occupation to determine ciphertext compression amount;
and taking the occupation of the sample gradient, the total compression occupation and the ciphertext compression amount as the compression parameters.
4. The method of claim 2, wherein when the decision tree is a classification decision tree, the reference data is a sample label, and the compression control parameters include the homomorphic maximum integer number of bits, the number of labels, and the number of samples;
determining a compression parameter based on the compression control parameter and the bit length of the reference data, comprising:
determining a tag occupancy based on the sample tags;
performing product processing on the bit length of the sample number and the number of the labels to determine the total compressed occupied space;
performing integer division processing on the homomorphic maximum integer digit and the compressed total number to determine ciphertext compression amount;
and taking the tag occupation, the total compression occupation and the ciphertext compression amount as the compression parameters.
5. The method of claim 1, wherein sending the first compressed data to a second participant device comprises:
and homomorphic encryption is carried out on the first compressed data, and the homomorphic encrypted first compressed data is sent to second participant equipment, so that the second participant equipment carries out split point construction corresponding to the decision tree based on the homomorphic encrypted first compressed data to obtain split point data.
6. The method of claim 1, wherein the split point data is obtained by the second participant device constructing a split point of the decision tree based on the first compressed data to obtain a split point construction result, and compressing the split point construction result;
the determining a global split point of the decision tree based on the split point data comprises:
decompressing the split point data to obtain a split point construction result;
and determining the global split point of the decision tree by combining the split point construction result and the training sample.
7. The method of claim 6, wherein determining the global split point of the decision tree in combination with the split point construction result and the training samples comprises:
traversing split points of the decision tree based on the training samples to determine a first split point;
traversing split points in the decision tree based on the training samples and the split point construction results to determine second split points;
comparing the first split point and the second split point to determine a global split point of the decision tree.
8. The method of claim 7, wherein traversing split points of the decision tree based on the training samples to determine a first split point comprises:
obtaining a label of the training sample;
traversing split points of the decision tree based on labels of the training samples and the reference data, and determining a first feature split gain histogram corresponding to the first participant device; the first feature splitting gain histogram is used for determining a maximum gain splitting point in the first feature splitting gain histogram;
determining a gain value of a splitting point of the decision tree based on the first feature splitting gain histogram, and selecting the splitting point with the maximum gain value as the first splitting point;
the traversing split points in the decision tree based on the training samples and the split point construction results to determine second split points includes:
obtaining a label of the training sample;
traversing the split point of the decision tree based on the label of the training sample and the split point construction result, and determining a second feature split gain histogram corresponding to the second participant device; the second feature splitting gain histogram is used for determining a maximum gain splitting point in the second feature splitting gain histogram;
and determining the gain value of the splitting point of the decision tree based on the second feature splitting gain histogram, and selecting the splitting point with the maximum gain value as the second splitting point.
9. The method of claim 7, wherein comparing the first split point and the second split point to determine a global split point of the decision tree comprises:
respectively acquiring a gain value of the first split point and a gain value of the second split point;
and comparing the gain value of the first split point with the gain value of the second split point, and selecting the split point corresponding to the larger gain value as the global split point of the decision tree.
10. The method of claim 1, wherein constructing the decision tree based on the global split point comprises:
acquiring a characteristic value and a characteristic code of the global split point;
determining the characteristic corresponding to the characteristic code, and determining a characteristic splitting mode by combining the characteristic and the characteristic value;
and constructing the decision tree based on the feature splitting mode.
11. The method of claim 10, wherein obtaining the eigenvalue and the eigen code of the global split point comprises:
when the global split point belongs to the first party equipment, acquiring a split point code corresponding to the global split point, and determining a characteristic value and a characteristic code of the global split point based on the split point code;
when the global split point belongs to the second participant device, sending a split point code corresponding to the global split point to the second participant device, and receiving a feature value and a feature code returned by the second participant device based on the split point code.
12. A federated learning system-based decision tree construction apparatus, the apparatus comprising:
the system comprises an acquisition module, a decision tree generation module and a decision tree generation module, wherein the acquisition module is used for acquiring a training sample and the type of the decision tree to be constructed, and determining reference data of a splitting point for constructing the decision tree based on the training sample and the type;
the compression module is used for compressing the reference data to obtain first compressed data and sending the first compressed data to second participant equipment;
the receiving module is used for receiving split point data sent by second participant equipment, wherein the split point data is obtained by constructing split points corresponding to the decision tree by the second participant equipment based on the first compressed data;
and the construction module is used for determining the global split point of the decision tree based on the split point data and constructing the decision tree based on the global split point.
13. An electronic device, characterized in that the electronic device comprises:
a memory for storing executable instructions;
a processor for implementing the method of any one of claims 1 to 11 when executing executable instructions stored in the memory.
14. A computer-readable storage medium having stored thereon executable instructions for, when executed by a processor, implementing the method of any one of claims 1 to 11.
15. A computer program product comprising a computer program, characterized in that the computer program realizes the method of any of claims 1 to 11 when executed by a processor.
Background
In the field of artificial intelligence federal learning, a model is trained by a data provider and a data user together, then the data user carries out corresponding prediction based on the respective model, and under the current trend that various industries gradually strengthen data privacy protection, the federal learning is a technology which can cooperate with multi-party data to establish machine learning under the condition of protecting data privacy, and becomes one of the key points of cooperation among various enterprises/industries. Nowadays, the Federal ladder tree model, namely a gradient lifting tree, a random forest and a classification decision tree, has become one of the common and powerful algorithms in the fields of finance and wind control in a longitudinal federal scene, and classification tasks are used most frequently in the field.
However, in the vertical tree model, the guest party (i.e., the active party with the tag) needs to encrypt the gradient or the tag statistic, transmit the gradient or the tag statistic, the host party (i.e., the participant without the tag) needs to receive the homomorphic encrypted ciphertext, then perform calculation, and return the split point, where the split point includes the encrypted construction result, and the guest party needs to further calculate the optimal split point according to the construction result. In a real scene, a guest party performs homomorphic encryption on a tag, a host party performs calculation on a ciphertext and time consumption of transmission of a public network is very high, so that the federal longitudinal tree has a large part of occupation ratio of encryption calculation, ciphertext calculation and communication time in practical application.
Disclosure of Invention
The embodiment of the application provides a decision tree construction method, a decision tree construction device, electronic equipment, a computer readable storage medium and a computer program product based on a federated learning system, which can effectively reduce the data transmission amount and the processing amount in the decision tree construction process, thereby reducing the transmission overhead and improving the construction efficiency of the decision tree.
The technical scheme of the embodiment of the application is realized as follows:
the embodiment of the application provides a decision tree construction method based on a federated learning system, wherein the federated learning system comprises a first participant device with label information and at least one second participant device, and the method is applied to the first participant device and comprises the following steps:
acquiring a training sample and a type of a decision tree to be constructed, and determining reference data for constructing a split point of the decision tree based on the training sample and the type;
compressing the reference data to obtain first compressed data, and sending the first compressed data to second participant equipment;
receiving split point data sent by second participant equipment, wherein the split point data is obtained by constructing split points corresponding to the decision tree by the second participant equipment based on the first compressed data;
and determining a global split point of the decision tree based on the split point data, and constructing the decision tree based on the global split point.
The embodiment of the application provides a decision tree construction device based on a federal learning system, which comprises:
the system comprises an acquisition module, a decision tree generation module and a decision tree generation module, wherein the acquisition module is used for acquiring a training sample and the type of the decision tree to be constructed, and determining reference data of a splitting point for constructing the decision tree based on the training sample and the type;
the compression module is used for compressing the reference data to obtain first compressed data and sending the first compressed data to second participant equipment;
the receiving module is used for receiving split point data sent by second participant equipment, wherein the split point data is obtained by constructing split points corresponding to the decision tree by the second participant equipment based on the first compressed data;
and the construction module is used for determining the global split point of the decision tree based on the split point data and constructing the decision tree based on the global split point.
In the foregoing solution, the compression module is further configured to determine, based on the type of the decision tree, a corresponding compression control parameter, where the compression control parameter includes at least one of: homomorphic maximum integer digits, floating point fixed-point precision, label number and sample number; determining a compression parameter based on the compression control parameter and the bit length of the reference data; and compressing the reference data based on the compression parameters to obtain first compressed data.
In the foregoing solution, when the decision tree is a gradient lifting decision tree, the reference data is a sample gradient, the compression control parameter includes the homomorphic maximum integer number, the floating point number fixed-point precision, and the sample number, and the compression module is further configured to perform fixed-point processing on the sample gradient based on the floating point number fixed-point precision to obtain a fixed-point integer corresponding to the sample gradient, and determine an occupancy corresponding to the sample gradient based on the sample number and the fixed-point integer; summing the occupation of the sample gradients to determine a total compressed occupation; performing integer division processing on the homomorphic maximum integer digit and the total compressed occupation to determine ciphertext compression amount; and taking the occupation of the sample gradient, the total compression occupation and the ciphertext compression amount as the compression parameters.
In the above solution, when the decision tree is a classification decision tree, the reference data is a sample label, the compression control parameter includes the homomorphic maximum integer number of bits, the number of labels, and the number of samples, and the compression module is further configured to determine a label occupancy based on the sample label; performing product processing on the bit length of the sample number and the number of the labels to determine the total compressed occupied space; performing integer division processing on the homomorphic maximum integer digit and the compressed total number to determine ciphertext compression amount; and taking the tag occupation, the total compression occupation and the ciphertext compression amount as the compression parameters.
In the foregoing scheme, the compression module is further configured to perform homomorphic encryption on the first compressed data, and send the homomorphic encrypted first compressed data to the second party device, so that the second party device performs split point construction corresponding to the decision tree based on the homomorphic encrypted first compressed data, to obtain the split point data.
In the foregoing scheme, the split point data is that the second participant device constructs a split point of the decision tree based on the first compressed data to obtain a split point construction result, and performs compression processing on the split point construction result, and the construction module is further configured to perform decompression processing on the split point data to obtain the split point construction result; and determining the global split point of the decision tree by combining the split point construction result and the training sample.
In the above scheme, the building module is further configured to traverse split points of the decision tree based on the training samples to determine a first split point; traversing split points in the decision tree based on the training samples and the split point construction results to determine second split points; comparing the first split point and the second split point to determine a global split point of the decision tree.
In the above scheme, the construction module is further configured to obtain a label of the training sample; traversing split points of the decision tree based on labels of the training samples and the reference data, and determining a first feature split gain histogram corresponding to the first participant device; the first feature splitting gain histogram is used for determining a maximum gain splitting point in the first feature splitting gain histogram; determining a gain value of a splitting point of the decision tree based on the first feature splitting gain histogram, and selecting the splitting point with the maximum gain value as the first splitting point; obtaining a label of the training sample; traversing the split point of the decision tree based on the label of the training sample and the split point construction result, and determining a second feature split gain histogram corresponding to the second participant device; the second feature splitting gain histogram is used for determining a maximum gain splitting point in the second feature splitting gain histogram based on a preset gain calculation formula; and determining the gain value of the splitting point of the decision tree based on the second feature splitting gain histogram, and selecting the splitting point with the maximum gain value as the second splitting point.
In the foregoing solution, the building module is further configured to obtain a gain value of the first split point and a gain value of the second split point respectively; and comparing the gain value of the first split point with the gain value of the second split point, and selecting the split point corresponding to the larger gain value as the global split point of the decision tree.
In the above scheme, the building module is further configured to obtain a feature value and a feature code of the global split point; determining the characteristic corresponding to the characteristic code, and determining a characteristic splitting mode by combining the characteristic and the characteristic value; and constructing the decision tree based on the feature splitting mode.
In the foregoing solution, the building module is further configured to, when the global split point belongs to the first party device, obtain a split point code corresponding to the global split point, and determine a feature value and a feature code of the global split point based on the split point code; when the global split point belongs to the second participant device, sending a split point code corresponding to the global split point to the second participant device, and receiving a feature value and a feature code returned by the second participant device based on the split point code.
An embodiment of the present application provides an electronic device, including:
a memory for storing executable instructions;
and the processor is used for realizing the decision tree construction method based on the federated learning system provided by the embodiment of the application when the executable instructions stored in the memory are executed.
The embodiment of the application provides a computer-readable storage medium, which stores executable instructions and is used for causing a processor to execute the executable instructions so as to realize the method for constructing the decision tree based on the federated learning system provided by the embodiment of the application.
The embodiment of the present application provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, the method for constructing a decision tree based on a federated learning system provided in the embodiment of the present application is implemented.
The embodiment of the application has the following beneficial effects:
compared with the existing process of constructing the decision tree, the method and the device have the advantages that the reference data obtained based on the training samples are compressed according to the type of the decision tree to be constructed to obtain the first compressed data, and then the corresponding split point data is determined through the first compressed data, so that the global split point of the decision tree is determined, and the decision tree is constructed. Therefore, by compressing the intermediate transmission data, the data transmission amount and the processing amount in the process of constructing the decision tree can be effectively reduced, so that the transmission overhead is reduced, and the construction efficiency of the decision tree is improved.
Drawings
Fig. 1 is a schematic view of an implementation scenario of a decision tree construction method based on a federated learning system provided in an embodiment of the present application;
fig. 2 is a schematic structural diagram of an electronic device provided in an embodiment of the present application;
FIG. 3 is a flow chart diagram of a decision tree construction method based on a federated learning system provided in an embodiment of the present application;
FIG. 4 is a schematic flow chart of an alternative data compression method provided by the embodiment of the present application;
FIG. 5 is an alternative diagram of a process for traversing a decision tree provided by an embodiment of the present application;
FIG. 6A is an alternative split point splitting diagram of a split point provided by embodiments of the present application;
FIG. 6B is a schematic diagram of an alternative split point splitting for the split points provided by embodiments of the present application;
FIG. 7A is an alternative split point splitting diagram of a split point provided by embodiments of the present application;
FIG. 7B is an alternative split point splitting diagram of a split point provided by embodiments of the present application;
FIG. 8 is an alternative split point splitting diagram of a split point provided by embodiments of the present application;
FIG. 9 is a flow chart diagram of a decision tree construction method based on a federated learning system provided in an embodiment of the present application;
FIG. 10 is a flow chart diagram of a decision tree construction method based on a federated learning system according to an embodiment of the present application;
FIG. 11 is a schematic compression flow diagram of a four-classification decision tree based on a federated learning system according to an embodiment of the present application;
FIG. 12 is a schematic compression flow chart of a gradient boosting decision tree based on a federated learning system according to an embodiment of the present application;
fig. 13 is an alternative structural schematic diagram of a decision tree construction device based on the federal learning system according to an embodiment of the present application.
Detailed Description
In order to make the objectives, technical solutions and advantages of the present application clearer, the present application will be described in further detail with reference to the attached drawings, the described embodiments should not be considered as limiting the present application, and all other embodiments obtained by a person of ordinary skill in the art without creative efforts shall fall within the protection scope of the present application.
In the following description, reference is made to "some embodiments" which describe a subset of all possible embodiments, but it is understood that "some embodiments" may be the same subset or different subsets of all possible embodiments, and may be combined with each other without conflict.
In the following description, references to the terms "first \ second \ third" are only to distinguish similar objects and do not denote a particular order, but rather the terms "first \ second \ third" are used to interchange specific orders or sequences, where appropriate, so as to enable the embodiments of the application described herein to be practiced in other than the order shown or described herein.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of the present application only and is not intended to be limiting of the application.
Before further detailed description of the embodiments of the present application, terms and expressions referred to in the embodiments of the present application will be described, and the terms and expressions referred to in the embodiments of the present application will be used for the following explanation.
1) Decision Tree (Decision Tree) is a machine learning method, and is a Tree structure, in which each internal node represents a judgment on an attribute, each branch represents an output of a judgment result, and finally each leaf node represents a classification result.
2) Federal machine Learning (Federal machine Learning/Federal Learning), also known as Federal Learning, Joint Learning, and Union Learning. Federal machine learning is a machine learning framework, and can effectively help a plurality of organizations to perform data use and machine learning modeling under the condition of meeting the requirements of user privacy protection, data safety and government regulations. The federated learning is used as a distributed machine learning paradigm, the data island problem can be effectively solved, participators can jointly model on the basis of not sharing data, the data island can be technically broken, and the cooperative intelligence is realized.
Federal Learning (fed Learning, a.k.a. fed Machine Learning) can be divided into three categories: horizontal federal Learning (Horizontal federal Learning), Vertical federal Learning (Vertical federal Learning), and federal Transfer Learning (fed transferred Learning).
Among them, the horizontal federal Learning is also called Feature-Aligned federal Learning (Feature-Aligned fed Learning), that is, the data features of the participants of the horizontal federal Learning are Aligned, which is suitable for the case that the data features of the participants overlap more, and the sample Identifications (IDs) overlap less. Vertical federal Learning is also called Sample-Aligned federal Learning (Sample-Aligned fed Learning), i.e., training samples of participants in vertical federal Learning are Aligned, which is suitable for cases where there is more overlap of participant training Sample IDs and less overlap of data features.
3) Homomorphic Encryption (HE) is a symmetric Encryption algorithm proposed by IBM CraigGentry in 2009. The purpose of homomorphic encryption is to find an encryption algorithm which can perform addition and multiplication operations on a ciphertext, so that the result obtained by performing certain operation on the encrypted ciphertext is exactly equal to the ciphertext obtained by performing expected operation on the plaintext before encryption and then encrypting the plaintext. The homomorphic encryption effectively ensures that a data processing party can directly carry out corresponding processing on the ciphertext of the data and cannot acquire the plaintext information of the data processed by the data processing party. The characteristic of homomorphic encryption ensures that the data and the privacy of the user can be correspondingly secured, so that homomorphic encryption is applied to many real scenes to ensure the security of the data.
If an encryption function satisfies both additive and multiplicative homologies, it is called fully homomorphic encryption. Various encrypted operations (addition, subtraction, multiplication, division, polynomial evaluation, exponential, logarithmic, trigonometric functions, etc.) can be performed using this encryption function.
The decision tree based on the federal learning system in the embodiment of the application can be applied to wind control management, for example, binary prediction that credit of a user is credited or not credited is realized through the constructed decision tree, and then risk control (such as loan or no loan) aiming at the user is executed by combining the prediction result; for another example, the risk degree of the project is predicted and scored through the constructed decision tree, and then the risk control (implementation or non-implementation) for the project is executed by combining the prediction result.
Based on the above explanations of terms and terms involved in the embodiments of the present application, an implementation scenario of the decision tree construction method based on the federal learning system provided in the embodiments of the present application is described below, referring to fig. 1, fig. 1 is a schematic view of an implementation scenario of the decision tree construction method based on the federal learning system provided in the embodiments of the present application, in order to support an exemplary application, a first participant device 200-1 is connected to a second participant device 200-2 through a network 300, where the first participant device 200-1 may be an active device storing user tag information, such as a bank, the second participant device 200-2 may be a passive device storing user feature data, such as a mall or a supermarket, and the first participant device 200-1 and the second participant device 200-2 assist in performing federal learning to make the first participant device 200-1 obtain a decision tree, the network 300 may be a wide area network or a local area network, or a combination of both, using wireless or wired links for data transfer.
A first participant device (including a first participant device 200-1) for obtaining a training sample and a type of a decision tree to be constructed, and determining reference data for constructing a split point of the decision tree based on the training sample and the type; compressing the reference data to obtain first compressed data, and sending the first compressed data to second participant equipment;
a second participant device (including a second participant device 200-2) configured to obtain first compressed data sent by the first participant device; based on the first compressed data, constructing splitting points corresponding to the decision tree to obtain splitting point data; the split point data is sent to the first participant device.
The first participant device (including the first participant device 200-1) is further configured to receive the split point data sent by the second participant device; and determining a global split point of the decision tree based on the split point data, and constructing the decision tree based on the global split point.
In practical application, the constructed decision tree based on the federal learning system can be applied to wind control management, for example, based on user characteristic data of a target user, the credit of the target user is predicted through the decision tree, so that an evaluation result of whether the target user is credited is obtained, and then the credit level of the target user is obtained, so that risk control aiming at the user is executed by combining the predicted credit of the user.
In practical applications, the first participant device 200-1 and the second participant device 200-2 may be independent physical servers, may also be a server cluster or a distributed system formed by a plurality of physical servers, and may also be cloud servers that provide basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDNs, and big data and artificial intelligence platforms. The first participant device 200-1 and the second participant device 200-2 may likewise be, but are not limited to, a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart watch, and the like. The first participant device 200-1 and the second participant device 200-2 may be directly or indirectly connected via wired or wireless communication, and the application is not limited thereto.
The hardware structure of the electronic device implementing the decision tree construction method based on the federal learning system provided in the embodiment of the present application is described in detail below, where the electronic device includes, but is not limited to, a server or a terminal. Referring to fig. 2, fig. 2 is a schematic structural diagram of an electronic device provided in an embodiment of the present application, and the electronic device 200 shown in fig. 2 includes: at least one processor 210, memory 250, at least one network interface 220, and a user interface 230. The various components in electronic device 200 are coupled together by a bus system 240. It will be appreciated that the bus system 240 is used to enable communications among the components of the connection. The bus system 240 includes a power bus, a control bus, and a status signal bus in addition to a data bus. For clarity of illustration, however, the various buses are labeled as bus system 240 in fig. 2.
The Processor 210 may be an integrated circuit chip having Signal processing capabilities, such as a general purpose Processor, a Digital Signal Processor (DSP), or other programmable logic device, discrete gate or transistor logic device, discrete hardware components, or the like, wherein the general purpose Processor may be a microprocessor or any conventional Processor, or the like.
The user interface 230 includes one or more output devices 231, including one or more speakers and/or one or more visual display screens, that enable the presentation of media content. The user interface 230 also includes one or more input devices 232, including user interface components that facilitate user input, such as a keyboard, mouse, microphone, touch screen display, camera, other input buttons and controls.
The memory 250 may be removable, non-removable, or a combination thereof. Exemplary hardware devices include solid state memory, hard disk drives, optical disk drives, and the like. Memory 250 optionally includes one or more storage devices physically located remotely from processor 210.
The memory 250 includes volatile memory or nonvolatile memory, and may include both volatile and nonvolatile memory. The nonvolatile Memory may be a Read Only Memory (ROM), and the volatile Memory may be a Random Access Memory (RAM). The memory 250 described in embodiments herein is intended to comprise any suitable type of memory.
In some embodiments, memory 250 is capable of storing data, examples of which include programs, modules, and data structures, or a subset or superset thereof, to support various operations, as exemplified below.
An operating system 251 including system programs for processing various basic system services and performing hardware-related tasks, such as a framework layer, a core library layer, a driver layer, etc., for implementing various basic services and processing hardware-based tasks;
a network communication module 252 for communicating to other computing devices via one or more (wired or wireless) network interfaces 220, exemplary network interfaces 220 including: bluetooth, wireless compatibility authentication (WiFi), and Universal Serial Bus (USB), etc.;
an input processing module 253 for detecting one or more user inputs or interactions from one of the one or more input devices 232 and translating the detected inputs or interactions.
In some embodiments, the apparatus for constructing a decision tree based on the federal learning system provided in this application may be implemented in software, and fig. 2 shows an apparatus 254 for constructing a decision tree based on the federal learning system, which is stored in a memory 250, and may be software in the form of programs and plug-ins, and includes the following software modules: an obtaining module 2541, a compressing module 2542, a receiving module 2543, and a constructing module 2544, which are logical and thus can be arbitrarily combined or further divided according to the functions implemented, and the functions of the respective modules will be described below.
In other embodiments, the apparatus for constructing a decision tree based on a federated learning system provided in the embodiments of the present Application may be implemented by combining software and hardware, and as an example, the apparatus for constructing a decision tree based on a federated learning system provided in the embodiments of the present Application may be a processor in the form of a hardware decoding processor, which is programmed to execute the method for constructing a decision tree based on a federated learning system provided in the embodiments of the present Application, for example, the processor in the form of a hardware decoding processor may employ one or more Application Specific Integrated Circuits (ASICs), DSPs, Programmable Logic Devices (PLDs), Complex Programmable Logic Devices (CPLDs), Field Programmable Gate Arrays (FPGAs), or other electronic components.
Based on the above description of the implementation scenario and the electronic device of the decision tree construction method based on the federal learning system in the embodiment of the present application, the following description is provided for the decision tree construction method based on the federal learning system in the embodiment of the present application. Referring to fig. 3, fig. 3 is a schematic flow chart of a method for constructing a decision tree based on a federated learning system provided in the embodiment of the present application, where the method for constructing a decision tree based on a federated learning system provided in the embodiment of the present application includes:
step 101, a first participant device obtains a training sample and a type of a decision tree to be constructed, and determines reference data for constructing a split point of the decision tree based on the training sample and the type.
Here, the training sample may be a user common to a first participant device that acts as a label holder and feature provider for the training sample and a second participant device that acts only as a feature provider for the training sample.
For example, when the decision tree to be constructed is applied to the wind control management or the wind control prediction, the label of the training sample may be a binary label for identifying whether the user is credited or not, a binary label for identifying whether the user is highly or lowly loyal, or a binary label for evaluating whether the user is a good customer. Here, the first participant is a platform for credit evaluation of the user, and may be, for example, a financial loan platform (e.g., a bank), and the second participant may be a platform for holding characteristic data of the user, such as various types of consumption platforms (e.g., a mall, a supermarket, an online shopping platform, a game platform, a mobile phone app store, etc.), or an internet company, etc. The characteristic data of the user may include, but is not limited to, basic information, service data, behavior data, device information, and the like of the user. The underlying information includes, but is not limited to, the user's name, gender, age, academic calendar, occupation, cell phone number, identification number, address, income data (e.g., annual salary, monthly salary), and the like. The service data comprises data under a plurality of service scenes, for example, the service scene is loan service, the service data comprises loan data, repayment data and the like, the loan data comprises loan amount, loan time, loan institutions (for example, xx banks) and the like, and the repayment data comprises repayment amount, repayment time, repayment institutions, overdue repayment data (for example, overdue times and overdue days) and the like; for example, the service scenario is a consumption scenario, and the service data includes consumption purposes (e.g., education consumption, shopping consumption, medical consumption, life consumption, etc.), consumption amount, consumption time, consumption organization (e.g., shopping mall, supermarket, convenience store, online shopping store, etc.), consumption mode (e.g., credit card consumption or savings card consumption, etc.), address of the user when consuming, and the like. The behavior data may be, for example, payment mechanisms commonly used by the user (e.g., WeChat payment, bankcard payment, etc.), payment methods commonly used by the user (e.g., two-dimensional code payment method, card swiping payment method), and operation frequency (e.g., frequency of performing payment operations over a period of time), etc. The device information includes the model of the device commonly used by the user, the address where the device is located when the user behavior is implemented, and the like.
Before model training is performed by using training samples, the embodiments of the present application also perform feature classification on data of the training samples, for example, the feature classification of the age is less than 30 years old, 30-50 years old, more than 50 years old, and the like. The model obtained through the feature binning training is more interpretable.
Here, the types of decision trees to be constructed include gradient boosting decision trees, classification decision trees, random forests, and the like.
In actual implementation, when a decision tree to be constructed is a classification decision tree, acquiring a data label corresponding to the characteristic box data; constructing a label vector based on the data label, for example, if the label has only two categories, generating a one-dimensional vector for each sample, and if the label is a positive category, then the vector is [1 ]; if the class is negative, then it is [0 ]; if the label has a plurality of categories, generating a multidimensional one-hot code vector, for example, if the label has four categories, if the label is 1, 2, 3 or 4, generating vectors [1, 0, 0, 0], [0,1, 0, 0], [0, 0,1, 0], [0, 0, 0,1 ]; and determining a label vector set based on the constructed label vectors so as to cooperate the label vector set as reference data.
In actual implementation, when a decision tree to be constructed is a gradient lifting decision tree, acquiring a data label and a residual error corresponding to the characteristic box data; sample gradients, namely a first-order gradient and a second-order gradient, are constructed based on the data labels and the residual errors, illustratively, a total t generation tree needs to be constructed, where t is a positive integer greater than or equal to 1. The first participant device counts the number of labels, and calculates a first-order gradient g and a second-order gradient h according to a residual error between a local label and a first t-1 generation tree; and determining a first-order gradient set and a second-order gradient set based on the constructed first-order gradient and second-order gradient so as to take the first-order gradient set and the second-order gradient set as reference data.
It should be noted that, because the random forest classification is a combination of classification decision trees, the difference is that each tree is added with row/column sampling, the rest of the construction process is consistent with the classification decision trees, and the final prediction result is the synthesis of all trees, the classification decision trees can be referred to for the construction and application process of the random forest classification, which is not described herein again.
And 102, compressing the reference data to obtain first compressed data, and sending the first compressed data to the second party equipment.
Here, referring to fig. 4 for a processing procedure of compressing reference data to obtain first compressed data, fig. 4 is an optional flowchart of the data compression method provided in the embodiment of the present application, and based on fig. 3, step 102 may be implemented as follows:
at step 1021, the first participant device determines a corresponding compression control parameter based on the type of the decision tree.
Here, the compression control parameters are determined by a compression planning module, the compression control parameters including at least one of: homomorphic maximum integer digits, floating point fix-point precision, number of tags, and number of samples.
In practical implementation, when the decision tree is a classification decision tree, the corresponding compression control parameters include the homomorphic maximum integer bit number, the number of tags and the number of samples; when the decision tree is a gradient lifting decision tree, the corresponding compression control parameters include homomorphic maximum integer number, floating point number fix-point precision and sample number.
Step 1022, determining the compression parameter based on the compression control parameter and the bit length of the reference data.
In actual implementation, when the decision tree is a classification decision tree, firstly, the tag occupation is determined based on the sample tags; then, performing product processing on the bit length of the sample number and the number of the labels to determine the total compressed occupied space; then, performing integer division processing on the homomorphic maximum integer digit and the total compression amount to determine the ciphertext compression amount; and finally, taking tag occupation, total compressed occupation and ciphertext compression amount as compression parameters.
Illustratively, the first participant device reads in compression control parameters through the compression planning module, determines a homomorphic maximum integer bit number, a tag number and a sample number, then determines the bit number occupied by a single tag, i.e., a tag occupancy, based on the sample tag, then determines a plaintext compression result, i.e., a total compression occupancy to be a bit length tag number of the sample number, based on the tag number and the bit length of the sample number, and then determines a ciphertext compression amount to be a homomorphic maximum integer bit number// total occupancy based on the homomorphic maximum integer bit number and the total compression occupancy.
It should be noted that, in the case of the decision tree, the processed tag is 0 or 1, so the result of the histogram statistical sum is necessarily less than 1 × sample number, and therefore, the tag vector of one sample can be compressed into an integer, and the number of bits occupied by the compressed plaintext and the amount of compression during the ciphertext compression can be calculated.
In practical implementation, when the decision tree is a gradient lifting decision tree, firstly, based on the fixed point precision of the floating point number, the fixed point processing is carried out on the sample gradient to obtain a fixed point integer corresponding to the sample gradient; carrying out product processing on the number of samples and fixed point integers to determine the occupation of corresponding sample gradients; then, carrying out summation processing on the occupation of the sample gradient to determine the total compressed occupation; then, performing integer division processing on the homomorphic maximum integer digit and the total compressed occupation to determine ciphertext compression amount; and finally, taking the occupation of the sample gradient, the total compressed occupation and the ciphertext compression amount as compression parameters.
Exemplarily, the first participant device reads in a compression control parameter through a compression planning module, determines a homomorphic maximum integer bit number, a floating point fixed-point precision and a sample number, and then determines a first-order gradient g and a second-order gradient h corresponding to the sample based on the sample gradient to perform fixed-point processing on the first-order gradient g and the second-order gradient h to obtain fixed-point integers corresponding to the first-order gradient g and the second-order gradient h, respectively, that is, a first-order gradient g integer equals to int (g × 2^ int(precision of fixed Point)) Second-order gradient h integer int (h x 2^ i)(precision of fixed Point)) And the second order gradient h is itself at [0, 1]]So that no fixed point is required. Then, considering the first-order gradient g integer and the maximum value of the addition result of the second-order gradient h integer part to ensure that the digit does not overflow, carrying out product processing on the sample number and the fixed-point integer, and determining the position occupation of the corresponding sample gradient, namely the position occupation of the first-order gradient g-position number (int (g _ max x 2 ^) which is the position occupation of the corresponding sample gradient(precision of fixed Point)) Sample number), second-order gradient h-place-number (int (h _ max 2 ^) of bits(precision of fixed Point)) Sample number), determining total compressed space (sum of first-order gradient g space occupation and second-order gradient h space occupation) based on first-order gradient g space occupation and second-order gradient h space occupation, and determining ciphertext compression amount to be maximum integer of homomorphism based on maximum integer number of homomorphism and total compressed space occupationThe digit number is divided by the total occupancy by an integer.
Here, if the total occupancy is less than the homomorphic maximum integer number of bits, the algorithm may continue, otherwise the algorithm stops, informing that the number of bits is insufficient.
It should be noted that, because the first-order gradient g may be a negative number, if the integer after plaintext packing is a negative number, the ciphertext compression by addition and multiplication cannot obtain a correct result, and therefore, before the dotting process is performed on the first-order gradient g, the first-order gradient g needs to be shifted to a positive number in order to correctly perform the ciphertext compression operation of the gradient lifting decision tree. Specifically, the first order gradient g in the classification task is between [ -1,1], so it is necessary to first add 1 to g, shifting to between [0,2 ].
Here, after obtaining the compression parameters, the first participant device saves the compression parameters while transmitting the compression parameters to the second participant device.
And 1023, compressing the reference data based on the compression parameters to obtain first compressed data.
In some embodiments, when the decision tree to be constructed is a classification decision tree, the first participant device invokes the plaintext compression module to compress the total space according to the single tag space, and compresses the tag vector of each sample into a large integer, i.e., the first compressed data, and for example, assuming that the tag vector is [0, 0, 0, 1], the tag of the sample is represented by an integer of 80 bits, i.e., 0 and 1 in the tag vector are represented by integers of 20 bits, respectively, so that the tag vector is compressed into a large integer of 80 bits.
In other embodiments, when the decision tree to be constructed is a gradient lifting decision tree, the first party device invokes the plaintext compression module, based on the integer obtained by performing fixed-point on the first-order gradient and the second-order gradient in step 1022, moves the integer corresponding to the first-order gradient to the left by the bit length of the integer corresponding to the second-order gradient to obtain a shifted integer, and adds the shifted integer to the integer corresponding to the second-order gradient to obtain the packed plaintext compression gradient, that is, the first compressed data, exemplarily, assuming that the fixed-point first-order gradient g is an integer with a bit length of 74 bits, and the fixed-point second-order gradient h is an integer with a bit length of 73 bits, and moves the integer corresponding to the first-order gradient to the left by 73 bits, and adds the integer with a bit length of 73 bits corresponding to the second-order gradient, so as to obtain a 147-bit compression gradient g _ h.
Here, taking the gradient boosting decision tree as an example, g of sample 11Is 0.023, h10.01, g of sample 22Is 0.01, h2Is 0.01, and pointing to integers gives g1=23,h1=10,g2=10,h2Compressed to get g _ h 101=2310,g_h2At 1010, the compression gradients are 2310 and 1010.
Therefore, by compressing the transmission data in the interaction process of the first participant equipment and the second participant equipment, the data volume sent by the first participant equipment to the second participant is reduced, the data transmission overhead is reduced, the subsequent homomorphic encrypted data encryption volume is reduced, and the data processing efficiency is improved.
In some embodiments, after the first compressed data is obtained, the first participant device performs homomorphic encryption on the first compressed data, and sends the homomorphic encrypted first compressed data to the second participant device, so that the second participant device performs split point construction corresponding to the decision tree based on the homomorphic encrypted first compressed data to obtain split point data.
And 103, receiving the data of the split point sent by the second party equipment.
Here, the split point data is obtained by the second participant device performing the split point construction corresponding to the decision tree based on the first compressed data.
In some embodiments, based on fig. 3, step 103 may also be implemented by: the first participant device receives split point data sent by the second participant device, wherein the split point data is obtained by the second participant device constructing split points of the decision tree based on the first compressed data to obtain split point construction results and compressing the split point construction results.
In actual implementation, after receiving the first compressed data sent by the first participant device, the second participant device traverses split points of the decision tree based on the first compressed data, for example, referring to fig. 5, where fig. 5 is an optional schematic diagram of a decision tree traversing process provided in an embodiment of the present application. Assuming the sample data is (32 years old, this family), the second participant device traverses the decision tree shown in fig. 5 according to the sample data to obtain a symbol a34The classification result of (1).
As an example, when the decision tree to be constructed is a two-class decision tree, referring to fig. 6A, fig. 6A is an optional split point splitting schematic diagram of split points provided in the embodiment of the present application, for example, the split points of the decision tree are an age and a academic degree, the labels are used to indicate credit levels of users, by performing classification prediction on 5 training samples, and based on the first compression parameter, the second participant device traverses the ages and academic degrees of the 5 samples, and determines split point construction results, such as construction results corresponding to the age classified according to 20 and the academic degree, or construction results corresponding to the age classified according to 30 and the academic degree.
As an example, when the tree to be constructed is a binary gradient boosting decision tree, referring to fig. 7A, fig. 7A is an optional split point splitting schematic diagram of split points provided in the embodiment of the present application, for example, the split points of the decision tree are an age and a scholarly, tags are used to indicate credit level of the user, and by performing classification prediction on 5 training samples, based on the first compression parameter, the second participant device traverses ages and scholarly of 5 samples, and determines a split point construction result, such as a construction result corresponding to an age classified according to 20 and a scholarly classified according to the subject classification, or a construction result corresponding to an age classified according to 30 and a scholarly classified according to the subject classification.
In some embodiments, after the second participant device obtains the split point construction result based on the first compressed data, the second participant device calls the ciphertext compression module, and compresses the split point construction result based on the received compression parameter to obtain the large encrypted integer.
In practical implementation, the compression parameters include total occupation and ciphertext compression amount, a ciphertext compression module is called to compress the encrypted split point construction results, specifically, assuming that n split point construction results are total, the ciphertext compression amount is k, k encrypted split point construction results are taken out from n without being returned circularly, if k split points are not full, all the rest split points are taken out, the encrypted split point construction result taken out first in each circulation is taken as a first summary result, starting from the second encrypted split point construction result to the kth, and the final summary result is (the (k-1) th summary result is 2^ thTotal occupancy) Constructing a result of the kth encrypted split point, storing a final summary result, and jumping out of a loop if the n split points are processed; and processing all the summary results to obtain a plurality of final summary results. Here, each summary result is a large encrypted integer.
Following the above example, after receiving the ciphertexts [ [2310] ] and [ [1010] ], it can be compressed into one ciphertext by calculating [ [2310] ] [ [ 10000 ] ] + [ [1010] ] [ [23101010] ].
In actual implementation, after a plurality of final aggregation results are obtained, the plurality of final aggregation results are sent to the first participant device. It should be noted that, the plurality of final aggregation results may also be made into a compressed ciphertext list, so as to send the compressed ciphertext list to the first party device, where the present application does not limit the manner in which the final aggregation result is sent to the first party device.
And 104, determining the global split point of the decision tree based on the split point data, and constructing the decision tree based on the global split point.
In actual implementation, after receiving the split point data sent by the second participant device, the first participant device decompresses the split point data to obtain a split point construction result; and then determining the global split point of the decision tree by combining the split point construction result and the training sample.
Here, the process of decompressing the split point data to obtain the split point construction result is described in detail as follows:
it should be noted that before decompressing the split point data, it is necessary to decrypt the split point data, that is, decrypt the multiple summary results, that is, the multiple large encrypted integers, to obtain the large integers, and then use the decompression module to disassemble the large integers to obtain the split point construction result, specifically,
for i is 0; i < ciphertext compression amount; i + +;
mask 2^Total occupancy-1;
The statistical result is clear text & mask;
the plaintext is moved to the right for occupying the total bit length;
saving the statistical result;
here, the statistical result is a construction result, and the following processing is performed to determine that the mask is 2^ at each traversalTotal occupancy-1, then determining the statistical result as plaintext&And masking, wherein the plaintext is a large integer obtained by decryption, and then the plaintext is moved to the right for the total occupied bit length to obtain a split point construction result and store the split point construction result.
It should be noted that the decompression process is a decompression process of the compression process of the second participating device, and next, a decompression process of the compression process of the first participating device will be described:
and when the decision tree to be constructed is a classification decision tree, the first participant equipment disassembles the construction results of the plurality of split points according to the number of bits occupied by the single label to obtain the final construction result. Illustratively, when the sample is 1000 (binary bit length is 10), the number of label categories is 4, the bit length of the split point construction result is 40, the integer represented by the first 10 bits of a 40-bit integer is 400, the integer represented by the first 10 bits is 200, the integer represented by the third 10 bits is 100, and the integer represented by the fourth 10 bits is 300, then, for the split point, the number of samples corresponding to the label vectors [1, 0, 0, 0], [0,1, 0, 0], [0, 0,1, 0], [0, 0, 0, 1] is 400, 200, 100, 300, respectively.
When the decision tree to be constructed is a gradient boosting decision tree, the first participant device constructs a junction for the plurality of split pointsFloating the fruits to obtain the sum of the first-order gradients g and the sum of the second-order gradients h after the offset, illustratively, for each construction result, moving the construction result to the right by the second-order gradients h to occupy the bit length to obtain an integer construction result of the first-order gradients g, and then moving the construction result to the right by the second-order gradients h to obtain an integer construction result of the first-order gradients g&(2^h space occupation-1) to obtain the integer construction result of the second order gradient h, then dividing the construction result of the first order gradient g by 2^ s(accuracy)Obtaining the construction result of the first-order gradient g, and finally dividing the construction result of the second-order gradient h by 2^(accuracy)And obtaining a construction result of the second-order gradient h, thus obtaining a construction result of the first-order gradient g and a construction result of the second-order gradient h, namely the sum of the first-order gradients g after the deviation and the sum of the second-order gradients h. The first participant device then restores the sum of the shifted first order gradients g based on the number of samples, specifically, determines the number of samples of the split point build result, subtracts (1 × the number of samples of the split point build result) from the g build result, and thus cancels the shift. Thus, the final construction result is obtained.
In some embodiments, after the final construction result is obtained, the global split point of the decision tree is determined by combining the final construction result and the training sample.
Here, in combination with the final construction result and the training sample, the process of determining the global split point of the decision tree may be that the first participant device traverses the split point of the decision tree based on the training sample to determine the first split point, and meanwhile, the first participant device traverses the split point in the decision tree based on the training sample and the split point construction result to determine the second split point; here, the first split point is an optimal split point at the first participant device, and the second split point is an optimal split point at the second participant device; and comparing the first split point with the second split point to determine a global split point of the decision tree.
In actual implementation, based on a training sample, traversing split points of a decision tree to determine a first split point, which may be a process of obtaining a label of the training sample; traversing split points of the decision tree based on labels and reference data of the training samples, and determining a first feature split gain histogram corresponding to the first participant device; the first feature splitting gain histogram is used for determining a maximum gain splitting point in the first feature splitting gain histogram; and determining the gain value of the splitting point of the decision tree based on the first characteristic splitting gain histogram, and selecting the splitting point with the maximum gain value as the first splitting point.
In actual implementation, traversing split points in the decision tree based on the training sample and the split point construction result to determine a second split point, which may be a process of obtaining a label of the training sample; traversing the split points of the decision tree based on the label of the training sample and the split point construction result, and determining a second feature split gain histogram corresponding to a second participant device; the second feature splitting gain histogram is used for determining a maximum gain splitting point in the second feature splitting gain histogram; and determining the gain value of the splitting point of the decision tree based on the second characteristic splitting gain histogram, and selecting the splitting point with the maximum gain value as a second splitting point.
Here, the process of determining the maximum gain split point in the first and second feature split gain histograms may be determining the maximum gain split point in the first and second feature split gain histograms based on a preset gain formula.
It should be noted that, when the decision tree to be constructed is a classification decision tree, the preset gain formula here may be a formula for calculating information gain, information entropy, kini index, information gain rate, and the like, and exemplarily, when the preset gain formula is a formula for calculating the kini index:
where D is the data set, PkTo assume that there are K classes, the probability that a sample point belongs to the K-th class, illustratively, for dividing D into D according to the characteristic A1And D2Then, then
It should be noted here that the maximum gain split point is determined in different ways based on the attributes of different formulas, such as for the information entropy and the kini index, the smaller the calculated result is, the larger the gain value corresponding to the split point is, and for the information gain and the information gain rate, the larger the calculated result is, the larger the gain value corresponding to the split point is.
Following the above example, referring to fig. 6B, fig. 6B is an alternative split point splitting diagram of the split point provided in the embodiment of the present application, where when 5 training samples are sample 1(19 years old domestic credit high), sample 2(18 years old domestic credit high), sample 3(21 years old high middle credit low), sample 4(29 years old master credit high) and sample 5(34 years old master credit low), respectively, the data is substituted into formula (2) to obtain:
thus, by comparing the kini indexes, the smaller the kini index is, the larger the gain value of the corresponding split point is, and the split point with the maximum gain value, that is, the split point corresponding to the age classification of 30 and the split point corresponding to the academic classification of the subject can be obtained.
In other embodiments, when the decision tree to be constructed is a gradient boosting decision tree, the preset gain formula here is:
where M is the calculated gain, GLIs the sum of the first order gradients of the samples to the left of the split point, GRThe sum of the first order gradients of the samples to the right of the split point, HLIs the sum of the second order gradients of the samples to the left of the split point, HRIs the sum of the second order gradients of the samples at the right side of the splitting point, G is the sum of the first order gradients of the samples at the splitting point, H is the sum of the second order gradients of the samples at the splitting point, and lambda is an adjusting parameter for adjusting the value range of the gain, therefore, in the calculation, it should be noted that there is a value range in the sample data of the training sample, and a plurality of splittable points exist in the value range, based on each splittable point, sample data can be split to obtain sample data on the left side of the splitting point and sample data on the right side of the splitting point, wherein, the sample data on the left side of the splitting point corresponds to the node on the left side of the splitting point after being split at the splitting point, the sample data on the right side of the splitting point corresponds to the node on the right side of the splitting point after being split at the splitting point, and then calculating the gain, namely the value of M, and further taking the splitting point corresponding to the maximum value of M as the maximum gain splitting point.
In the following example, referring to fig. 7B, fig. 7B is an optional splitting point splitting schematic diagram of splitting points provided in the embodiment of the present application, where after the sum of the first-order gradients and the sum of the second-order gradients corresponding to the ages 20 and 30, the academic subjects and the master categories are obtained, the sum of the first-order gradients and the sum of the second-order gradients on the left side and the right side of the splitting point are respectively substituted into the preset gain formula, and gain values corresponding to different splitting points are obtained through calculation, so that the splitting point with the largest gain value, that is, the splitting point corresponding to the age category 30 and the splitting point corresponding to the academic subject category, can be obtained by comparing the gain values.
In actual implementation, after the first split point and the second split point are determined, the first split point and the second split point are compared to determine a global split point of the decision tree, which may be a gain value of the first split point and a gain value of the second split point respectively obtained; and comparing the gain value of the first split point with the gain value of the second split point, and selecting the split point corresponding to the larger gain value as the global split point of the decision tree.
It should be noted that the gain value of the first split point and the gain value of the second split point obtained here are gain values corresponding to the first split point and the second split point obtained in the process of determining the first split point and the second split point.
In some embodiments, after determining the global split point, the process of constructing the decision tree based on the global split point may be by obtaining a feature value and a feature code of the global split point; determining the characteristics of the corresponding characteristic codes, and determining a characteristic splitting mode by combining the characteristics and the characteristic values; and constructing a decision tree based on the characteristic splitting mode.
It should be noted that, when the global split point belongs to the first participant device, the split point code corresponding to the global split point is obtained, and the feature value and the feature code of the global split point are determined based on the split point code; while sending an empty message to the second participant device.
When the global splitting point belongs to second participant equipment, sending a splitting point code corresponding to the global splitting point to the second participant equipment, and receiving a characteristic value and a characteristic code returned by the second participant equipment based on the splitting point code; while recording that the split point belongs to the second participant device.
Exemplarily, referring to fig. 8, fig. 8 is an alternative splitting point splitting schematic diagram of a splitting point provided in this embodiment of the present application, where sample data falling on the splitting point includes sample data corresponding to samples 2, 5, 7, 8, and 10, a feature code corresponding to a global splitting point is 3, and a feature value is 0.4, where when the global splitting point belongs to a second participant device, the first participant device sends the global splitting point in the form of a number to the second participant device, and the second participant device obtains the feature code and the feature value corresponding to the global splitting point based on the number, and sends the corresponding feature code and the feature value to the first participant device. As shown in fig. 8, the left child node obtained after splitting the split point corresponds to sample 2, sample 5, and sample 10, and the right child node corresponds to sample 7 and sample 8.
In practical implementation, when the decision tree to be constructed is a classification decision tree, if the decision tree where the split point is located does not reach the split stopping condition, the splitting is continued until the split stopping condition is reached, and the construction of the decision tree is completed. Here, the probability of the prediction class is determined by the proportion of samples in the leaf node of the first participant device.
In practical implementation, when the decision tree to be constructed is a gradient lifting decision tree, if the decision tree where the splitting point is located does not reach the splitting stopping condition, the splitting is continued until the splitting stopping condition is reached, and the construction of the generation of decision tree is completed. Here, the current predicted value is updated by using the output of the previous generation tree, the first participant device continues to calculate the loss function, determines whether the loss function is converged, if not, continues to construct a new decision tree until the loss function is converged, or determines whether the number of the decision trees reaches a preset number, if not, continues to construct a new decision tree until the preset number is reached, and completes the construction of the decision tree after the loss function is converged or the decision trees reach the preset number.
It should be noted that the condition for stopping splitting may be that the depth of the decision tree reaches a preset depth, the gain value of the decision tree reaches a preset gain value, or the number of samples does not satisfy the requirement for continuing splitting.
In this way, for the case that the calculated amount and the transmission amount of the data are large in the data transmission process between the first participant device and the second participant device, the sample label or the sample gradient is compressed and encrypted in the plaintext state, and it is ensured that the original sample gradient and the sample label can satisfy the addition and subtraction operation under the compression condition, so that the encryption amount and the decryption amount of the first participant device and the calculated amount of the second participant device are reduced.
By applying the embodiment of the application, in the process of constructing the decision tree, the reference data obtained based on the training sample is compressed according to the type of the decision tree to be constructed to obtain the first compressed data, and then the corresponding split point data is determined through the first compressed data, so that the global split point of the decision tree is determined, and the decision tree is constructed. Therefore, by compressing the intermediate transmission data, the data transmission amount and the processing amount in the process of constructing the decision tree can be effectively reduced, so that the transmission overhead is reduced, and the construction efficiency of the decision tree is improved.
In the following, exemplary applications of the embodiments of the present application in two practical application scenarios will be described.
Next, taking an application scenario of a longitudinal federated classification decision tree as an example, a decision tree construction method based on a federated learning system provided in the embodiment of the present application is introduced, fig. 9 is an optional flowchart of the decision tree construction method based on the federated learning system provided in the embodiment of the present application, and referring to fig. 9, the decision tree construction method based on the federated learning system provided in the embodiment of the present application is cooperatively implemented by a first participant device (leading party guest) and a second participant device (participant host). The first participant device and the second participant device may be servers or terminals. Referring to fig. 9, a method for constructing a decision tree based on a federated learning system provided in the embodiment of the present application includes:
step 201, the first participant device and the second participant device respectively complete local initialization, perform binning on local features, and start to jointly construct a classification decision tree.
Here, the classification decision tree to be constructed may be a two-classification decision tree or a multi-classification decision tree. As an example, in the present embodiment, the classification decision tree to be constructed is a four-classification decision tree, and illustratively, for tags 1, 2, 3, 4, vectors [1, 0, 0, 0], [0,1, 0, 0], [0, 0,1, 0], [0, 0, 1] are generated correspondingly.
Step 202, the first participant device processes the label according to the label condition of each sample to obtain a label vector.
Step 203, the first participant device calls a compression planning module, calculates compression parameters and sends the compression parameters to the second participant device.
Here, before the first participant device invokes the compression planning module to calculate the compression parameters, the first participant device needs to determine the compression control parameters, where the compression control parameters include a homomorphic maximum integer number of bits, a number of tags, and a number of samples.
In actual implementation, the first participant device reads in the compression control parameters through the compression planning module, calculates and stores the compression parameters, and simultaneously sends the compression parameters to the second participant device. The compression parameters include the number of bits occupied by a single tag, the total plaintext occupation and the ciphertext compression amount.
As an example, referring to fig. 11, fig. 11 is a schematic diagram of a compression flow of a four-class decision tree based on a federal learning system according to an embodiment of the present application, where the homomorphic maximum integer number of bits is 2046, the number of tags is 4, the number of samples is 1000000, the 1000000 binary is 20 bits, the number of bits occupied by a single tag is 20, the total occupancy of the tags is 20 × 4 — 80 bits, and the ciphertext compression amount is 2046//80 — 25, and then the first participant device sends the number of bits occupied by the single tag 20, the total occupancy of the tag 80, and the ciphertext compression amount 25 to the second participant device.
It should be noted that the merged plaintext is an 80-bit integer, and when the 80-bit integer is operated, the result does not overflow 80 bits, and each 20 bits can correctly reflect the result of tag accumulation, so that even if 1000000 samples are the same tag, the number of bits of the result of tag accumulation does not exceed 20.
And step 204, the first participant device calls a plaintext compression module to compress the label vector of each sample to obtain a large integer corresponding to the label vector of each sample.
And calling a plaintext compression module, namely compressing the label vector of each sample into a large integer according to the number of bits occupied by a single label and the number of bits occupied by the plaintext through a plaintext compression layer in the decision tree.
In the above example, assuming that the tag vector is [0, 0, 0, 1], the sample tag is represented by an integer of 80 bits, i.e., 0 and 1 in the tag vector are represented by integers of 20 bits, respectively, so that the tag vector is compressed into a large integer of 80 bits.
And step 205, homomorphic encrypting the large integer to obtain an encrypted integer, and sending the encrypted integer to the second party equipment.
In step 206, the first participant device and the second participant device initialize the root node, and all samples fall on the root node and are added into the node list.
Step 207, taking out the node from the node list, and at the current splitting node, the first participant device determines the optimal splitting point of the leader by using the local feature and the label.
And step 208, the second participant device constructs a split point based on the received encrypted integer to obtain an encrypted split point construction result.
Here, the second participant device traverses the split point of the decision tree to be constructed based on the received encrypted integer through histogram statistical operation, and obtains an encrypted split point construction result.
Following the above example, the encrypted split point construction result here is an 80-bit encrypted integer.
And step 209, the second party device calls the ciphertext compression module, compresses the encrypted split point construction result based on the received compression parameter to obtain a large encryption integer, and sends the large encryption integer to the first party device.
In the above example, the ciphertext compression amount is 25, the total occupation is 80, and assuming that there are 250 encrypted split point construction results, the 25 encrypted split point construction results are compressed into one ciphertext compression result, that is, 10 times of compression processes are cycled, 10 final summary results are calculated, and for each calculation process of the final summary results, specifically, the final summary result { (first encrypted split point statistical result { 2^ s)80) + second encrypted split point statistic }. 2^ 280… … + twenty-fifth encrypted split point statistics. Here, after 10 final aggregation results are obtained, the 10 final aggregation results are made into a compressed ciphertext list and sent to the first participant device.
It should be noted that the final summary result is a large encrypted integer, and the split point statistical result is a split point construction result.
Step 210, the first participant device decrypts the large encrypted integer using the decompression module to obtain the large integer.
In the above example, the large integer is obtained by decrypting 10 final summary results respectively, and the integer is formed by splicing 25 80-bit integers.
In step 211, the first participant device uses the decompression module to disassemble the large integer to obtain a result constructed for the plurality of split points.
In the above example, the large integers obtained by splicing the 25 80-bit integers are disassembled to obtain 25 80-bit integers, and since there are 10 large integers, 250 80-bit integers are finally obtained.
It should be noted that, here, the 250 80-bit integers are the construction result corresponding to each split point, that is, the construction result of 250 split points.
And 212, the first participant equipment disassembles the construction results of the plurality of split points according to the number of bits occupied by the single label to obtain a final construction result.
In connection with the above example, here, based on 20 bits occupied by a single tag, the 250 split point construction results are disassembled, that is, 80 bits of 250 80-bit integers are divided according to 20 bits, and each 20 bits obtain a corresponding integer, that is, 4 integers are obtained. It should be noted that, in the case of the decision tree, the processed label is 0 or 1, and therefore, the number of samples corresponding to each category label for each split point of the second participant device can be obtained based on 4 integers.
And step 213, calculating gains of the plurality of split points based on the final construction result to obtain the optimal split point of the participant.
And 214, synthesizing the optimal splitting point of the leading party based on the optimal splitting point of the participating party to obtain the optimal splitting point of the whole situation.
In practical implementation, the gains of the optimal splitting point of the participant and the optimal splitting point of the dominant party are compared, and the splitting point with larger gain is selected as the global optimal splitting point.
Step 215, determine whether the stop splitting condition is met, if not, return to step 206, if yes, execute step 216.
In actual implementation, if the splitting condition is met, splitting the current node based on the feature value and the feature code, adding the leaf node into the node list, and returning to step 206;
if the splitting condition is not met, the decision tree is stopped from being built, and step 216 is executed.
And step 216, completing the construction of the decision tree.
By applying the embodiment of the application, in the process of constructing the decision tree, the reference data obtained based on the training sample is compressed according to the type of the decision tree to be constructed to obtain the first compressed data, and then the corresponding split point data is determined through the first compressed data, so that the global split point of the decision tree is determined, and the decision tree is constructed. Therefore, by compressing the intermediate transmission data, the data transmission amount and the processing amount in the process of constructing the decision tree can be effectively reduced, so that the transmission overhead is reduced, and the construction efficiency of the decision tree is improved.
Next, taking an application scenario of classifying a longitudinal gradient boosting decision tree as an example, a decision tree construction method based on a federated learning system provided in the embodiment of the present application is introduced, fig. 10 is an optional flowchart of the decision tree construction method based on the federated learning system provided in the embodiment of the present application, and referring to fig. 10, the decision tree construction method based on the federated learning system provided in the embodiment of the present application is cooperatively implemented by a first participant device (leading party guest) and a second participant device (participant host). The first participant device and the second participant device may be servers or terminals. Referring to fig. 10, a method for constructing a decision tree based on a federated learning system provided in the embodiment of the present application includes:
step 301, the first participant device and the second participant device respectively complete local initialization, perform binning on local features, and start to jointly construct a generation decision tree.
Here, a total t generation tree needs to be constructed, where t is a positive integer greater than or equal to 1. Wherein the height of each decision tree is the same.
As an example, a total of 30 generations of trees need to be constructed, with a tree height of 5.
Step 302, the first participant device counts the number of labels, and calculates a first order gradient g and a second order gradient h according to the local label and the residual error of the previous t-1 generation tree.
Here, if it is a two-classification (n ═ 2) task, the total number of labels is 1, otherwise, the total number of labels is n.
Following the above example, there is a two-class gradient boosting decision tree.
Here, after the operations of step 301 to step 302 described above are completed, the current tag i is set to 0, and the process of step 303 to step 317 is performed for each category of tags in the total tag number.
Step 303, the first participant device invokes a compression planning module, calculates compression parameters and sends the compression parameters to the second participant device.
As an example, referring to fig. 12, fig. 12 is a schematic diagram of a compression flow of a gradient boosting decision tree based on a federated learning system according to an embodiment of the present application, where 53 precision bits, a sample number of 1000000, a homomorphic maximum integer bit number of 2046 are taken as examples, and a g offset value of 1.2312 is fixed to be g integer int (1.2312 x 2^ 2)53) 11089663722437110, then calculate g occupy-bit length (18014398509481984000000) 74 bits, h occupy-bit length (9007199254740992000000) 73 bits, then calculate total occupy-bit length 73+74 147, ciphertext compression amount 2046//147 13, then the first participant device sends g occupy-bit 74, h occupy-bit 73, total occupy-bit 147, ciphertext compression amount 13 to the second participant device.
Step 304, the first participant device invokes the plaintext compression module to compress g, h of each sample, so as to obtain a compression gradient g _ h corresponding to each sample.
In the above example, g is fixed to an integer with a bit length of 74 bits, h is fixed to an integer with a bit length of 73 bits, g is shifted to the left by 73 bits, and h with a bit length of 73 bits after the g is fixed, so that a 147-bit large integer g _ h is obtained.
Step 305, the first participant device homomorphically encrypts the compression gradient g _ h of the corresponding class to obtain [ [ g _ h ] ] and sends the [ [ g _ h ] ] to the second participant device.
Step 306, the first participant device and the second participant device initialize the root node, all samples fall on the root node, and the samples are added into the node list.
And 307, taking out the node from the node list, and determining the optimal splitting point of the leading party by the first participant equipment at the current splitting node by using the local features and g, h.
And 308, the second participant device constructs a split point based on the received encrypted integer to obtain an encrypted split point construction result.
Here, the second participant device takes out a node from the node list, calculates a histogram using the received [ [ g _ h ] ] at the current split node, and constructs a split point from the histogram, resulting in an encrypted split point construction result.
Here, the encrypted split point construction result is that the second participant device traverses the split points based on the local features and the received [ [ g _ h ] ], resulting in an encrypted integer for each split point that is spliced by the sum of g and the sum of h.
Following the above example, the encrypted split point construction result here is a 147 bit encrypted integer.
Step 309, the second participant device calls the ciphertext compression module, compresses the encrypted split point construction result based on the received compression parameter to obtain a large encryption integer, counts the number of samples in each split point construction result, and sends the large encryption integer and the counted number of samples to the first participant device.
In the above example, the ciphertext compression amount is 13, the total occupation is 147, and assuming that there are 130 encrypted split point construction results, the 13 encrypted split point construction results are compressed into one ciphertext compression result, that is, 10 compression processes are cycled, 10 final summary results are calculated, and for each calculation process of the final summary results, specifically, the final summary result { (first encrypted split point statistical result { [ 2^ a)147) + second encrypted split point statistic }. 2^ 2147… … + thirteenth encrypted split point statistic. Here, theAnd after 10 final summary results are obtained, making the 10 final summary results into a compressed ciphertext list and sending the list to the first participant device.
It should be noted that the final summary result is a large encrypted integer, and the split point construction result is a split point statistical result.
In step 310, the first participant device decrypts the large encrypted integer using the decompression module to obtain the large integer.
In the above example, the large integer is obtained by decrypting 10 final summary results respectively, and the integer is formed by splicing 13 147-bit integers.
In step 311, the first participant device uses the decompression module to disassemble the large integer to obtain a result constructed for the plurality of split points.
In the above example, the large integers formed by splicing 13 147-bit integers are disassembled to obtain 13 147-bit integers, and since there are 10 large integers, 130 147-bit integers are finally obtained.
It should be noted that, here, the 130 147-bit integers are the construction results corresponding to each split point, that is, 130 split point construction results.
In step 312, the first participant device performs floating-point transformation on the multiple split-point construction results to obtain the sum of g and the sum of h after the offset.
In the above example, the 130 split point construction results are floating-pointed, that is, the 130 147 bit integers are floating-pointed, specifically, for each 147 bit integer, the 147 bit integer is shifted to the right by 73 bits to obtain the 74 bit integer construction result of g, and the 147 bit integer construction result is shifted to the right&2^73-1, obtaining the 73-bit integer construction result of h, and then dividing the 74-bit integer construction result of g by 2^ 253Obtaining the construction result of g, namely the sum of g after offset, and simultaneously dividing the 73-bit integer construction result of h by 2^ c53And obtaining the construction result of h, namely the sum of h.
The first participant device restores the shifted g based on the number of samples received, step 313.
And step 314, calculating gains of a plurality of splitting points based on the sum of g and the sum of h to obtain the optimal splitting point of the participant.
And 315, synthesizing the optimal splitting point of the leading party based on the optimal splitting point of the participating party to obtain the optimal splitting point of the whole situation.
Step 316, determine whether the stop splitting condition is met, if yes, return to step 308, otherwise, execute step 317.
In actual implementation, if the condition for stopping splitting is not met, splitting the current node based on the feature value and the feature code, adding the leaf node into the node list, returning to step 308, repeating until the current tree is built, if the condition is met, stopping building the decision tree, and executing step 317.
In the above example, when the height of the current decision tree reaches 5, or reaches the preset gain value, or the number of samples does not satisfy the splitting requirement, the splitting stopping condition is met.
Step 317, judging whether the decision trees corresponding to all the classes of the generation are constructed, if so, executing step 318; if the decision trees corresponding to all classes of the generation are not constructed, step 303 is executed.
At step 318, the current predictor is updated using the output of the previous generation tree.
Step 319, detecting whether a stopping condition is met, if not, continuing to jointly construct a decision tree by the first participant device and the second participant device, returning to step 302, and if so, executing step 320.
Following the above example, a penalty function is calculated, and a stop condition is satisfied when it is determined whether the penalty function converges or 30 trees have been constructed.
And step 320, completing the construction of the decision tree.
Therefore, the modeling time is greatly reduced through the embodiment of the application, the modeling speed is improved, and a modeling party can finally establish a plurality of models in less time and adjust parameters to obtain a decision tree model with lossless effect.
By applying the embodiment of the application, in the process of constructing the decision tree, the reference data obtained based on the training sample is compressed according to the type of the decision tree to be constructed to obtain the first compressed data, and then the corresponding split point data is determined through the first compressed data, so that the global split point of the decision tree is determined, and the decision tree is constructed. Therefore, by compressing the intermediate transmission data, the data transmission amount and the processing amount in the process of constructing the decision tree can be effectively reduced, so that the transmission overhead is reduced, and the construction efficiency of the decision tree is improved.
Continuing on the description of the device 254 for constructing a decision tree based on the federal learning system provided in the embodiment of the present application, referring to fig. 13, fig. 13 is a schematic structural diagram of the device 254 for constructing a decision tree based on the federal learning system provided in the embodiment of the present invention, and the device 254 for constructing a decision tree based on the federal learning system provided in the embodiment of the present invention includes:
an obtaining module 2541, configured to obtain a training sample and a type of a decision tree to be constructed, and determine reference data for constructing a split point of the decision tree based on the training sample and the type;
a compression module 2542, configured to perform compression processing on the reference data to obtain first compressed data, and send the first compressed data to a second party device;
a receiving module 2543, configured to receive split point data sent by a second participant device, where the split point data is obtained by the second participant device performing split point construction corresponding to the decision tree based on the first compressed data;
a building module 2544, configured to determine a global split point of the decision tree based on the split point data, and build the decision tree based on the global split point.
In some embodiments, the compression module 2542 is further configured to determine, based on the type of the decision tree, a corresponding compression control parameter, the compression control parameter including at least one of: homomorphic maximum integer digits, floating point fixed-point precision, label number and sample number; determining a compression parameter based on the compression control parameter and the bit length of the reference data; and compressing the reference data based on the compression parameters to obtain first compressed data.
In some embodiments, when the decision tree is a gradient lifting decision tree, the reference data is a sample gradient, the compression control parameter includes the homomorphic maximum integer number, the floating point number spotting precision, and the sample number, and the compression module 2542 is further configured to perform spotting on the sample gradient based on the floating point number spotting precision to obtain a spotting integer corresponding to the sample gradient, and determine an occupancy corresponding to the sample gradient based on the sample number and the spotting integer; summing the occupation of the sample gradients to determine a total compressed occupation; performing integer division processing on the homomorphic maximum integer digit and the total compressed occupation to determine ciphertext compression amount; and taking the occupation of the sample gradient, the total compression occupation and the ciphertext compression amount as the compression parameters.
In some embodiments, when the decision tree is a classification decision tree, the reference data is a sample tag, the compression control parameters include the homomorphic maximum integer number of bits, the number of tags, and the number of samples, and the compression module 2542 is further configured to determine a tag occupancy based on the sample tag; performing product processing on the bit length of the sample number and the number of the labels to determine the total compressed occupied space; performing integer division processing on the homomorphic maximum integer digit and the compressed total number to determine ciphertext compression amount; and taking the tag occupation, the total compression occupation and the ciphertext compression amount as the compression parameters.
In some embodiments, the compression module 2542 is further configured to perform homomorphic encryption on the first compressed data, and send the homomorphic encrypted first compressed data to a second participant device, so that the second participant device performs split point construction corresponding to the decision tree based on the homomorphic encrypted first compressed data, to obtain the split point data.
In some embodiments, the split point data is that the second participant device constructs a split point of the decision tree based on the first compressed data to obtain a split point construction result, and performs compression processing on the split point construction result, and the constructing module 2544 is further configured to perform decompression processing on the split point data to obtain the split point construction result; and determining the global split point of the decision tree by combining the split point construction result and the training sample.
In some embodiments, the constructing module 2544 is further configured to traverse split points of the decision tree based on the training samples to determine a first split point; traversing split points in the decision tree based on the training samples and the split point construction results to determine second split points; comparing the first split point and the second split point to determine a global split point of the decision tree.
In some embodiments, the construction module 2544 is further configured to obtain labels of the training samples; traversing split points of the decision tree based on labels of the training samples and the reference data, and determining a first feature split gain histogram corresponding to the first participant device; the first feature splitting gain histogram is used for determining a maximum gain splitting point in the first feature splitting gain histogram; determining a gain value of a splitting point of the decision tree based on the first feature splitting gain histogram, and selecting the splitting point with the maximum gain value as the first splitting point; obtaining a label of the training sample; traversing the split point of the decision tree based on the label of the training sample and the split point construction result, and determining a second feature split gain histogram corresponding to the second participant device; the second feature splitting gain histogram is used for determining a maximum gain splitting point in the second feature splitting gain histogram based on a preset gain calculation formula; and determining the gain value of the splitting point of the decision tree based on the second feature splitting gain histogram, and selecting the splitting point with the maximum gain value as the second splitting point.
In some embodiments, the building module 2544 is further configured to obtain a gain value of the first split point and a gain value of the second split point respectively; and comparing the gain value of the first split point with the gain value of the second split point, and selecting the split point corresponding to the larger gain value as the global split point of the decision tree.
In some embodiments, the building module 2544 is further configured to obtain feature values and feature codes of the global split points; determining the characteristic corresponding to the characteristic code, and determining a characteristic splitting mode by combining the characteristic and the characteristic value; and constructing the decision tree based on the feature splitting mode.
In some embodiments, the building module 2544 is further configured to, when the global split point belongs to the first participant device, obtain a split point code corresponding to the global split point, and determine a feature value and a feature code of the global split point based on the split point code; when the global split point belongs to the second participant device, sending a split point code corresponding to the global split point to the second participant device, and receiving a feature value and a feature code returned by the second participant device based on the split point code.
It should be noted that the description of the apparatus in the embodiment of the present application is similar to the description of the method embodiment, and has similar beneficial effects to the method embodiment, and therefore, the description is not repeated.
The embodiment of the present application provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, the method for constructing a decision tree based on a federated learning system provided in the embodiment of the present application is implemented.
Embodiments of the present application provide a computer-readable storage medium storing executable instructions, which when executed by a processor, cause the processor to perform the method provided by embodiments of the present application.
In some embodiments, the computer-readable storage medium may be memory such as FRAM, ROM, PROM, EPROM, EEPROM, flash, magnetic surface memory, optical disk, or CD-ROM; or may be various devices including one or any combination of the above memories.
In some embodiments, executable instructions may be written in any form of programming language (including compiled or interpreted languages), in the form of programs, software modules, scripts or code, and may be deployed in any form, including as a stand-alone program or as a module, component, subroutine, or other unit suitable for use in a computing environment.
By way of example, executable instructions may correspond, but do not necessarily have to correspond, to files in a file system, and may be stored in a portion of a file that holds other programs or data, such as in one or more scripts in a hypertext Markup Language (HTML) document, in a single file dedicated to the program in question, or in multiple coordinated files (e.g., files that store one or more modules, sub-programs, or portions of code).
By way of example, executable instructions may be deployed to be executed on one computing device or on multiple computing devices at one site or distributed across multiple sites and interconnected by a communication network.
In summary, the data transmission amount and the processing amount in the process of constructing the decision tree can be effectively reduced through the embodiment of the application, so that the transmission overhead is reduced, and the construction efficiency of the decision tree is improved.
The above description is only an example of the present application, and is not intended to limit the scope of the present application. Any modification, equivalent replacement, and improvement made within the spirit and scope of the present application are included in the protection scope of the present application.
- 上一篇:石墨接头机器人自动装卡簧、装栓机
- 下一篇:图像的确定方法、装置、存储介质及电子装置