Method, device, equipment and storage medium for selecting supplier of training data set
By calculating the SHAP target value in the training data set to evaluate the contribution of each training data set, it solves the problem of evaluating the importance of data sets in multi-party data modeling and improves the prediction accuracy of the machine learning model.
Patent Information
- Application Number
- CN202010123970.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-02-28
- Publication Date
- 2025-01-24
- Estimated Expiration
- 2040-02-28
AI Technical Summary
The prior art lacks effective methods to calculate the contribution of each party's training data set during multi-party data modeling.
By obtaining each training data set for training the machine learning model, the Shapley Additivity Model Interpretation Method (SHAP) target value of each feature is calculated, and the contribution of each training data set is calculated based on these SHAP target values.
The accurate evaluation of the importance of the training data set in the machine learning model is implemented to help choose the appropriate training data set, thereby improving the accuracy of the model on data prediction.
Smart Images

Figure CN111325353B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing technology of financial technology (Fintech), and in particular to a method, device, equipment and storage medium for calculating the contribution of a training data set. Background Art
[0002] With the development of computer technology, more and more technologies are applied in the financial field. The traditional financial industry is gradually transforming to financial technology (Fintech), and data processing technology is no exception. However, due to the security and real-time requirements of the financial industry, higher requirements are also placed on technology.
[0003] Data is very important for machine learning modeling. A piece of high-quality data can help improve the performance of machine learning models, thereby increasing business revenue or reducing operating costs. In the large-scale practical deployment of machine learning, the value of data is increasingly highlighted, and data has gradually evolved into an asset. With the development and popularization of technologies such as information technology, the Internet, and big data, all walks of life have accumulated a lot of data, providing more data selection space for machine learning modeling. In the actual modeling process, business personnel often use data from different suppliers and different categories. The features contained in the data sets of each party are different, and the contribution to the performance of the machine learning model is also different. The contribution of the data set is not only conducive to understanding the model, but also can be used as a reference indicator for data pricing when trading data sets. Party A is willing to spend more money on data sets with high contribution, and Party B will also ask for a higher price for data with high contribution.
[0004] Currently, there are methods to calculate the importance of a single feature in a training dataset, but there is no method to evaluate the importance of each party’s training dataset when modeling multiple parties’ data. Therefore, how to calculate the contribution of each party’s training dataset is an urgent problem to be solved. Summary of the invention
[0005] The main purpose of the present invention is to provide a method, device, equipment and storage medium for calculating the contribution of a training data set, aiming to solve the existing technical problem of how to calculate the contribution of each party's training data set.
[0006] To achieve the above object, the present invention provides a method for calculating the contribution of a training data set, the method comprising the steps of:
[0007] Obtain various training data sets for training machine learning models;
[0008] Calculating the Shapley Additive Model Interpretation Method SHAP target value for each feature in the training data set;
[0009] The contribution of the training data set is calculated according to the SHAP target value of each feature in the training data set.
[0010] Preferably, the step of calculating the SHAP target value of each feature in the training data set includes:
[0011] Calculate the SHAP value corresponding to each feature in the training data set, calculate the absolute value of the SHAP value corresponding to each feature, and obtain the SHAP absolute value corresponding to each feature;
[0012] Each feature in the training data set is determined as a target feature, and a SHAP target value corresponding to the target feature is obtained according to the SHAP absolute value of the target feature in different training data sets.
[0013] Preferably, the step of obtaining a SHAP target value corresponding to the target feature according to the SHAP absolute value of the target feature in different training data sets comprises:
[0014] Determine the SHAP absolute values of the target feature in different training data sets, and calculate the SHAP average values corresponding to the SHAP absolute values of the target feature in different training data sets;
[0015] The SHAP average value is determined as the SHAP target value corresponding to the target feature.
[0016] Preferably, the step of calculating the SHAP value corresponding to each feature in the training data set includes:
[0017] Calculate the expected marginal benefit corresponding to each feature in the training data set;
[0018] The SHAP value of each feature corresponding to the marginal benefit expectation is calculated according to the marginal benefit expectation to obtain the SHAP value corresponding to each feature in the training data set.
[0019] Preferably, the step of calculating the contribution of the training data set according to the SHAP target value of each feature in the training data set comprises:
[0020] Determine the SHAP target value of each feature in the training data set, and determine the number of data sets in the training data set where each feature is located;
[0021] The contribution of the training data set is calculated according to the SHAP target value corresponding to each feature in the training data set and the number of data sets.
[0022] Preferably, the step of calculating the contribution of the training data set according to the SHAP target value corresponding to each feature in the training data set and the number of data sets comprises:
[0023] Calculate the quotient between the SHAP target value corresponding to each feature in the training data set and the number of data sets;
[0024] The corresponding quotient values of each feature in the training data set are added to obtain the contribution of the training data set.
[0025] Preferably, after the step of calculating the contribution of the training data set according to the SHAP target value of each feature in the training data set, the step further includes:
[0026] Selecting a target training data set for training the machine learning model according to the contribution of each training data set;
[0027] The target training data set is input into the machine learning model to train the machine learning model.
[0028] In addition, to achieve the above-mentioned purpose, the present invention further provides a contribution calculation device for a training data set, the contribution calculation device for a training data set comprising:
[0029] An acquisition module is used to acquire various training data sets for training machine learning models;
[0030] A calculation module is used to calculate the Shapley Additive Model Interpretation Method SHAP target value of each feature in the training data set; and calculate the contribution of the training data set according to the SHAP target value of each feature in the training data set.
[0031] In addition, to achieve the above-mentioned purpose, the present invention also provides a contribution calculation device for a training data set, wherein the contribution calculation device for a training data set includes a memory, a processor, and a contribution calculation program for a training data set stored in the memory and executable on the processor, wherein the contribution calculation program for a training data set, when executed by the processor, implements the steps of a contribution calculation method for a training data set corresponding to a federated learning server.
[0032] In addition, to achieve the above-mentioned purpose, the present invention also provides a computer-readable storage medium, on which a contribution calculation program for a training data set is stored. When the contribution calculation program for a training data set is executed by a processor, the steps of the contribution calculation method for a training data set as described above are implemented.
[0033] The present invention calculates the SHAP target value of each feature in the training data set after acquiring each training data set for training the machine learning model, and calculates the contribution of each training data set according to the SHAP target value of each feature in the training data set. The contribution of each training data set is obtained by calculating the SHAP target value of each feature in the training data set, so as to evaluate the importance of each training data set in the process of training the machine learning model through the contribution of each training data set, so as to more accurately select the training data set for training the machine learning model, thereby improving the accuracy of data prediction of the trained machine learning model. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] Figure 1 It is a flowchart of a first embodiment of a method for calculating the contribution of a training data set of the present invention;
[0035] Figure 2 It is a flow chart of a second embodiment of a method for calculating the contribution of a training data set according to the present invention;
[0036] Figure 3 It is a functional schematic diagram module diagram of a preferred embodiment of the device for calculating the contribution of a training data set of the present invention;
[0037] Figure 4 It is a structural diagram of the hardware operating environment involved in the embodiment of the present invention.
[0038] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0039] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.
[0040] The present invention provides a method for calculating the contribution of a training data set, referring to Figure 1 , Figure 1 Schematic diagram of the flow chart of the first embodiment of the method for calculating the contribution of a training data set of the present invention.
[0041] The embodiment of the present invention provides an embodiment of a method for calculating the contribution of a training data set. It should be noted that although a logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in an order different from that shown here.
[0042] The contribution calculation method of the training data set is applied to a server or terminal, and the terminal may include mobile terminals such as mobile phones, tablet computers, laptop computers, PDAs, and fixed terminals such as digital TVs and desktop computers. In various embodiments of the contribution calculation method of the training data set, for ease of description, the execution body is omitted to illustrate various embodiments. The contribution calculation method of the training data set includes:
[0043] Step S10, obtaining various training data sets for training the machine learning model.
[0044] Obtain each training data set for training the machine learning model. In this embodiment, each training data set can be obtained when a training instruction for training the machine learning model is received. The training instruction can be triggered by the user as needed, or can be triggered by a pre-set scheduled task, wherein the duration corresponding to the scheduled task can be set according to specific needs. Machine learning models include but are not limited to linear regression models, logistic regression models, tree models, and random forest models. Users can choose which specific machine learning model to use according to specific needs. Linear regression is a statistical analysis method that uses regression analysis in mathematical statistics to determine the quantitative relationship between two or more variables that are interdependent. Linear regression can use a straight line to more accurately describe the relationship between data, so that when new data appears, a simple value can be predicted. Random forest refers to a classifier that uses multiple trees to train and predict samples.
[0045] In this embodiment, the training data set is obtained from different terminals, which may be terminals of the same type or terminals of different types, such as bank terminals or shopping terminals. This embodiment does not limit the number of training data sets obtained, such as 5, 10 or 16. One training data set may correspond to one type of terminal, or multiple training data sets may correspond to one type of terminal. In each training data set, the number of sample data included may be the same or different, and each sample data corresponds to at least one feature. For example, a certain sample data includes three features: age, gender and income. The same feature may exist in multiple training data sets or only in one training data set.
[0046] Furthermore, each training data set to be acquired may be pre-stored in a database, and when it is needed, it may be acquired from the database, or it may be acquired from a terminal that generates the training data set when it is needed.
[0047] Step S20, calculating the Shapley Additive Model Interpretation Method SHAP target value of each feature in the training data set.
[0048] After obtaining each training data set for training the machine learning model, the SHAP (SHapley Additive exPlanations) target value of each feature in the training data set is calculated. It should be noted that in the training data set, each feature has a corresponding SHAP target value.
[0049] Further, step S20 includes:
[0050] Step a, calculating the SHAP value corresponding to each feature in the training data set, calculating the absolute value of the SHAP value corresponding to each feature, and obtaining the SHAP absolute value corresponding to each feature.
[0051] After obtaining each training data set, the SHAP value corresponding to each feature in the training data set is calculated. It should be noted that since the SHAP value corresponding to some features is negative, in order to reduce the impact of negative values on the subsequent calculation of the contribution of each training data set, after obtaining the SHAP value corresponding to each feature, the absolute value of the SHAP value corresponding to each feature is calculated to obtain the SHAP absolute value corresponding to each feature, that is, the absolute value of the SHAP value corresponding to each feature is determined as the SHAP absolute value.
[0052] Furthermore, the step of calculating the SHAP value corresponding to each feature in the training data set includes:
[0053] Step a1, calculating the expected marginal revenue corresponding to each feature in the training data set.
[0054] Furthermore, the process of calculating the SHAP value corresponding to each feature in the training data set is as follows: Calculate the marginal benefit expectation corresponding to each feature in the training data set. It should be noted that in the process of calculating the marginal benefit expectation, one training data set is used as a unit. Specifically, the formula for calculating the marginal benefit expectation is as follows:
[0055]
[0056] Among them, φ i is the marginal revenue expectation, F is the set of all features in each training data set, that is, F is the set of all features in a training data set, F\{i} is the excluded data set after removing the i-th feature in F, S is a subset of the excluded data set, and f s∪{i} (x s∪{i} ) is the output value of the machine learning model on the S set, f s (x s ) is the output value of the machine learning model after S set and feature i, f s∪{i} (x s∪{i} ) and fs (x s ) can be subtracted to obtain the marginal benefit of the corresponding feature in the current situation. The eliminated feature is the i-th feature and the probability of the eliminated data set S accounting for all situations. This probability is the fractional coefficient with a factorial symbol in the preset marginal benefit expectation calculation formula, that is, the fractional coefficient represents the probability of the current situation of the feature currently calculating the SHAP value accounting for all situations.
[0057] Step a2, calculating the SHAP value of each feature corresponding to the marginal benefit expectation according to the marginal benefit expectation, so as to obtain the SHAP value corresponding to each feature in the training data set.
[0058] After calculating the expected marginal benefit corresponding to each feature in the training data set, the SHAP value of each feature corresponding to the expected marginal benefit is calculated according to the expected marginal benefit to obtain the SHAP value corresponding to each feature in the training data set. It should be noted that the goal of SHAP is to explain the prediction of instance x by calculating the contribution of each feature to the prediction. The theoretical basis is to calculate the Shapley value (SHAP value) in the alliance game theory. Each feature of the sample instance acts as a participant in the alliance. The Shapley value tells us how to fairly distribute the "benefit" (i.e., the contribution to the final prediction result) among the features. The distribution can be a single feature value of the sample, such as a feature in the sample data; or a group of feature values. For example, in order to explain an image, the SHAP value of a single pixel cannot explain anything, but the SHAP value of the entire set of pixels in the eye can explain the output of the model. In the SHAP algorithm, the Shapley value interpretation is expressed as an additive feature attribute method, a linear model.
[0059] Specifically, the formula for calculating the SHAP value is:
[0060]
[0061] Among them, z'∈{0,1} indicates whether the sample feature participates in the modeling of the machine learning model, M indicates the number of features in the training data set. For example, if there are 15 features in a training data set, then M is 15, Φ0 indicates the bias of the machine learning model, and Φ j Represents the contribution of features to the prediction results of the machine learning model, that is, Φ j is the expected marginal return, and g(z') is the SHAP value.
[0062] Step b: determine each feature in the training data set as a target feature, and obtain the SHAP target value corresponding to the target feature according to the SHAP absolute value of the target feature in different training data sets.
[0063] After obtaining the SHAP absolute value corresponding to each feature in each training data set, each feature in the training data set is determined as the target feature in turn. It should be noted that a certain feature may exist in multiple training data sets. For example, if 10 training data sets are obtained in this embodiment, this feature may exist in 6 of them. After determining the target feature, the SHAP target value corresponding to the target feature is obtained according to the SHAP absolute value of the target feature in different training data sets. It should be noted that if a certain target feature exists in 7 training data sets, then in these 7 training data sets, the target feature will have a corresponding SHAP absolute value.
[0064] Furthermore, the step of obtaining a SHAP target value corresponding to the target feature according to the SHAP absolute value of the target feature in different training data sets includes:
[0065] Step c: determining the SHAP absolute values of the target feature in different training data sets, and calculating the SHAP average values corresponding to the SHAP absolute values of the target feature in different training data sets.
[0066] Step d: determining the SHAP average value as the SHAP target value corresponding to the target feature.
[0067] After the target feature is determined, the SHAP absolute value of the target feature in different training data sets is determined. It should be noted that the SHAP absolute values of the same target feature in different training data sets may be the same or different. In this embodiment, when the target feature exists in a certain training data set, the SHAP absolute value of the target feature in the training data set is not zero; when the target feature does not exist in a certain training data set, the SHAP absolute value of the target feature in the training data set is zero.
[0068] After determining the SHAP absolute value of the target feature in different training data sets, add up the SHAP absolute values of the target feature in different training data sets to obtain the SHAP sum value corresponding to the target feature, then calculate the number of SHAP absolute values whose SHAP absolute value corresponding to the target feature is not zero, divide the SHAP sum value by the number of SHAP absolute values to obtain the SHAP average value corresponding to the SHAP absolute value of the target feature in different training data sets, and determine the SHAP average value as the SHAP target value corresponding to the target feature.
[0069] Furthermore, in the process of calculating the SHAP average value, the maximum and minimum values in the SHAP absolute value can be removed, and the average value of the SHAP absolute value without the maximum and minimum values can be calculated to obtain the SHAP average value corresponding to the SHAP absolute value of the target feature in different training data sets.
[0070] Step S30, calculating the contribution of the training data set according to the SHAP target value of each feature in the training data set.
[0071] After obtaining the SHAP target value corresponding to the target feature, the contribution of the training data set is calculated according to the SHAP target value of each feature in the training data set.
[0072] Further, step S30 includes:
[0073] Step e, determining the SHAP target value of each feature in the training data set, and determining the number of data sets in the training data set where each feature is located.
[0074] Step f, calculating the contribution of the training data set according to the SHAP target value corresponding to each feature in the training data set and the number of data sets.
[0075] Furthermore, the SHAP target value of each feature in the training data set is determined, as well as the number of data sets in the training data set where each feature is located. For example, if feature A exists in 8 training data sets, the number of data sets corresponding to feature A is 8. After obtaining the number of data sets corresponding to each feature, the contribution of each feature to the training data set is calculated based on the SHAP target value and the number of data sets corresponding to each feature in the training data set, and then the sum of the contribution of each feature to the training data set is determined as the contribution of the training data set. For example, when there are 5 features in a training data set, the contribution to the training data set is calculated based on the SHAP target values corresponding to these 5 features and the number of data sets in the training data set, which are A1, A2, A3, A4 and A5 respectively. Then the contribution of the training data set is: A1+A2+A3+A4+A5.
[0076] Further, step f comprises:
[0077] Step f1, calculating the quotient between the SHAP target value corresponding to each feature in the training data set and the number of data sets.
[0078] Step f2, adding the corresponding quotient values of each feature in the training data set to obtain the contribution of the training data set.
[0079] Specifically, the quotient between the SHAP target value corresponding to each feature in the training data set and the number of data sets is calculated, and the corresponding quotient values of each feature in the training data set are added to obtain the contribution of the training data set. Specifically, the formula for calculating the contribution of the training data set is as follows:
[0080]
[0081] Among them, Q Set-jIndicates the contribution of a training data set, that is, the overall contribution of a training data set; Q fi Indicates the SHAP target value corresponding to a feature; M fi Indicates that the feature has appeared in multiple training data sets, that is, the number of data sets corresponding to the feature; I(Q fi ∈Q Set-j ) indicates whether a feature appears in the Set-j training dataset. If the feature appears in the Set-j training dataset, I(Q fi ∈Q Set-j ) takes the value of 1; if the feature does not appear in the Set-j training data set, I(Q fi ∈Q Set-j ) takes a value of 0.
[0082] It should be noted that when a feature appears in only one training dataset, the training dataset has exclusive use of the SHAP target value of the feature; when a feature appears in at least two training datasets, the at least two training datasets need to share the SHAP target value of the feature.
[0083] This embodiment calculates the SHAP target value of each feature in the training data set after obtaining each training data set for training the machine learning model, and calculates the contribution of each training data set according to the SHAP target value of each feature in the training data set. This achieves the contribution of each training data set obtained by calculating the SHAP target value of each feature in the training data set, so as to evaluate the importance of each training data set in the process of training the machine learning model through the contribution of each training data set, so as to more accurately select the training data set for training the machine learning model, thereby improving the accuracy of data prediction by the trained machine learning model.
[0084] Furthermore, a second embodiment of the method for calculating the contribution of a training data set of the present invention is proposed. The difference between the second embodiment of the method for calculating the contribution of a training data set and the first embodiment of the method for calculating the contribution of a training data set is that, with reference to Figure 2 , the contribution calculation method of the training data set also includes:
[0085] Step S40, selecting a target training data set for training the machine learning model according to the contribution of each training data set.
[0086] After the contribution of each training data set is obtained, the target training data set of the machine learning model is selected according to the contribution of each training data set. Specifically, the contribution of each training data set can be compared, and the training data set with the largest contribution can be selected as the target training data set, or the top three training data sets with the largest contribution can be selected as the target training data set, or a portion of data can be selected from the training data set with the largest contribution and the training data set with the second largest contribution to form the target training data set. The user can set the contribution of each training data set according to specific needs.
[0087] Step S50, inputting the target training data set into the machine learning model to train the machine learning model.
[0088] After the target training data set is determined, the target training data set is input into the machine learning model to train the machine learning model. Furthermore, after determining the contribution of each training data set, the contribution of each training data set can also be sent to the corresponding terminal of the business personnel. After the terminal receives the contribution of each training data set, the terminal outputs the contribution of each training data set, so that the business personnel can select the supplier of the training data set according to the contribution of each training data set, and it is convenient for the business personnel to evaluate the benefit value that each training data set can bring when trading data. For example, training data sets with large contribution are given priority, and training data sets with large contribution are priced higher, and training data sets with small contribution are priced lower.
[0089] This embodiment trains the target training data set of the machine learning model according to the contribution of the training data set, and inputs the target training data set into the machine learning model to train the machine learning model, thereby improving the accuracy of the trained machine learning model in predicting data.
[0090] In addition, the present invention also provides a contribution calculation device for a training data set, referring to Figure 3 , the contribution calculation device of the training data set includes:
[0091] An acquisition module 10 is used to acquire various training data sets for training a machine learning model;
[0092] The calculation module 20 is used to calculate the Shapley Additive Model Interpretation Method SHAP target value of each feature in the training data set; and calculate the contribution of the training data set according to the SHAP target value of each feature in the training data set.
[0093] Furthermore, the calculation module 20 includes:
[0094] A first calculation unit is used to calculate the SHAP value corresponding to each feature in the training data set, calculate the absolute value of the SHAP value corresponding to each feature, and obtain the SHAP absolute value corresponding to each feature;
[0095] The first determining unit is used to determine each feature in the training data set as a target feature, and obtain a SHAP target value corresponding to the target feature according to the SHAP absolute value of the target feature in different training data sets.
[0096] Further, the first determining unit includes:
[0097] A determination subunit, used to determine the SHAP absolute value of the target feature in different training data sets;
[0098] A calculation subunit, used to calculate the SHAP average value corresponding to the SHAP absolute value of the target feature in different training data sets;
[0099] The determining subunit is further configured to determine the SHAP average value as a SHAP target value corresponding to the target feature.
[0100] Furthermore, the first calculation unit is also used to calculate the marginal benefit expectation corresponding to each feature in the training data set; calculate the SHAP value of each feature corresponding to the marginal benefit expectation based on the marginal benefit expectation to obtain the SHAP value corresponding to each feature in the training data set.
[0101] Furthermore, the calculation module 20 also includes:
[0102] A second determination unit is used to determine a SHAP target value of each feature in the training data set, and determine the number of data sets in the training data set where each feature is located;
[0103] The second calculation unit is used to calculate the contribution of the training data set according to the SHAP target value corresponding to each feature in the training data set and the number of data sets.
[0104] Furthermore, the second calculation unit is also used to calculate the quotient between the SHAP target value corresponding to each feature in the training data set and the number of data sets; add the quotient values corresponding to each feature in the training data set to obtain the contribution of the training data set.
[0105] Furthermore, the contribution calculation device of the training data set also includes:
[0106] A selection module, used to select a target training data set for training the machine learning model according to the contribution of each training data set;
[0107] An input module is used to input the target training data set into the machine learning model to train the machine learning model.
[0108] The specific implementation of the device for calculating the contribution of a training data set of the present invention is basically the same as the embodiments of the method for calculating the contribution of a training data set described above, and will not be described in detail herein.
[0109] In addition, the present invention also provides a contribution calculation device for a training data set. Figure 4 As shown, Figure 4 It is a structural diagram of the hardware operating environment involved in the embodiment of the present invention.
[0110] It should be noted that Figure 4 That is, it can be a schematic diagram of the structure of the hardware operating environment of the contribution calculation device of the training data set. The contribution calculation device of the training data set in the embodiment of the present invention can be a terminal device such as a PC, a portable computer, etc.
[0111] like Figure 4 As shown, the contribution calculation device of the training data set may include: a processor 1001, such as a CPU, a memory 1005, a user interface 1003, a network interface 1004, and a communication bus 1002. Among them, the communication bus 1002 is used to realize the connection and communication between these components. The user interface 1003 may include a display screen (Display), an input unit such as a keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a WI-FI interface). The memory 1005 may be a high-speed RAM memory, or a stable memory (non-volatile memory), such as a disk memory. The memory 1005 may also be a storage device independent of the aforementioned processor 1001.
[0112] Those skilled in the art will understand that Figure 4 The structure of the device for calculating the contribution of the training data set shown in the figure does not constitute a limitation on the device for calculating the contribution of the training data set, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.
[0113] like Figure 4 As shown, the memory 1005 as a computer storage medium may include an operating system, a network communication module, a user interface module, and a training data set contribution calculation program. The operating system is a program that manages and controls the hardware and software resources of the training data set contribution calculation device, and supports the operation of the training data set contribution calculation program and other software or programs.
[0114] exist Figure 4 In the contribution calculation device of the training data set shown, the user interface 1003 is mainly used to connect to other terminals and communicate data with other terminals, such as obtaining training data sets from other terminals; the network interface 1004 is mainly used for the background server and communicates data with the background server; the processor 1001 can be used to call the contribution calculation program of the training data set stored in the memory 1005, and execute the steps of the contribution calculation method of the training data set as described above.
[0115] The specific implementation of the device for calculating the contribution of a training data set of the present invention is basically the same as the embodiments of the method for calculating the contribution of a training data set described above, and will not be described in detail here.
[0116] In addition, an embodiment of the present invention further proposes a computer-readable storage medium, on which a contribution calculation program for a training data set is stored. When the contribution calculation program for the training data set is executed by a processor, the steps of the contribution calculation method for the training data set as described above are implemented.
[0117] The specific implementation of the computer-readable storage medium of the present invention is basically the same as the various embodiments of the above-mentioned method for calculating the contribution of the training data set, and will not be repeated here.
[0118] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.
[0119] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.
[0120] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for enabling a terminal device (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in each embodiment of the present invention.
[0121] The above are only preferred embodiments of the present invention, and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. A supplier selection method for a training data set, characterized in that: The supplier selection method of the training data set is applied to the server, comprising the following steps: Upon receiving a training instruction for training a machine learning model, obtaining each training data set for training the machine learning model from a database, wherein the training data set is obtained from different terminals and stored in the database, and the training data set includes at least one feature, and the feature includes age, gender, and income; the different terminals include bank terminals and shopping terminals, and one training data set corresponds to one type of terminal; Calculate the Shapley additive model interpretation method SHAP target value of each feature in the training data set; wherein, the step of calculating the SHAP target value of each feature in the training data set includes: calculating the SHAP value corresponding to each feature in the training data set, calculating the absolute value of the SHAP value corresponding to each feature, and obtaining the SHAP absolute value corresponding to each feature; determining each feature in the training data set as a target feature, determining the SHAP absolute value of the target feature in different training data sets, calculating the SHAP average value corresponding to the SHAP absolute value of the target feature in different training data sets, and determining the SHAP average value as the SHAP target value corresponding to the target feature; wherein, when the target feature exists in a certain training data set, it is determined that the SHAP absolute value of the target feature in the training data set is not zero, and when the target feature does not exist in a certain training data set, the SHAP absolute value of the target feature in the training data set is zero; The contribution of the training data set is calculated according to the SHAP target value of each feature in the training data set; wherein, the SHAP target value of each feature in the training data set is determined, and the number of data sets in the training data set where each feature is located is determined; according to the SHAP target value and the number of data sets corresponding to each feature in the training data set, the contribution of each feature to the training data set is calculated, and the sum of the contribution of each feature to the training data set is determined as the contribution of the training data set; wherein, if a certain feature only appears in one training data set, the training data set exclusively shares the SHAP target value of the certain feature; if a certain feature appears in at least two training data sets, at least two training data sets share the SHAP target value of the certain feature; Selecting a target training data set for training the machine learning model according to the contribution of each training data set; wherein a portion of data is selected from the training data set with the largest contribution and the training data set with the second largest contribution to form the target training data set; Inputting the target training data set into the machine learning model to train the machine learning model; The contribution of each training data set is sent to a terminal corresponding to the business personnel, and the terminal outputs the contribution of each training data set, so that the business personnel can select the supplier of the training data set according to the contribution of each training data set; The step of calculating the SHAP value corresponding to each feature in the training data set includes: Calculate the expected marginal benefit corresponding to each feature in the training data set; Calculating the SHAP value of each feature corresponding to the marginal benefit expectation according to the marginal benefit expectation to obtain the SHAP value corresponding to each feature in the training data set; The marginal benefit expectation is calculated according to the following formula: Among them, φ i is the marginal revenue expectation, F is the set of all features in each training data set, that is, F is the set of all features in a training data set, F\{i} is the excluded data set after removing the i-th feature in F, S is a subset of the excluded data set, and f s∪{i} (x s∪{i} ) is the output value of the machine learning model on the S set, f s (x s ) is the output value of the machine learning model after S set and feature i, f s∪{i} (x s∪{i} ) and f s (x s ) can be subtracted to obtain the marginal benefit of the corresponding feature in the current situation. The eliminated feature is the i-th feature and the probability of the eliminated data set S accounting for all situations. The probability is the fractional coefficient with a factorial symbol in the preset marginal benefit expectation calculation formula, that is, the fractional coefficient represents the probability of the current situation where the feature of the current SHAP value is calculated accounts for all situations.
2. The method for selecting a supplier of a training data set according to claim 1, characterized in that: The method comprises: Calculate the quotient between the SHAP target value corresponding to each feature in the training data set and the number of data sets; The corresponding quotient values of each feature in the training data set are added to obtain the contribution of the training data set.
3. A supplier selection device for a training data set, characterized in that: The supplier selection device of the training data set is arranged on a server, and includes: an acquisition module, configured to acquire, from a database, each training data set for training the machine learning model upon receiving a training instruction for training the machine learning model, wherein the training data set is acquired from different terminals and stored in the database, the training data set includes at least one feature, and the feature includes age, gender, and income; the different terminals include bank terminals and shopping terminals, and one training data set corresponds to one type of terminal; A calculation module is used to calculate the Shapley additive model interpretation method SHAP target value of each feature in the training data set; wherein, the calculation of the SHAP target value of each feature in the training data set includes: calculating the SHAP value corresponding to each feature in the training data set, calculating the absolute value of the SHAP value corresponding to each feature, and obtaining the SHAP absolute value corresponding to each feature; determining each feature in the training data set as a target feature, determining the SHAP absolute value of the target feature in different training data sets, calculating the SHAP average value corresponding to the SHAP absolute value of the target feature in different training data sets, and determining the SHAP average value as the SHAP target value corresponding to the target feature; wherein, when the target feature exists in a certain training data set, it is determined that the SHAP absolute value of the target feature in the training data set is not zero, and when the target feature does not exist in a certain training data set, the SHAP absolute value of the target feature in the training data set is zero; calculating the contribution of the training data set according to the SHAP target value of each feature in the training data set; wherein, determining the SHAP absolute value of each feature in the training data set HAP target value, and determine the number of data sets in the training data set where each feature is located; according to the SHAP target value and the number of data sets corresponding to each feature in the training data set, calculate the contribution of each feature to the training data set, and determine the sum of the contribution of each feature to the training data set as the contribution of the training data set; wherein, if a feature only appears in one training data set, the training data set exclusively shares the SHAP target value of the feature; if a feature appears in at least two training data sets, at least two training data sets share the SHAP target value of the feature; select the target training data set for training the machine learning model according to the contribution of each training data set; wherein, a part of data is selected from the training data set with the largest contribution and the training data set with the second largest contribution to form the target training data set; the target training data set is input into the machine learning model to train the machine learning model; wherein, the contribution of each training data set is sent to the corresponding terminal of the business personnel, and the terminal outputs the contribution of each training data set, so that the business personnel can select the supplier of the training data set according to the contribution of each training data set; The step of calculating the SHAP value corresponding to each feature in the training data set includes: calculating the marginal benefit expectation corresponding to each feature in the training data set; calculating the SHAP value of each feature corresponding to the marginal benefit expectation according to the marginal benefit expectation, so as to obtain the SHAP value corresponding to each feature in the training data set; The marginal benefit expectation is calculated according to the following formula: Among them, φ i is the marginal revenue expectation, F is the set of all features in each training data set, that is, F is the set of all features in a training data set, F\{i} is the excluded data set after removing the i-th feature in F, S is a subset of the excluded data set, and f s∪{i} (x s∪{i} ) is the output value of the machine learning model on the S set, f s (x s ) is the output value of the machine learning model after S set and feature i, f s∪{i} (x s∪{i} ) and f s (x s ) can be subtracted to obtain the marginal benefit of the corresponding feature in the current situation. The eliminated feature is the i-th feature and the probability of the eliminated data set S accounting for all situations. The probability is the fractional coefficient with a factorial symbol in the preset marginal benefit expectation calculation formula, that is, the fractional coefficient represents the probability of the current situation where the feature of the current SHAP value is calculated accounts for all situations.
4. A device for selecting a supplier of a training data set, characterized in that: The supplier selection device for the training data set includes a memory, a processor, and a supplier selection program for the training data set stored in the memory and executable on the processor. When the supplier selection program for the training data set is executed by the processor, the steps of the supplier selection method for the training data set as described in any one of claims 1 to 2 are implemented.
5. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a supplier selection program for a training data set, and when the supplier selection program for a training data set is executed by a processor, the steps of the supplier selection method for a training data set as described in any one of claims 1 to 2 are implemented.
Citation Information
Patent Citations
Federated deep learning method capable of adaptively protecting privacy
CN110443063A
Method and device for determining contribution degree of participant
CN110717671A