Feature importance detection method and device, equipment and storage medium
By determining the contribution value of the operation content identification data to the target model, the problem of inability to evaluate the importance of features in the prior art is solved, and an accurate assessment of the contribution degree to the model prediction results is achieved.
Patent Information
- Application Number
- CN202311695368.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-11
- Publication Date
- 2025-06-13
AI Technical Summary
Existing model interpretation methods cannot determine the importance of each feature data in the data sequence to the model prediction results.
By obtaining the sample set, the first contribution value of each operation content identification data to the prediction results of the target model is determined, and the second contribution value is determined based on these contribution values, and the characteristic importance detection result of the target model is finally determined.
It realizes the simple, fast and accurate determination of the contribution of each feature data in the data sequence to the model prediction results, and improves the effectiveness of data monitoring.
Smart Images

Figure CN120144990A_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present invention relate to the technical field of data processing, and in particular, to a method, apparatus, device, and storage medium for detecting feature importance. Background Art
[0002] When using a warning model to monitor the operation content of a user, such as search content, in order to improve the accuracy of data monitoring, it is usually necessary to combine other means to focus on or analyze important feature data and ignore unimportant feature data to improve the effectiveness of data monitoring.
[0003] However, in the process of implementing the present invention, it is found that at least the following problems exist in the prior art:
[0004] The existing model interpretation method cannot determine the importance degree of each feature data in the data sequence to the model prediction result. Summary of the Invention
[0005] Embodiments of the present invention provide a method for detecting feature importance to solve the problem that the existing model interpretation method cannot determine the importance degree of each feature data in the data sequence to the model prediction result.
[0006] In a first aspect, embodiments of the present invention provide a method for detecting feature importance, the method comprising:
[0007] Obtain a sample set, the sample set including at least one sample, and the sample including at least two operation content identification data arranged in chronological order;
[0008] For each sample in the sample set, determine a first contribution value of each operation content identification data in the current sample to the prediction result of the target model;
[0009] According to the first contribution values corresponding to the operation content identification data, determine second contribution values corresponding to each operation content;
[0010] According to the second contribution values corresponding to each operation content, determine the feature importance detection result of the target model.
[0011] In a second aspect, embodiments of the present invention further provide a feature importance detection apparatus, the apparatus comprising:
[0012] An obtaining module, configured to obtain a sample set, the sample set including at least one sample, and the sample including at least two operation content identification data arranged in chronological order;
[0013] A first contribution value module, configured to determine, for each sample in the sample set, a first contribution value of each operation content identification data in the current sample to the prediction result of the target model;
[0014] The second contribution value module determines the second contribution value corresponding to each operation content according to the first contribution value corresponding to the operation content identification data.
[0015] The result module is used to determine the feature importance detection result of the target model according to the second contribution value corresponding to each operation content.
[0016] In a third aspect, an embodiment of the present invention provides an electronic device, which includes:
[0017] One or more processors;
[0018] A memory for storing one or more programs;
[0019] When the one or more programs are executed by the one or more processors, the one or more processors implement the feature importance detection method provided in any embodiment of the present invention.
[0020] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, and when the program is executed by a processor, the feature importance detection method provided in any embodiment of the present invention is implemented.
[0021] The embodiments in the above invention have the following advantages or beneficial effects:
[0022] By determining the first contribution value of the operation content identification data in the current sample to the prediction result of the target model, the contribution degree of the operation content identification data to the prediction result of the target model is determined; according to the first contribution value corresponding to the operation content identification data, the second contribution value corresponding to each operation content is determined; since the second contribution value corresponding to each operation content can reflect the contribution degree of each operation content to the prediction result of the target model, the feature importance detection result of the target model can be determined according to the second contribution value corresponding to each operation content, which is simple, fast, and accurate. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] Figure 1 is a flowchart of the feature importance detection method provided by an embodiment of the present invention;
[0024] Figure 2 is another flowchart of the feature importance detection method provided by an embodiment of the present invention;
[0025] Figure 3 is a schematic diagram of a relationship diagram provided by an embodiment of the present invention;
[0026] Figure 4 is a schematic structural diagram of the feature importance detection device provided by an embodiment of the present invention;
[0027] Figure 5 It is another schematic structural diagram of the feature importance detection device provided by the embodiment of the present invention;
[0028] Figure 6 It is a schematic structural diagram of the electronic device provided by the embodiment of the present invention. Specific Embodiments
[0029] The present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It can be understood that the specific embodiments described herein are only used to explain the present invention, rather than limiting the present invention. In addition, it should be noted that for the convenience of description, only parts related to the present invention rather than all structures are shown in the drawings.
[0030] Figure 1 It is a flowchart of the feature importance detection method provided by the embodiment of the present invention. This embodiment is applicable to the situation of determining the contribution degree of each operation content to the prediction result of the target model in at least one operation content identification data sequence. This method can be executed by a feature importance detection device integrated in an electronic device, and this device can be implemented in a software and / or hardware manner. As Figure 1 shown, this method specifically includes the following steps:
[0031] S110. Obtain a sample set, where the sample set includes at least one sample, and the sample includes at least two operation content identification data arranged in chronological order.
[0032] Among them, the operation content identification data is used to represent the corresponding operation content. Exemplarily, 001 and 002 are both operation content identification data, corresponding to the first operation content and the second operation content respectively. In one embodiment, the operation content can be the operation content executed by the user in the operation and maintenance processing flow, or the test content executed by the user in the visual test process, or the attack content in the malicious attack process of hackers or Trojan programs.
[0033] Among them, the sample is an operation content identification data sequence, including at least two operation content identification data arranged in chronological order. The arrangement order of each operation content identification data in the operation content identification data sequence is the same as the operation content query order executed by the target object (user). The number of operation content identification data included in each sample can be determined by the user himself.
[0034] In one embodiment, each sample in the sample set includes at least one sample in the training set and / or at least one sample in the test set. Among them, the training set is used to train the model into a target model, and the test set is used to test the prediction accuracy of the target model.
[0035] In one embodiment, the sample set does not include any sample in the training set, nor does it include any sample in the training set.
[0036] S120. For each sample in the sample set, determine the first contribution value of each operation content identification data in the current sample to the prediction result of the target model.
[0037] The first contribution value is a quantization result of the contribution degree of the corresponding operation content identification data to the prediction result of the target model.
[0038] Among them, the target model is any trained network model.
[0039] In one embodiment, the first contribution value of each operation content identification data in the current sample to the prediction result of the target model is determined based on the integrated gradient algorithm. It can be understood that if the current sample includes at least two identical operation content identification data, and the at least two identical operation content identification data are distributed at different positions in the operation content identification data sequence, then the first contribution values corresponding to the at least two identical operation content identification data may be the same or different.
[0040] The first contribution value of each operation content identification data in the current sample to the prediction result of the target model is determined through the following steps, including:
[0041] Step a1. Obtain the reference operation content identification data corresponding to the preset reference operation content.
[0042] The reference operation content can be understood as a neutral operation content, that is, an operation content that does not have any impact on the prediction result of the target model, such as the search home page. Specifically, when a user conducts a data search, they need to enter keywords on the search home page, and the search engine conducts a data search based on the keywords and displays the search results. Therefore, the search home page is only used to provide a data search entry and does not reflect the user's search tendency. Therefore, the search home page can be used as the reference operation content, and the identification data corresponding to the preset search home page is used as the reference operation content identification data.
[0043] Step a2. For each operation content identification data in the current sample, determine the path and difference between the current operation content identification data and the reference operation content identification data.
[0044] Let the function F: R n →[0,1] represent the deep network, x ∈ R n represent the model input data, x' ∈ R n represent the reference operation content identification data; then the attribution of the i-th component of x can be regarded as the integral of the gradient path on the straight line from the baseline x' to x. Among them, the path can be expressed as γ(α) = x' + α × (x - x'), α ∈ [0,1].
[0045] Step a3: Divide the path into at least two sub-paths and determine the gradients corresponding to each of the sub-paths.
[0046] Among them, the gradients corresponding to each sub-path can be expressed as where k is the sub-path identifier, and x i represents the i-th operation content identifier data in the sample. m is the total number of sub-paths (the order of Taylor expansion). The larger m is, the better the result approximation, but the computational complexity will also increase accordingly. The above α can be expressed as
[0047] Step a4: Determine the first contribution value of the current operation content identifier data to the prediction result of the target model according to the gradients corresponding to each of the sub-paths and the difference.
[0048] In one embodiment, determine the mean value of the gradients of all sub-paths, and use the product of the mean value and the difference as the first contribution value of the current operation content identifier data to the prediction result of the target model.
[0049] Among them, the first contribution value is the integrated gradient value, specifically as follows:
[0050]
[0051] S130: Determine the second contribution value corresponding to each operation content according to the first contribution value corresponding to each of the operation content identifier data.
[0052] Since the operation content identifier data corresponds one-to-one with the operation content, the same operation content identifier data distributed at different positions in the same sample corresponds to the same operation content; the same operation content identifier data distributed in different samples corresponds to the same operation content. Therefore, the second contribution value corresponding to each operation content can be determined according to the first contribution value corresponding to each of the operation content identifier data.
[0053] In one embodiment, use the mean value of the first contribution values corresponding to all the operation content identifier data corresponding to the same operation content in the sample set as the second contribution value corresponding to this operation content. The second contribution value corresponding to this operation content can be quickly and accurately determined through the mean value.
[0054] In one embodiment, the current operation content identification data is determined; for each sample in the sample set, the distribution position and weight of the current operation content identification data in the current sample are determined, and in the current sample, the weight corresponding to the subsequent current operation content identification data is greater than the weight corresponding to the previous current operation content identification data. At the same time, the sum of the weights corresponding to all the current operation content identification data in the current sample is n, and n is the number of the current operation content identification data included in the current sample. The product of the first contribution value corresponding to each operation content identification data in each sample and the weight is determined, and this product is used as the updated first contribution value corresponding to the operation content identification data. The mean value of the updated first contribution values corresponding to all the operation content identification data corresponding to the same operation content in the sample set is used as the second contribution value corresponding to this operation content.
[0055] It can be understood that if the sample set only includes one sample, the mean value of the first contribution values corresponding to all the operation content identification data corresponding to the same operation content in this sample is directly used as the second contribution value corresponding to this operation content.
[0056] S140. Determine the feature importance detection result of the target model according to the second contribution value corresponding to each operation content.
[0057] In one embodiment, the second contribution values corresponding to all operation contents are positive. Each operation content is sorted in descending order or ascending order according to the second contribution value corresponding to it to obtain a sorting result, and this sorting result is used as the feature importance detection result. If the sorting result is a descending order sorting result, then in this sorting result, the contribution degree of the previous operation content to the prediction result of the target model is greater than the contribution degree of the subsequent operation content to the prediction result of the target model. If the sorting result is an ascending order sorting result, then in this sorting result, the contribution degree of the subsequent operation content to the prediction result of the target model is greater than the contribution degree of the previous operation content to the prediction result of the target model.
[0058] In one embodiment, the first contribution value corresponding to the operation content identification data that has a positive contribution to the prediction result of the target model is a positive number, and the first contribution value corresponding to the operation content identification data that has a negative contribution to the prediction result of the target model is a negative number. Each operation content is sorted in descending order or ascending order based on the absolute value of the second contribution value to obtain a sorting result, and this sorting result is used as the feature importance detection result. Taking the sorting result as a descending order sorting result as an example, the contribution degree of the previous operation content to the prediction result of the target model is greater than the contribution degree of the subsequent operation content to the prediction result of the target model.
[0059] It can be understood that the feature importance detection result includes the operation content and the importance ranking corresponding to each operation content.
[0060] After the feature importance detection result is determined, the feature importance detection result is displayed on the visualization interface. In one embodiment, different importance rankings are marked by different identifiers, such as marking the operation content with different importance rankings by different colors.
[0061] The technical solution of the feature importance detection method provided by the embodiment of the present invention determines the first contribution value of each operation content identification data in the current sample to the prediction result of the target model, and determines the contribution degree of each operation content identification data to the prediction result of the target model; according to the first contribution value corresponding to each operation content identification data, determine the second contribution value corresponding to each operation content; since the second contribution value corresponding to each operation content can reflect the contribution degree of each operation content to the prediction result of the target model, the contribution degree of each operation content to the prediction result of the target model can be determined, that is, the feature importance detection result of the target model, which is simple, fast and accurate.
[0062] Figure 2 It is another flowchart of the feature importance detection method provided by the embodiment of the present invention. On the basis of the foregoing embodiment, this embodiment adds a feature importance verification step, as Figure 2 shown, the method includes:
[0063] S210. Obtain a sample set, where the sample set includes at least one sample, and the sample includes at least two operation content identification data arranged in chronological order.
[0064] S220. For each sample in the sample set, determine the first contribution value of each operation content identification data in the current sample to the prediction result of the target model.
[0065] S230. According to the first contribution value corresponding to each operation content identification data, determine the second contribution value corresponding to each operation content.
[0066] S240. According to the second contribution value corresponding to each operation content, determine the feature importance detection result of the target model.
[0067] S250. Select a sample from the sample set, and select at least two operation contents from the feature importance detection result.
[0068] In one embodiment, the feature importance detection result corresponds to the descending order sorting result of the second contribution value of the operation content. Therefore, in the descending order sorting result, compared with the subsequent feature data, the contribution degree of the previous feature data to the prediction result of the target model is greater. Therefore, the first N operation contents are selected from the feature importance detection result, where N is an integer greater than or equal to 2.
[0069] In one embodiment, at least two operation contents selected from the feature importance detection results include one or more operation contents of interest. The operation contents of interest may be operation contents with relatively high user attention, and their contribution degrees to the prediction results of the target model may be relatively high or relatively low. This embodiment helps to verify the difference in the contribution degrees of different operation contents of interest to the prediction results of the target model, or the difference in the contribution degrees of the operation contents of interest and the specified operation contents to the prediction results of the target model through subsequent steps.
[0070] S260. Determine the relationship between at least two data replacement amounts and the corresponding probabilities corresponding to each operation content among the at least two operation contents. The data replacement amount is the number of operation content identification data replaced by the operation content identification data identified by the corresponding operation content in the selected samples, and the probability is the percentage of the target samples predicted by the target model as the target result. The target sample is the selected sample after the operation content identification data corresponding to the corresponding data replacement amount is replaced by the operation content identification data corresponding to the corresponding operation content.
[0071] In one embodiment, the corresponding relationship between at least two data replacement amounts and probabilities corresponding to each operation content among the at least two operation contents is determined through the following steps, including:
[0072] Step b1. For each operation content among the at least two operation contents, gradually replace each operation content identification data in the selected sample with the operation content identification data corresponding to the current operation content.
[0073] In one embodiment, the operation content identification data corresponding to the current operation content is randomly and gradually used to replace the operation content identification data in the sample. The random and gradual replacement method can avoid the influence of the search data identification data replacement order on the verification result and improve the accuracy of the verification result.
[0074] In one embodiment, the operation content identification data corresponding to the current operation content is randomly and gradually used to replace the target operation content identification data in the selected sample, where the target operation content identification data is the operation content identification data not corresponding to the current operation content. This embodiment can prevent meaningless data replacement operations, that is, using the operation content identification data corresponding to the current operation content to replace the operation content identification data corresponding to the current operation content in the selected sample.
[0075] In one embodiment, a target number of target operation content identification data is randomly selected from the selected samples, and the target operation content identification data is different from the operation content identification data corresponding to the at least two operation contents. Randomly replacing the target operation content identification data in the selected samples one by one with the operation content identification data corresponding to the current operation content can avoid using the operation content identification data corresponding to the current operation content to replace other operation contents among the at least two operation contents in the selected samples during the data replacement process. For example, the at least two operation contents include a first operation content and a second operation content. Since the target number of target operation content identification data does not include the operation content identification data corresponding to the first operation content and the operation content identification data corresponding to the second operation content, during the process of replacing the target number of target operation content identification data one by one with the operation content identification data corresponding to the first operation content, the situation of using the operation content identification data corresponding to the first operation content to replace the operation content identification data corresponding to the second operation content will not occur, that is, the situation of increasing the number of operation content identification data corresponding to the first operation content by reducing the number of operation content identification data corresponding to the second operation content will not occur, which can ensure that the data replacement process is a single-variable change process to improve the accuracy of the data replacement operation, thereby improving the accuracy of the verification result.
[0076] Step b2: When any operation content identification data in the selected samples is replaced with the current operation content identification data, the data replacement amount is incremented by one, and the probability that the selected samples after data replacement are predicted by the target model as the target result is determined.
[0077] After each data replacement operation is completed, the selected samples are updated, and the data replacement amount is incremented by one; the probability that the updated selected samples are predicted by the target model as the target result is determined, such as the probability of being predicted as a positive result.
[0078] In one embodiment, the target model is a risk control model, and the target result is the existence of risk. The updated selected samples are input into the target model to obtain a risk control score. Since the risk control score can be understood as the probability of the existence of risk, that is, the higher the risk control score, the greater the risk probability; the lower the risk control score, the smaller the risk probability, the risk control score can be used as the probability of the target result.
[0079] In one embodiment, the above steps b1 and b2 can be implemented through the following steps. Specifically, for each of the at least two operation contents, one operation content identification data corresponding to the current operation content is used to replace one operation content identification data in the selected sample to update the selected sample, and the data replacement amount is incremented by one; the updated selected sample is input into the risk control model to obtain a risk control score, and this risk control score is used as the risk control score corresponding to the current data replacement amount; return to the step of using the current operation content to replace one operation content identification data in the target sample to update the selected sample until the data replacement amount reaches the set quantity threshold; the data replacement amount is the number of operation content identification data in the selected sample that are replaced with the operation content identification data corresponding to the current operation content, and the set quantity threshold is less than or equal to the total number of operation content identification data included in the selected sample.
[0080] In one embodiment, for each of the at least two operation contents, a relationship graph is determined (see Figure 3 ), and the relationship graph includes relationship curves, which are used to represent the relationship between at least two data replacement amounts and corresponding probabilities of the operation content corresponding to the target sample. Displaying the relationship between at least two data replacement amounts and corresponding probabilities of the corresponding operation content through the relationship graph is simple and intuitive.
[0081] In one embodiment, the identifications of the at least two operation contents are displayed on the visualization interface; the user selects the identification of the operation content of interest on the visualization interface; in response to the user's selection operation, the relationship curve corresponding to the operation content of interest is displayed. By only displaying the relationship curve corresponding to the identification of the operation content selected by the user, the user experience is improved.
[0082] S270. Determine the feature importance relationship between the at least two operation contents according to the relationship.
[0083] It can be understood that if the contribution of the current operation content to the prediction result of the target model is positive, then as more and more operation content identification data in the selected sample is replaced with the operation content identification data corresponding to the current operation content, the possibility that the selected sample is predicted as a positive result by the target model becomes greater and greater; if the contribution of the current operation content to the prediction result of the target model is negative, then as more and more operation content identification data in the selected sample is replaced with the operation content identification data corresponding to the current operation content, the possibility that the selected sample is predicted as a negative result by the target model becomes greater and greater. Further, for the selected sample, if the data replacement amount of the operation content identification data corresponding to the first operation content is M1 when the corresponding probability reaches the target probability; and the data replacement amount of the operation content identification data corresponding to the second operation content is N1 when the corresponding probability reaches the target probability, and M1 is less than N1, it indicates that the contribution degree of the first operation content to the target result of the target model is greater than the contribution degree of the second operation content to the target result of the target model. Therefore, it is determined that the importance degree of the first operation content is greater than the importance degree of the second operation content.
[0084] In one embodiment, the identifications of the at least two operation contents are displayed on the visualization interface; the user selects the identifications of at least two operation contents of interest on the visual interaction interface; in response to the user's selection operation, the relationship curves corresponding to the at least two operation contents of interest and the feature importance relationship between the at least two operation contents of interest are displayed. Among them, the feature importance relationship can be understood as the relationship of the feature importance magnitudes, and the magnitude relationship can be displayed by different relationship curve identifications. For example, the relationship curve A is identified as red, the relationship curve B is identified as yellow, and the relationship curve C is identified as orange; the feature importance rankings corresponding to each color are displayed beside the relationship diagram. For example, red corresponds to the largest feature importance, orange corresponds to the smallest feature importance, and the magnitude of the feature importance corresponding to yellow is between the feature importance corresponding to red and the feature importance corresponding to orange. This embodiment displays the feature importance magnitude relationship between different operation contents by combining the relationship curves and identifications.
[0085] S280. Determine whether the feature importance detection result is accurate according to the feature importance relationship between the at least two operation contents.
[0086] In one embodiment, if the feature importance relationship between the at least two operation contents is the same as the feature importance relationship between the at least two operation contents in the feature importance detection result, it indicates that the feature importance detection result is accurate; otherwise, it indicates that the feature importance detection result is inaccurate, or the accuracy of the feature importance detection result is uncertain.
[0087] In one embodiment, if the feature importance relationship between the at least two operation contents is different from the feature importance relationship between the at least two operation contents in the feature importance detection result, then the feature importance relationship between the at least two operation contents is used as the final feature importance detection result. In this embodiment, the feature importance detection result can be understood as the preliminary sorting result of the feature importance.
[0088] In the embodiment of the present invention, by determining the relationship between at least two data replacement amounts and the corresponding probabilities of each operation content, the feature importance relationship between different operation contents is determined to verify the accuracy of the feature importance magnitude relationship between each operation content in the feature importance detection result.
[0089] The following is an embodiment of the feature importance detection device provided by the embodiment of the present invention. This device and the feature importance detection method of the above embodiment belong to the same inventive concept. For the details not described in detail in the embodiment of the feature importance detection device, reference can be made to the content of the above embodiments.
[0090] Figure 4 It is a schematic structural diagram of the device provided by the embodiment of the present invention. As Figure 4 shown, the device includes: an acquisition module 410, configured to acquire a sample set, where the sample set includes at least one sample, and the sample includes at least two operation content identification data arranged in chronological order; a first contribution value module 420, configured to, for each sample in the sample set, determine the first contribution value of each operation content identification data in the current sample to the prediction result of the target model; a second contribution value module 430, configured to determine the second contribution value corresponding to each operation content according to the first contribution value corresponding to each operation content identification data; and a result module 440, configured to determine the feature importance detection result of the target model according to the second contribution value corresponding to each operation content.
[0091] In one embodiment, the first contribution value module 420 includes:
[0092] an acquisition unit, configured to acquire the reference operation content identification data corresponding to the preset reference operation content;
[0093] a path determination unit, configured to, for each operation content identification data in the current sample, determine the path and the difference between the current operation content identification data and the reference operation content identification data;
[0094] a gradient determination unit, configured to divide the path into at least two sub-paths and determine the gradient corresponding to each sub-path;
[0095] The first contribution value unit is configured to determine the first contribution value of the current operation content identification data to the prediction result of the target model according to the gradients corresponding to the respective sub-paths and the difference value.
[0096] In one embodiment, the first contribution value unit is configured to:
[0097] Determine the mean value of the gradients of all the sub-paths;
[0098] Use the product of the mean value and the difference value as the first contribution value of the current operation content identification data to the prediction result of the target model.
[0099] In one embodiment, the second contribution value module 430 is configured to:
[0100] Use the mean value of the first contribution values corresponding to all the operation content identification data in the sample set that correspond to the same operation content as the second contribution value corresponding to this operation content.
[0101] In one embodiment, the result module 440 includes:
[0102] A sorting unit configured to sort the respective operation contents based on the second contribution value to obtain a sorting result;
[0103] A result unit configured to determine the feature importance detection result of the target model according to the sorting result.
[0104] In one embodiment, the first contribution value corresponding to the operation content identification data that has a positive contribution to the prediction result of the target model is a positive number, and the first contribution value corresponding to the operation content identification data that has a negative contribution to the prediction result of the target model is a negative number. The result unit is configured to:
[0105] Sort the respective operation contents based on the absolute value of the second contribution value to obtain a sorting result.
[0106] In one embodiment, as Figure 5 shown, the apparatus further includes a verification module 450, and the verification module 450 includes:
[0107] A selection unit configured to select a sample from the sample set and select at least two operation contents from the feature importance detection result;
[0108] A corresponding relationship determination unit, configured to determine the relationship between at least two data replacement amounts and corresponding probabilities corresponding to each of the at least two operation contents, where the data replacement amount is the number of operation content identification data replaced by the operation content identification data corresponding to the corresponding operation content in the selected sample, and the probability is the percentage that the target sample is predicted by the target model to be the target result. The target sample is the selected sample after the operation content identification data corresponding to the corresponding data replacement amount is replaced by the operation content identification data corresponding to the corresponding operation content;
[0109] An importance relationship unit, configured to determine the feature importance relationship between the at least two operation contents according to the corresponding relationship;
[0110] A result unit, configured to determine whether the feature importance detection result is accurate according to the feature importance relationship between the at least two operation contents.
[0111] In one embodiment, the corresponding relationship determination unit includes:
[0112] A replacement subunit, configured to, for each of the at least two operation contents, gradually replace each operation content identification data in the selected sample with the operation content identification data corresponding to the current operation content;
[0113] A probability subunit, configured to, when any operation content identification data in the selected sample is replaced with the current operation content identification data, increment the data replacement amount by one and determine the probability that the selected sample after data replacement is predicted by the target model to be the target result;
[0114] A corresponding relationship subunit, configured to establish the corresponding relationship between the current data replacement amount and the probability.
[0115] In one embodiment, the corresponding relationship subunit is configured to input the target sample after data replacement into the target model to obtain a risk control score, and the risk control score corresponds to the risk probability.
[0116] In one embodiment, the verification module further includes a display unit, and the display unit is configured to:
[0117] Determine a relationship graph, where the relationship graph includes at least one relationship curve, and the relationship curve is used to represent the relationship between at least two data replacement amounts and corresponding probabilities of the corresponding operation content;
[0118] Display the relationship graph in the visual interaction interface.
[0119] The technical solution of the feature importance detection method provided by the embodiments of the present invention determines the first contribution value of each operation content identification data in the current sample to the prediction result of the target model, and determines the contribution degree of each operation content identification data to the prediction result of the target model; according to the first contribution value corresponding to each operation content identification data, determine the second contribution value corresponding to each operation content; since the second contribution value corresponding to each operation content can reflect the contribution degree of each operation content to the prediction result of the target model, therefore, according to the second contribution value corresponding to each operation content, the feature importance detection result of the target model can be determined, which is simple, fast and accurate.
[0120] The feature importance detection device provided by the embodiments of the present invention can execute the feature importance detection method provided by the embodiments of the present invention, and has corresponding functional modules and beneficial effects for executing the feature importance detection method.
[0121] Figure 6 It is a schematic structural diagram of an electronic device provided by an embodiment of the present invention. Figure 6 The block diagram of an exemplary server 12 suitable for use in implementing the embodiments of the present invention is shown. Figure 6 The shown server 12 is merely an example and should not impose any limitation on the functions and usage scope of the embodiments of the present invention.
[0122] As Figure 6 shown, the server 12 is presented in the form of a general-purpose computing device. The components of the server 12 may include, but are not limited to: one or more processors or processing units 16, a system memory 28, and a bus 18 connecting different system components (including the system memory 28 and the processing unit 16).
[0123] The bus 18 represents one or more of several types of bus structures, including a memory bus or a memory controller, a peripheral bus, a graphics acceleration port, a processor, or a local bus using any of the multiple bus structures. For example, these architectures include, but are not limited to, Industry Standard Architecture (ISA) bus, Micro Channel Architecture (MAC) bus, Enhanced ISA bus, Video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect (PCI) bus.
[0124] The server 12 typically includes a variety of computer system readable media. These media can be any available media accessible by the server 12, including volatile and non-volatile media, removable and non-removable media.
[0125] System memory 28 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 30 and / or cache memory 32. Server 12 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, storage system 34 may be used for reading and writing on non-removable, non-volatile magnetic media ( Figure 6 not shown, commonly referred to as a "hard disk drive"). Although Figure 6 not shown in, a disk drive for reading and writing on removable non-volatile disks (such as a "floppy disk") and an optical disk drive for reading and writing on removable non-volatile optical disks (such as a CD-ROM, DVD-ROM or other optical media) may be provided. In these cases, each drive may be connected to bus 18 through one or more data media interfaces. System memory 28 may include at least one program product having a set (such as at least one) of program modules configured to perform the functions of the embodiments of the present invention.
[0126] A program / utility 40 having a set (at least one) of program modules 42 may be stored, for example, in system memory 28. Such program modules 42 include, but are not limited to, an operating system, one or more application programs, other program modules, and program data. Each or some combination of these examples may include an implementation of a network environment. Program modules 42 generally execute the functions and / or methods in the embodiments described in the present invention.
[0127] Server 12 may also communicate with one or more external devices 14 (such as a keyboard, a pointing device, a display 24, etc.), and may also communicate with one or more devices that enable a user to interact with the server 12, and / or communicate with any device that enables the server 12 to communicate with one or more other computing devices (such as a network card, a modem, etc.). Such communication may be carried out through an input / output (I / O) interface 22. Moreover, server 12 may also communicate with one or more networks (such as a local area network (LAN), a wide area network (WAN) and / or a public network, such as the Internet) through a network adapter 20. As shown in the figure, network adapter 20 communicates with other modules of server 12 through bus 18. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with server 12, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, etc.
[0128] The processing unit 16 executes various functional applications and data processing by running the programs stored in the system memory 28, such as implementing the steps of the feature importance detection method provided by the embodiments of the present invention. The method includes:
[0129] Obtain a sample set, where the sample set includes at least one sample, and the sample includes at least two operation content identification data arranged in chronological order;
[0130] For each sample in the sample set, determine a first contribution value of each operation content identification data in the current sample to the prediction result of the target model;
[0131] According to the first contribution values corresponding to the respective operation content identification data, determine second contribution values corresponding to the respective operation contents in the sample set;
[0132] According to the second contribution values corresponding to the respective operation contents, determine a feature importance detection result of the target model.
[0133] Of course, those skilled in the art can understand that the processor can also implement the technical solutions of the feature importance detection method provided in any embodiment of the present invention.
[0134] This embodiment provides a computer-readable storage medium, on which a computer program is stored, and when the program is executed by a processor, it implements the steps of a feature importance detection method provided in the foregoing embodiments of the present invention. The method includes:
[0135] Obtain a sample set, where the sample set includes at least one sample, and the sample includes at least two operation content identification data arranged in chronological order;
[0136] For each sample in the sample set, determine a first contribution value of each operation content identification data in the current sample to the prediction result of the target model;
[0137] According to the first contribution values corresponding to the respective operation content identification data, determine second contribution values corresponding to the respective operation contents in the sample set;
[0138] According to the second contribution values corresponding to the respective operation contents, determine a feature importance detection result of the target model.
[0139] The computer storage medium of the embodiments of the present invention may adopt any combination of one or more computer-readable media. The computer-readable media may be computer-readable signal media or computer-readable storage media. The computer-readable storage media may, for example, but not be limited to, be electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or components, or any combination of the above. More specific examples (a non-exhaustive list) of the computer-readable storage media include: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this document, the computer-readable storage media may be any tangible medium that contains or stores a program, which can be used by or in conjunction with an instruction execution system, device, or component.
[0140] The computer-readable signal media may include data signals propagated in a baseband or as part of a carrier wave, which carry computer-readable program codes. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The computer-readable signal media may also be any computer-readable media other than the computer-readable storage media, which can send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, device, or component.
[0141] The program codes contained on the computer-readable media may be transmitted by any appropriate media, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.
[0142] The computer program codes for performing the operations of the present invention may be written in one or more programming languages or combinations thereof. The programming languages include object-oriented programming languages such as Java, Smalltalk, C++, and also include conventional procedural programming languages - such as the "C" language or similar programming languages. The program codes may be executed entirely on the user's computer, partially on the user's computer, executed as an independent software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).
[0143] Those of ordinary skill in the art should understand that the various modules or steps of the present invention described above can be implemented using a general-purpose computing device. They can be concentrated on a single computing device or distributed over a network composed of multiple computing devices. Optionally, they can be implemented with program code executable by a computer device, so that they can be stored in a storage device and executed by the computing device, or they can be separately fabricated into individual integrated circuit modules, or multiple modules or steps among them can be fabricated into a single integrated circuit module for implementation. Thus, the present invention is not limited to any specific combination of hardware and software.
[0144] Note that the above is only the preferred embodiment of the present invention and the technical principles applied. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein. Various obvious changes, re-adjustments, and substitutions can be made by those skilled in the art without departing from the protection scope of the present invention. Therefore, although the present invention has been described in more detail through the above embodiments, the present invention is not limited to the above embodiments. Without departing from the concept of the present invention, more other equivalent embodiments can be included, and the scope of the present invention is determined by the scope of the appended claims.
Claims
1. A method for detecting feature importance, characterized in that, the method includes: obtaining a sample set, the sample set including at least one sample, and the sample including at least two operation content identification data arranged in chronological order; for each sample in the sample set, determining a first contribution value of each operation content identification data in the current sample to the prediction result of the target model; determining a second contribution value corresponding to each operation content according to the first contribution value corresponding to each operation content identification data; determining a feature importance detection result of the target model according to the second contribution value corresponding to each operation content.
2. The method according to claim 1, characterized in that, the determining of the first contribution value of each operation content identification data in the current sample to the prediction result of the target model includes: obtaining the reference operation content identification data corresponding to the pre-set reference operation content; for each operation content identification data in the current sample, determining the path and difference between the current operation content identification data and the reference operation content identification data; dividing the path into at least two sub-paths and determining the gradient corresponding to each sub-path; determining the first contribution value of the current operation content identification data to the prediction result of the target model according to the gradient corresponding to each sub-path and the difference.
3. The method according to claim 1, characterized in that, the determining of the second contribution value corresponding to each operation content includes: taking the mean value of the first contribution values corresponding to all operation content identification data corresponding to the same operation content in the sample set as the second contribution value corresponding to this operation content.
4. The method according to claim 1, characterized in that, the determining of the feature importance detection result of the target model according to the second contribution value corresponding to each operation content includes: sorting each operation content based on the second contribution value to obtain a sorting result; determining the feature importance detection result of the target model according to the sorting result.
5. The method according to claim 4, characterized in that, the first contribution value corresponding to the operation content identification data that has a positive contribution to the prediction result of the target model is a positive number, and the first contribution value corresponding to the operation content identification data that has a negative contribution to the prediction result of the target model is a negative number. The sorting of each operation content based on the second contribution value to obtain a sorting result includes: sorting each operation content based on the absolute value of the second contribution value to obtain a sorting result.
6. The method according to claim 1, characterized in that, further includes: selecting a sample from the sample set and selecting at least two operation contents from the feature importance detection result; Determine the relationship between at least two data replacement amounts corresponding to each of the at least two operation contents and the corresponding probabilities, where the data replacement amount is the number of operation content identification data replaced by the operation content identification data corresponding to the corresponding operation content in the selected sample, and the probability is the percentage of the target sample predicted by the target model as the target result. The target sample is the selected sample after the operation content identification data corresponding to the corresponding data replacement amount is replaced by the operation content identification data corresponding to the corresponding operation content; Determine the feature importance relationship between the at least two operation contents according to the relationship; Determine whether the feature importance detection result is accurate according to the feature importance relationship between the at least two operation contents.
7. The method according to claim 6, wherein, The determining the relationship between at least two data replacement amounts corresponding to each of the at least two operation contents and the corresponding probabilities includes: For each of the at least two operation contents, gradually replace each operation content identification data in the selected sample with the operation content identification data corresponding to the current operation content; When any operation content identification data in the selected sample is replaced by the current operation content identification data, increment the data replacement amount by one, and determine the probability that the selected sample after data replacement is predicted by the target model as the target result; Establish the corresponding relationship between the current data replacement amount and the probability.
8. The method according to claim 7, wherein, The target model is a risk control model. The determining the probability that the target sample after data replacement is predicted by the target model as the target result includes: Input the target sample after data replacement into the target model to obtain a risk control score, and the risk control score corresponds to a risk probability.
9. The method according to claim 6, wherein, It further includes: Determine a relationship graph, which includes a relationship curve, and the relationship curve is used to represent the relationship between at least two data replacement amounts corresponding to the corresponding operation content and the corresponding probabilities; Display the relationship graph in the visual interaction interface.
10. A feature importance detection device, wherein, It includes: An acquisition module, configured to acquire a sample set, where the sample set includes at least one sample, and the sample includes at least two operation content identification data arranged in chronological order; A first contribution value module, configured to determine the first contribution value of each operation content identification data in the current sample to the prediction result of the target model for each sample in the sample set; A second contribution value module, which determines the second contribution value corresponding to each operation content according to the first contribution value corresponding to each operation content identification data; A result module, configured to determine the feature importance detection result of the target model according to the second contribution value corresponding to each operation content.
11. An electronic device, wherein, The electronic device includes: One or more processors; A memory, configured to store one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the feature importance detection method according to any one of claims 1-9.
12. A computer-readable storage medium, on which a computer program is stored, characterized in that, when the program is executed by a processor, it implements the feature importance detection method according to any one of claims 1-9.