A feature binning method and electronic device for federated learning

By automating feature binning in federated learning scenarios, using sample alignment and encrypted label processing, the complexity and inefficiency problems caused by manual adjustments in traditional methods are solved, and efficient WOE monotonicity binning in federated learning is achieved. .

CN118427583BActive Publication Date: 2024-09-03LANXIANG ZHILIAN (HANGZHOU) TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410854757.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-28
Publication Date
2024-09-03
Estimated Expiration
2044-06-28

AI Technical Summary

Technical Problem

In financial risk control federated learning modeling, the traditional feature binning method requires manual adjustment to ensure WOE monotonicity, resulting in a complex process and slow calculation speed, especially when calculating under ciphertext in a federated scenario.

Method used

The initiator and participants automatically complete feature binning without leaking data, use sample alignment and encrypted tags for sorting and binding, determine the WOE monotonicity trend and perform binning to ensure the WOE monotonicity of the binning results. .

Benefits of technology

It realizes automatic feature binning without leaking data, improves calculation efficiency, avoids manual adjustment steps, simplifies the process and accelerates calculation speed.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118427583B
    Figure CN118427583B
Patent Text Reader

Abstract

The present invention discloses a feature binning method and electronic device for federated learning. The method comprises the following steps: the initiator and the participant perform sample alignment, sort the feature values ​​of the initiator's feature and the feature values ​​of the participant's feature respectively, and obtain the first and second sorting numbers corresponding to each sample; the initiator encrypts the label of each sample into an encrypted label and sends it to the participant, and the participant binds the second sorting number with the corresponding encrypted label to obtain a binding data pair, and sends it to the initiator after disrupting the order; the initiator decrypts the encrypted label, sorts all the first and second sorting numbers, and obtains vectors G1 and G2; the initiator performs WOE monotonic binning on vectors G1 and G2 respectively according to the WOE monotonicity trend of vectors G1 and G2, and sends the binning result of vector G2 to the participant. The present invention automatically completes binning while protecting the data privacy of both parties, ensures that the binning result has WOE monotonicity, and improves the calculation efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data processing technology, and in particular to a feature binning method and electronic device for federated learning. Background Art

[0002] The goal of federated learning is to achieve joint modeling on the basis of ensuring data privacy, security, and legal compliance. It is often used in the field of financial risk control. Feature engineering is often required in the process of federated learning modeling. Through feature engineering, the relationship between features and targets is analyzed to obtain better modeling results.

[0003] Feature binning is a common feature engineering method, which is used to divide continuous feature values ​​into several regions and convert continuous data into discrete data. However, in business scenarios such as financial risk control, feature binning needs to control the WOE monotonicity to ensure the linear relationship between the feature and the target, as well as the stability of the model. At present, in the process of financial risk control modeling, feature binning is usually performed first, and then the WOE value of each bin is calculated. The binning is manually adjusted according to the WOE value of the bin, and finally a binning result with WOE monotonicity is obtained. Since financial risk control modeling is carried out in a federal scenario, federal feature binning needs to be calculated under ciphertext. The traditional method of manually adjusting the binning to make the binning result have WOE monotonicity has the disadvantages of complex process and slow calculation speed. Summary of the invention

[0004] In order to solve the above technical problems, the present invention provides a feature binning method and electronic device for federated learning, which can automatically complete feature binning without the data of the initiator and the participants being stored, ensure that the binning results have WOE monotonicity, and improve the computing efficiency.

[0005] In order to solve the above problems, the present invention adopts the following technical solutions:

[0006] A feature binning method for federated learning of the present invention comprises the following steps:

[0007] S1: The initiator and the participants perform sample alignment. The initiator reads the labels of the aligned m samples and the feature values ​​of the initiator's features, and the participants read the feature values ​​of the participant's features of the aligned m samples.

[0008] S2: The initiator sorts the characteristic values ​​of the initiator's characteristics of the m samples to obtain a first sorting number corresponding to each sample, and the participants sort the characteristic values ​​of the participant's characteristics of the m samples to obtain a second sorting number corresponding to each sample;

[0009] S3: The initiator encrypts the label of each sample, obtains the encrypted label corresponding to each sample, and sends it to the participant. The participant binds the second sequence number and the encrypted label corresponding to each sample to obtain the corresponding binding data pair, shuffles the order of the m binding data pairs, and sends them to the initiator.

[0010] S4: The initiator decrypts the encrypted tag in the binding data pair, sorts the m first sorting numbers to obtain a vector G1, and sorts the m second sorting numbers to obtain a vector G2;

[0011] S5: The initiator determines the WOE monotonicity trend of vector G1 and vector G2, performs WOE monotonic binning on vector G1 and vector G2 according to their WOE monotonicity trends, and sends the binning result of vector G2 to the participants;

[0012] S6: The initiator bins the eigenvalues ​​of the initiator's features of the m samples according to the binning results of vector G1, and the participants bin the eigenvalues ​​of the participant's features of the m samples according to the binning results of vector G2.

[0013] In this scheme, the initiator encrypts the label of the sample into an encrypted label and sends it to the participant, so that the participant cannot obtain the plain text of the label. Since the samples of the initiator and the participant are aligned, the participant can know the corresponding relationship between the sample and the encrypted label. The participant converts the characteristic value of the participant's feature into the corresponding second ranking number and binds it with the corresponding encrypted label into a binding data pair. The binding data pair is shuffled and sent to the initiator. In this way, the initiator cannot obtain the plain text of the characteristic value of the participant's feature. After the initiator decrypts the encrypted label, the label of the sample corresponding to each second ranking number can be obtained, so that the initiator can bin the second ranking number. The initiator sorts the first ranking number and the second ranking number in ascending or descending order according to the numerical value to obtain vector G1 and vector G2. According to the WOE monotonic trend of vector G1 and vector G2, vector G1 and vector G2 are monotonically binned by WOE. The initiator and the participant bin the characteristic values ​​they hold according to the binning results of vector G1 and vector G2.

[0014] Preferably, the labels of the m samples form a label vector Y={y1,y2,...y m}, the eigenvalues ​​of the initiator features of the m samples constitute the initiator feature vector X A ={x A1 , x A2 ,……x Am}, the eigenvalues ​​of the participant characteristics of the m samples constitute the participant feature vector X B ={x B1 , x B2 ,……xBm}, where 1≤i≤m, y i is the label of the i-th sample, x Ai is the characteristic value of the initiator feature of the i-th sample, x Bi is the characteristic value of the participant characteristic of the i-th sample.

[0015] Preferably, step S2 comprises the following steps: the initiator performs a A Sort and get the first sort number vector R A ={r A1 , r A2 ,……r Am}, r Ai is the first ranking number corresponding to the i-th sample, and the participant has a corresponding feature vector X B Sort and get the second sort number vector R B ={r B1 , r B2 ,……r Bm}, r Bi is the second ranking number corresponding to the i-th sample.

[0016] Preferably, in step S3, the initiator encrypts the label of each sample, obtains the encrypted label corresponding to each sample, and sends it to the participating party as follows: the initiator encrypts the label vector Y to obtain the encrypted label vector Enc(Y)={Enc(y1), Enc(y2),...Enc(y m )},Enc(y i ) is the encrypted label corresponding to the i-th sample, and the encrypted label vector Enc(Y) is sent to the participants.

[0017] Preferably, in step S3, the participant binds the second sequence number and encryption tag corresponding to each sample to obtain a corresponding binding data pair, and sends the m binding data pairs to the initiator after shuffling the order as follows: the participant binds the second sequence number and encryption tag corresponding to each sample to obtain a binding data pair set D={d1, d2, ... d m}, d i =(r Bi ,Enc(y i )),d i For the binding data pair corresponding to the i-th sample, the binding data pairs in the binding data pair set D are shuffled and sent to the initiator.

[0018] Preferably, in step S5, the initiator determines the vector G j The method of monotonic trend of WOE is as follows, 1≤j≤2:

[0019] Calculate the vector Gj The WOE value of the first group composed of the first a values ​​and the WOE value of the second group composed of the last a values. If the WOE value of the first group is greater than the WOE value of the second group, then the judgment vector G j The WOE monotonicity trend is monotonically decreasing; if the WOE value of the first group is less than the WOE value of the second group, then the judgment vector G j The monotonic trend of WOE is monotonically increasing.

[0020] As a preference, in step S5, the initiator j The monotonic trend of WOE for vector G j The method for performing WOE monotonic binning is as follows, 1≤j≤2:

[0021] M1: vector G j The sorting numbers in are assigned to the bins with the same numbers as the sorting numbers, and a bin vector F={f1,f2,…f q}, 1≤t≤q≤m, f t is the bin numbered t;

[0022] M2: Determine the WOE monotonicity trend of the bin group consisting of two adjacent bins in the bin vector F in ascending order. If the WOE monotonicity trend of the bin group is the same as that of vector G j The WOE monotonicity trend of the bin group is opposite to that of the vector G. j If the WOE monotonicity trend of the bin group is the same or the WOE monotonicity trend of the bin group is monotonically unchanged, the two bins in the bin group are not merged, and a new bin vector F is finally obtained;

[0023] M3: Calculate the p_value of each bin in the new bin vector F, adjust the bins in the bin vector F according to the p_value, and get the final bin vector F. The final bin vector F is vector G. j The binning results.

[0024] Preferably, the method for determining the WOE monotonicity trend of a bin group consisting of two adjacent bins in step M2 is as follows:

[0025] Calculate the WOE values ​​of two bins. If the WOE value of the previous bin is greater than the WOE value of the next bin, the WOE monotonic trend of the bin group is monotonically decreasing; if the WOE value of the previous bin is less than the WOE value of the next bin, the WOE monotonic trend of the bin group is monotonically increasing; if the WOE value of the previous bin is equal to the WOE value of the next bin, the WOE monotonic trend of the bin group is monotonically unchanged.

[0026] Preferably, the step M3 comprises the following steps:

[0027] M31: Calculate the p_value of each bin in the new bin vector F;

[0028] M32: Determine whether the p_value values ​​of all bins in the bin vector F are less than the threshold P. If so, end and get the final bin vector F. The final bin vector F is vector G. j Otherwise, execute step M33;

[0029] M33: Merge the two bins with the largest p_value into one bin, calculate the p_value of the merged bin, and jump to step M32.

[0030] An electronic device of the present invention comprises a memory and a processor, wherein the memory stores executable codes, and when the executable codes are executed by the processor, the above method is executed.

[0031] The beneficial effects of the present invention are: it can automatically complete feature binning without the data of the initiator and the participant being stored, ensure that the binning results have WOE monotonicity, and do not need to manually adjust the binning, thereby improving the calculation efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] Figure 1 is a flow chart of an embodiment. DETAILED DESCRIPTION

[0033] The technical solution of the present invention is further specifically described below through embodiments and in conjunction with the accompanying drawings.

[0034] Embodiment: This embodiment provides a feature binning method for federated learning, such as Figure 1 As shown, the following steps are included:

[0035] S1: The initiator and the participants perform sample alignment. The initiator reads the labels of the aligned m samples and the feature values ​​of the initiator's features, and the participants read the feature values ​​of the participant's features of the aligned m samples.

[0036] The labels of m samples form a label vector Y={y1,y2,…y m}, the eigenvalues ​​of the initiator features of the m samples constitute the initiator feature vector X A ={x A1 , x A2 ,……x Am}, the eigenvalues ​​of the participant characteristics of the m samples constitute the participant feature vector X B ={x B1 , x B2,……x Bm}, where 1≤i≤m, y i is the label of the i-th sample, x Ai is the characteristic value of the initiator feature of the i-th sample, x Bi is the feature value of the participant feature of the i-th sample. In this embodiment, the label of the sample is represented by 0 or 1. If the label of the sample is 1, the sample is a positive sample, and if the label of the sample is 0, the sample is a negative sample.

[0037] S2: The initiator sorts the characteristic values ​​of the initiator's characteristics of the m samples to obtain a first sorting number corresponding to each sample, and the participant sorts the characteristic values ​​of the participant's characteristics of the m samples to obtain a second sorting number corresponding to each sample.

[0038] The initiator’s feature vector X A After sorting, we get the first sorting number vector R A ={r A1 , r A2 ,……r Am}, r Ai is the first ranking number corresponding to the i-th sample, and the participant feature vector X B After sorting, we get the second sorting number vector R B ={r B1 , r B2 ,……r Bm}, r Bi is the second ranking number corresponding to the i-th sample. For example, if the initiator feature is age, the initiator feature vector X A ={10,28,15,24}, after sorting, we get the first sorting number vector R A ={1,4,2,3}.

[0039] S3: The initiator encrypts the label of each sample, obtains the encrypted label corresponding to each sample, and sends it to the participants. The participants bind the second sorting number and the encrypted label corresponding to each sample to obtain the corresponding binding data pair, shuffle the m binding data pairs and send them to the initiator.

[0040] The initiator encrypts the label of each sample, obtains the encrypted label corresponding to each sample, and gives it to the participants as follows: The initiator encrypts the label vector Y and obtains the encrypted label vector Enc(Y)={Enc(y1), Enc(y2),…Enc(y m )},Enc(y i ) is the encrypted label corresponding to the i-th sample, and the encrypted label vector Enc(Y) is sent to the participants.

[0041] The participant binds the second sequence number and encryption tag corresponding to each sample to obtain the corresponding binding data pair, and sends the m binding data pairs to the initiator after shuffling the order as follows: The participant binds the second sequence number and encryption tag corresponding to each sample to obtain the binding data pair set D = {d1, d2, ... d m}, d i =(r Bi ,Enc(y i )),d i For the binding data pair corresponding to the i-th sample, the binding data pairs in the binding data pair set D are shuffled and sent to the initiator.

[0042] S4: The initiator decrypts the encrypted tag in the binding data pair, sorts the m first sorting numbers to obtain a vector G1, and sorts the m second sorting numbers to obtain a vector G2.

[0043] The initiator sorts the first sort number and the second sort number in ascending or descending order according to the numerical value to obtain vector G1 and vector G2. For example: m=5, the first sort number vector R A ={1,4,5,2,3}, the initiator has the first sort number vector R A Sort the 5 first sort numbers in and get vector G1={1,2,3,4,5}.

[0044] S5: The initiator determines the WOE monotonicity trend of vector G1 and vector G2, performs WOE monotonic binning on vector G1 and vector G2 according to their WOE monotonicity trends, and sends the binning result of vector G2 to the participants.

[0045] The initiator determines the vector G j The method of monotonic trend of WOE is as follows, 1≤j≤2:

[0046] Calculate the vector G j The WOE value of the first group composed of the first a values ​​and the WOE value of the second group composed of the last a values. If the WOE value of the first group is greater than the WOE value of the second group, then the judgment vector G j The WOE monotonicity trend is monotonically decreasing; if the WOE value of the first group is less than the WOE value of the second group, then the judgment vector G j The monotonic trend of WOE is monotonically increasing.

[0047] In this embodiment, a=0.25*m. If the WOE value of the first group is equal to the WOE value of the second group, the value of a is increased, for example, the value of a is adjusted to a=0.3*m. If the WOE value of the first group is still equal to the WOE value of the second group, the value of a is continued to be increased until the vector G is obtained. j The monotonic trend of WOE is a monotonically decreasing or monotonically increasing result.

[0048] The initiator uses the vector G j The monotonic trend of WOE for vector G j The method for performing WOE monotonic binning is as follows, 1≤j≤2:

[0049] M1: vector G j The sorting numbers in are assigned to the bins with the same numbers as the sorting numbers, and a bin vector F={f1,f2,…f q}, 1≤t≤q≤m, f t is the bin numbered t.

[0050] That is, assign the same sort number to the same bin, and set the bin number to the value of the sort number. For example: vector G j ={1,2,2,2,3}, then 1 is assigned to bin numbered 1, three 2s are assigned to bin numbered 2, and 3 is assigned to bin numbered 3.

[0051] M2: Determine the WOE monotonicity trend of the bin group consisting of two adjacent bins in the bin vector F in ascending order. If the WOE monotonicity trend of the bin group is the same as that of vector G j The WOE monotonicity trend of the bin group is opposite to that of the vector G. j If the WOE monotonicity trend of the bin group is the same or the WOE monotonicity trend of the bin group is monotonically unchanged, the two bins in the bin group are not merged, and a new bin vector F is finally obtained.

[0052] The specific steps of step M2 are as follows:

[0053] M21: Set I=1;

[0054] M22: Calculate J=I+1 and determine whether J is greater than q. If so, the process ends and a new binning vector F is obtained. Otherwise, the process proceeds to step M23.

[0055] M23: Determine the WOE monotonic trend of the bin group consisting of bin numbered I and bin numbered J;

[0056] If the WOE monotonic trend of the binned group is the same as the vector Gj If the WOE monotonic trends of the bin groups are inconsistent and the WOE monotonic trends of the bin groups are not monotonically constant, the bin numbered J is merged into the bin numbered I (i.e., the bin numbered after the merger is I), and then step M24 is executed;

[0057] If the WOE monotonic trend of the binned group is the same as the vector G j If the WOE monotonic trends of the bin groups are the same or the WOE monotonic trends of the bin groups are monotonically unchanged, the bin numbered I and the bin numbered J are not merged, and then step M25 is executed;

[0058] M24: Calculate J=J+1 and determine whether J is greater than q. If so, end the process and obtain a new binning vector F. Otherwise, jump to step M23.

[0059] M25: Assign I a value of I=J and jump to step M22.

[0060] In this embodiment, when the WOE monotonic trend of the bin group is monotonically increasing, the vector G j The WOE monotonicity trend is monotonically decreasing, or the WOE monotonicity trend of the bin group is monotonically decreasing, vector G j If the WOE monotonicity trend is monotonically increasing, the two bins in the bin group are merged into one bin. In other cases, the two bins are not merged.

[0061] The method for determining the monotonic trend of WOE of a bin group consisting of two adjacent bins is as follows:

[0062] Calculate the WOE values ​​of two bins. If the WOE value of the previous bin is greater than the WOE value of the next bin, the WOE monotonic trend of the bin group is monotonically decreasing; if the WOE value of the previous bin is less than the WOE value of the next bin, the WOE monotonic trend of the bin group is monotonically increasing; if the WOE value of the previous bin is equal to the WOE value of the next bin, the WOE monotonic trend of the bin group is monotonically unchanged.

[0063] For example: bin numbered 2 and bin numbered 3 constitute a bin group. If the WOE value of bin numbered 2 is greater than the WOE value of bin numbered 3, the WOE monotonic trend of the bin group is monotonically decreasing; if the WOE value of bin numbered 2 is less than the WOE value of bin numbered 3, the WOE monotonic trend of the bin group is monotonically increasing; if the WOE value of bin numbered 2 is equal to the WOE value of bin numbered 3, the WOE monotonic trend of the bin group is monotonically unchanged.

[0064] M3: Calculate the p_value of each bin in the new bin vector F, adjust the bins in the bin vector F according to the p_value, and get the final bin vector F. The final bin vector F is vector G. j The binning results.

[0065] Step M3 includes the following steps:

[0066] M31: Calculate the p_value of each bin in the new bin vector F;

[0067] M32: Determine whether the p_value values ​​of all bins in the bin vector F are less than the threshold P. If so, end and get the final bin vector F. The final bin vector F is vector G. j Otherwise, execute step M33;

[0068] M33: Merge the two bins with the largest p_value into one bin, calculate the p_value of the merged bin, and jump to step M32.

[0069] The method to calculate the p_value of the bin is as follows:

[0070] F1: Calculate the z distribution value of the bin, and calculate the p_value of the bin based on the z distribution value of the bin, p_value=1-cdf(z), where cdf( ) represents the cumulative distribution function, which is used to describe the probability distribution of a variable, and z is the z distribution value;

[0071] F2: Determine whether the number of samples in the bin is less than the threshold count_threshold. If so, p_value=p_value+1;

[0072] F3: Determine whether the number of positive samples in the bin is less than the threshold event_count_threshold. If so, p_value=p_value+1 to get the final p_value of the bin.

[0073] S6: The initiator bins the eigenvalues ​​of the initiator's features of the m samples according to the binning results of vector G1, and the participants bin the eigenvalues ​​of the participant's features of the m samples according to the binning results of vector G2.

[0074] After the participants obtain the binning results of vector G2, they find the corresponding eigenvalues ​​according to the second sequence number in each bin, assign the eigenvalues ​​to the corresponding bins, and obtain the binning results of the eigenvalues. Similarly, the initiator finds the corresponding eigenvalues ​​according to the first sequence number in each bin to complete the eigenvalue binning.

[0075] In this scheme, the initiator encrypts the label of the sample into an encrypted label and sends it to the participant, so that the participant cannot obtain the plain text of the label. Since the samples of the initiator and the participant are aligned, the participant can know the corresponding relationship between the sample and the encrypted label. The participant converts the characteristic value of the participant's feature into the corresponding second sequence number and binds it with the corresponding encrypted label into a binding data pair. The binding data pair is shuffled and sent to the initiator. In this way, the initiator cannot obtain the plain text of the characteristic value of the participant's feature. After the initiator decrypts the encrypted label, it can obtain the label of the sample corresponding to each second sequence number, so that the initiator can bin the second sequence number.

[0076] The initiator sorts the first and second sort numbers in ascending or descending order according to the numerical values ​​to obtain vectors G1 and G2. According to the WOE monotonicity trend of vectors G1 and G2, vectors G1 and G2 are binned by WOE monotonicity. The initiator and participants bin their respective eigenvalues ​​according to the binning results of vectors G1 and G2. During the entire binning process, the data of the initiator and participants are not stored, which protects the data privacy of both parties, automatically completes the feature binning, and the binning results meet the WOE monotonicity. There is no need to manually adjust the binning, which improves the calculation efficiency.

[0077] This method can be used in vertical federated learning modeling scenarios in financial risk control business. For example: Company A and Company B conduct data cooperation modeling, and build a scorecard model under the premise of protecting the privacy of the original data of both parties. The features can be historical default records, credit scores, personal information, etc. First, the data of both parties need to be binned by features. Using the feature binning method of this embodiment, the monotonous binning results of WOE can be obtained at one time.

[0078] An electronic device of this embodiment includes a memory and a processor. The memory stores executable code. When the executable code is executed by the processor, the above method is executed.

Claims

1. A feature binning method for federated learning, characterized in that: The following steps are involved: S1: The initiator and the participants perform sample alignment. The initiator reads the labels of the aligned m samples and the feature values ​​of the initiator's features, and the participants read the feature values ​​of the participant's features of the aligned m samples. S2: The initiator sorts the characteristic values ​​of the initiator's characteristics of the m samples to obtain a first sorting number corresponding to each sample, and the participants sort the characteristic values ​​of the participant's characteristics of the m samples to obtain a second sorting number corresponding to each sample; S3: The initiator encrypts the label of each sample, obtains the encrypted label corresponding to each sample, and sends it to the participant. The participant binds the second sequence number and the encrypted label corresponding to each sample to obtain the corresponding binding data pair, shuffles the order of the m binding data pairs, and sends them to the initiator. S4: The initiator decrypts the encrypted tag in the binding data pair, sorts the m first sorting numbers to obtain a vector G1, and sorts the m second sorting numbers to obtain a vector G2; S5: The initiator determines the WOE monotonicity trend of vector G1 and vector G2, performs WOE monotonic binning on vector G1 and vector G2 according to their WOE monotonicity trends, and sends the binning result of vector G2 to the participants; S6: The initiator bins the eigenvalues ​​of the initiator's features of the m samples according to the binning results of vector G1, and the participants bin the eigenvalues ​​of the participant's features of the m samples according to the binning results of vector G2.

2. A feature binning method for federated learning according to claim 1, characterized in that: The labels of the m samples form a label vector Y={y1,y2,...y m }, the eigenvalues ​​of the initiator features of the m samples constitute the initiator feature vector X A ={x A1 , x A2 ,……x Am }, the eigenvalues ​​of the participant characteristics of the m samples constitute the participant feature vector X B ={x B1 ,x B2 ,……x Bm }, where 1≤i≤m, y i is the label of the i-th sample, x Ai is the characteristic value of the initiator feature of the i-th sample, x Bi is the characteristic value of the participant characteristic of the i-th sample.

3. A feature binning method for federated learning according to claim 2, characterized in that: The step S2 comprises the following steps: The initiator's feature vector X A Sort and get the first sort number vector R A ={r A1 , r A2 ,……r Am }, r Ai is the first ranking number corresponding to the i-th sample, and the participant has a corresponding feature vector X B Sort and get the second sort number vector R B ={r B1 , r B2 ,……r Bm }, r Bi is the second ranking number corresponding to the i-th sample.

4. A feature binning method for federated learning according to claim 3, characterized in that: In step S3, the initiator encrypts the label of each sample, obtains the encrypted label corresponding to each sample, and sends it to the participating party as follows: The initiator encrypts the label vector Y and obtains the encrypted label vector Enc(Y)={Enc(y1), Enc(y2),…Enc(y m )},Enc(y i ) is the encrypted label corresponding to the i-th sample, and the encrypted label vector Enc(Y) is sent to the participants.

5. A feature binning method for federated learning according to claim 4, characterized in that: In step S3, the participant binds the second sequence number and the encryption tag corresponding to each sample to obtain a corresponding binding data pair, and sends the m binding data pairs to the initiator after shuffling the order as follows: The participants bind the second sorting number and encryption label corresponding to each sample to obtain a bound data pair set D = {d1, d2, ... d m }, d i =(r Bi ,Enc(y i )),d i For the binding data pair corresponding to the i-th sample, the binding data pairs in the binding data pair set D are shuffled and sent to the initiator.

6. A feature binning method for federated learning according to claim 1, characterized in that: In step S5, the initiator determines the vector G j The method of monotonic trend of WOE is as follows, 1≤j≤2: Calculate the vector G j The WOE value of the first group composed of the first a values ​​and the WOE value of the second group composed of the last a values. If the WOE value of the first group is greater than the WOE value of the second group, then the judgment vector G j The WOE monotonicity trend is monotonically decreasing; if the WOE value of the first group is less than the WOE value of the second group, then the judgment vector G j The monotonic trend of WOE is monotonically increasing.

7. A feature binning method for federated learning according to claim 1, characterized in that: In step S5, the initiator uses the vector G j The monotonic trend of WOE for vector G j The method for performing WOE monotonic binning is as follows, 1≤j≤2: M1: vector G j The sorting numbers in are assigned to the bins with the same numbers as the sorting numbers, and a bin vector F={f1,f2,…f q }, 1≤t≤q≤m, f t is the bin numbered t; M2: Determine the WOE monotonicity trend of the bin group consisting of two adjacent bins in the bin vector F in ascending order. If the WOE monotonicity trend of the bin group is the same as that of vector G j The WOE monotonicity trend of the bin group is opposite to that of the vector G. j If the WOE monotonicity trend of the bin group is the same or the WOE monotonicity trend of the bin group is monotonically unchanged, the two bins in the bin group are not merged, and a new bin vector F is finally obtained; M3: Calculate the p_value of each bin in the new bin vector F, adjust the bins in the bin vector F according to the p_value, and get the final bin vector F. The final bin vector F is vector G. j The binning results.

8. A feature binning method for federated learning according to claim 7, characterized in that: The method for determining the WOE monotonicity trend of a bin group consisting of two adjacent bins in step M2 is as follows: Calculate the WOE values ​​of two bins. If the WOE value of the previous bin is greater than the WOE value of the next bin, the WOE monotonic trend of the bin group is monotonically decreasing; if the WOE value of the previous bin is less than the WOE value of the next bin, the WOE monotonic trend of the bin group is monotonically increasing; if the WOE value of the previous bin is equal to the WOE value of the next bin, the WOE monotonic trend of the bin group is monotonically unchanged.

9. A feature binning method for federated learning according to claim 7, characterized in that: The step M3 comprises the following steps: M31: Calculate the p_value of each bin in the new bin vector F; M32: Determine whether the p_value values ​​of all bins in the bin vector F are less than the threshold P. If so, end and get the final bin vector F. The final bin vector F is vector G. j Otherwise, execute step M33; M33: Merge the two bins with the largest p_value into one bin, calculate the p_value of the merged bin, and jump to step M32.

10. An electronic device, characterized in that: The invention comprises a memory and a processor, wherein the memory stores executable codes, and when the executable codes are executed by the processor, the method according to any one of claims 1 to 9 is executed.