Feature importance visualization method, device and readable storage medium

Through the feature importance visualization method, the hash coding model and clustering technology are used to solve the problem of poor feature importance interpretation in deep learning models and achieve more accurate and intuitive model interpretation.

CN111612077BActive Publication Date: 2024-10-22WEBANK (CHINA)
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202010445870.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-05-22
Publication Date
2024-10-22
Estimated Expiration
2040-05-22

AI Technical Summary

Technical Problem

The feature importance explanation effect of deep learning models in the existing technology is poor, and it is difficult to accurately measure the importance of features to the model, resulting in poor model explanation effect.

Method used

Using the feature importance visualization method, by obtaining the target feature dimension and sample category, based on the preset hash coding model and hash coding value, the feature importance value is determined, and visual data is generated, including the connection strength of bit nodes and category nodes. Graphs are clustered to improve interpretation.

Benefits of technology

It improves the accuracy and intuitiveness of model explanation, allows business personnel to obtain model explanation results simply and directly, and enhances the effect of model explanation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN111612077B_ABST
    Figure CN111612077B_ABST
Patent Text Reader

Abstract

The present application discloses a feature importance visualization method, device and readable storage medium, the feature importance visualization method comprising: obtaining each target feature dimension and the sample category corresponding to each target feature dimension, and determining the feature importance value corresponding to each target feature dimension based on a preset hash coding model and a preset hash coding value corresponding to each sample category, and then determining the target bit corresponding to each target feature dimension based on each feature importance value, and then generating visualized feature importance data based on each feature importance value, each target bit and each sample category. The present application solves the technical problem of poor model explanation effect.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of artificial intelligence in financial technology (Fintech), and in particular to a feature importance visualization method, device and readable storage medium. Background Art

[0002] With the continuous development of financial technology, especially Internet technology finance, more and more technologies (such as distributed, blockchain, artificial intelligence, etc.) are applied in the financial field, but the financial industry also puts forward higher requirements on technology, such as higher requirements on the distribution of corresponding to-do items in the financial industry.

[0003] With the continuous development of computer software and artificial intelligence, the application fields of deep learning are becoming more and more extensive, but the internal operating principles of deep learning models and the composition of their various parts still need to be clarified. At present, the importance of model input features is usually estimated through methods such as Shapley importance. However, this method is usually used to explain whether a certain feature is important to the model. However, this method can only roughly and approximately explain the importance of a certain feature to the model, and it is difficult to explain the degree of importance of a certain feature to the model, which leads to low accuracy of model interpretation of deep learning models, and then leads to poor model interpretation effect. Moreover, since the current model interpretation method can only explain whether a certain feature is important to the model, it is difficult for business personnel to simply and directly obtain the model interpretation results, which further reduces the effect of model interpretation. Therefore, there is a technical problem of poor model interpretation effect in the prior art. Summary of the invention

[0004] The main purpose of this application is to provide a feature importance visualization method, device and readable storage medium, aiming to solve the technical problem of poor model interpretation effect in the prior art.

[0005] To achieve the above object, the present application provides a feature importance visualization method, which is applied to a feature importance visualization device, and the feature importance visualization method includes:

[0006] Obtain each target feature dimension and a sample category corresponding to each target feature dimension, and determine a feature importance value corresponding to each target feature dimension based on a preset hash coding model and a preset hash coding value corresponding to each sample category;

[0007] Based on the importance values ​​of the features, determining the target bits corresponding to the target feature dimensions;

[0008] Based on the feature importance values, the target bits and the sample categories, visual feature importance data is generated.

[0009] Optionally, the visual feature importance data includes a target connection strength graph, and the feature importance value includes each degree of fit between the target bit and each sample category, wherein there is a degree of fit between a target bit and a sample category,

[0010] The step of generating visualized feature importance data based on each feature importance value, each target bit and each sample category comprises:

[0011] Generate a bit node corresponding to each of the target bits and a category node corresponding to each of the target sample categories, and connect the bit node and the category node corresponding to each of the matching degrees to obtain a first initial connection strength graph;

[0012] Obtaining bit consistency results between each pair of the bit nodes and category consistency results between each pair of the category nodes;

[0013] Based on the bit consistency results, each of the bit nodes is connected in the first initial connection strength graph, and based on the category consistency results, each of the category nodes is connected to obtain a second initial connection strength graph;

[0014] In the second initial connection strength graph, each of the bit nodes and each of the category nodes are clustered respectively to obtain the target connection strength graph.

[0015] Optionally, the feature importance vector corresponding to the feature importance value,

[0016] The step of obtaining the bit consistency results between each pair of the bit nodes comprises:

[0017] Determine the feature importance vector corresponding to each of the bit nodes, and calculate the cosine value of the angle between each of the feature importance vectors;

[0018] Based on the cosine values ​​of the angles, a bit consistency result between the bit nodes is determined.

[0019] Optionally, the step of clustering the bit nodes and the category nodes respectively to obtain the target connection strength graph includes:

[0020] Obtaining a bit correlation value between each of the bit nodes and a category correlation value between each of the category nodes;

[0021] Based on the bit relevance values, clustering the bit nodes to obtain a first clustering result, and based on the category relevance values, clustering the category nodes to obtain a second clustering result;

[0022] The target connection strength graph is generated based on the first clustering result and the second clustering result.

[0023] Optionally, the first clustering result includes one or more clustering bit nodes corresponding to each of the bit nodes, and the second clustering result includes one or more clustering category nodes corresponding to each of the category nodes.

[0024] The step of clustering the bit nodes based on the bit relevance values ​​to obtain a first clustering result, and clustering the category nodes based on the category relevance values ​​to obtain a second clustering result comprises:

[0025] Comparing each of the bit relevance values ​​with a preset bit relevance threshold, respectively, to determine each first target relevance value among the bit relevance values ​​that is greater than or equal to the preset bit relevance threshold;

[0026] Clustering adjacent bit nodes corresponding to each of the first target relevance values ​​respectively to obtain each of the clustered bit nodes;

[0027] Comparing each of the category relevance values ​​with a preset category relevance threshold, respectively, to determine each second target relevance value among the category relevance values ​​that is greater than or equal to the preset category relevance threshold;

[0028] Adjacent category nodes corresponding to the second target relevance value are clustered respectively to obtain the cluster category nodes.

[0029] Optionally, the step of determining the feature importance value corresponding to each of the target feature dimensions based on a preset hash coding model and a preset hash coding value corresponding to each of the sample categories includes:

[0030] Inputting the sample sets corresponding to the sample categories into a preset hash coding model to obtain output hash coding values ​​corresponding to the sample categories;

[0031] Obtaining a preset hash code value corresponding to each of the sample categories, and determining a classification association strength result corresponding to each of the target feature dimensions based on each of the output hash code values ​​and each of the preset hash code values;

[0032] According to each association strength value in the classification association strength result, the feature importance value corresponding to each of the target feature dimensions is determined.

[0033] Optionally, the classification association strength result includes at least one association strength value, and one target feature dimension corresponds to one association strength value.

[0034] The step of determining the classification association strength result corresponding to each of the target feature dimensions based on each of the output hash code values ​​and each of the preset hash code values ​​comprises:

[0035] Determine the same type target hash value and the different type target hash value corresponding to each sample category in each of the preset hash code values, and determine the hash code value corresponding to each sample category in each of the output hash code values;

[0036] Based on the hash code values, the same type target hash values ​​and the different type target hash values ​​respectively corresponding to the sample categories, the association strength values ​​corresponding to the target feature dimensions are calculated.

[0037] Optionally, before the step of inputting the sample sets corresponding to the sample categories into a preset hash coding model to obtain the output hash coding values ​​corresponding to the sample categories, the feature importance visualization method includes:

[0038] Obtain training data and a hash model to be trained, and generate a target hash coding result corresponding to the training data based on a preset target hash coding method;

[0039] Based on the preset hash code value and the training data, the hash code model to be trained is iteratively trained to optimize a preset polarization loss function corresponding to the hash code model to be trained, until the hash code model to be trained reaches a preset iteration end condition, thereby obtaining the preset hash code model.

[0040] The present application also provides a feature importance visualization device, which is a virtual device and is applied to a feature importance visualization device. The feature importance visualization device includes:

[0041] A first determination module is used to obtain each target feature dimension and a sample category corresponding to each target feature dimension, and determine a feature importance value corresponding to each target feature dimension based on a preset hash coding model and a preset hash coding value corresponding to each sample category;

[0042] A second determination module is used to determine the target bit position corresponding to each of the target feature dimensions based on the feature importance values;

[0043] A generation module is used to generate visual feature importance data based on each of the feature importance values, each of the target bits and each of the sample categories.

[0044] Optionally, the generating module includes:

[0045] A first connection submodule is used to generate a bit node corresponding to each of the target bits and a category node corresponding to each of the target sample categories, and connect the bit node and the category node corresponding to each of the matching degrees to obtain a first initial connection strength graph;

[0046] An acquisition submodule, used for acquiring bit consistency results between each pair of the bit nodes and category consistency results between each pair of the category nodes;

[0047] A second connection submodule, configured to connect each of the bit nodes in the first initial connection strength graph based on each of the bit consistency results, and to connect each of the category nodes based on each of the category consistency results, to obtain a second initial connection strength graph;

[0048] A clustering submodule is used to cluster each of the bit nodes and each of the category nodes in the second initial connection strength graph to obtain the target connection strength graph.

[0049] Optionally, the acquisition submodule includes:

[0050] A first calculation unit, used to determine the feature importance vector corresponding to each of the bit nodes, and calculate the cosine value of the angle between each of the feature importance vectors;

[0051] The first determination unit is used to determine the bit consistency result between each of the bit nodes based on the cosine value of each of the angles.

[0052] Optionally, the clustering submodule includes:

[0053] An acquiring unit, used for acquiring a bit correlation value between each of the bit nodes and a category correlation value between each of the category nodes;

[0054] A clustering unit, configured to cluster the bit nodes based on the bit relevance values ​​to obtain a first clustering result, and cluster the category nodes based on the category relevance values ​​to obtain a second clustering result;

[0055] A generating unit is used to generate the target connection strength graph based on the first clustering result and the second clustering result.

[0056] Optionally, the clustering unit includes:

[0057] A first determining subunit, configured to compare each of the bit relevance values ​​with a preset bit relevance threshold, and determine each first target relevance value among the bit relevance values ​​that is greater than or equal to the preset bit relevance threshold;

[0058] A first clustering subunit, used for clustering adjacent bit nodes corresponding to each of the first target relevance values, respectively, to obtain each of the clustered bit nodes;

[0059] A second determining subunit is used to compare each of the category relevance values ​​with a preset category relevance threshold, and determine each second target relevance value among the category relevance values ​​that is greater than or equal to the preset category relevance threshold;

[0060] The second clustering subunit is used to cluster adjacent category nodes corresponding to the second target relevance value respectively to obtain each of the cluster category nodes.

[0061] Optionally, the first determining module includes:

[0062] A hash coding submodule, used to input the sample sets corresponding to the sample categories into a preset hash coding model to obtain output hash coding values ​​corresponding to the sample categories;

[0063] A first determination submodule is used to obtain a preset hash code value corresponding to each of the sample categories, and determine a classification association strength result corresponding to each of the target feature dimensions based on each of the output hash code values ​​and each of the preset hash code values;

[0064] The second determination submodule is used to determine the feature importance values ​​corresponding to each of the target feature dimensions according to each association strength value in the classification association strength result.

[0065] Optionally, the first determining submodule includes:

[0066] A second determining unit is used to determine the same type target hash value and the different type target hash value corresponding to each sample category in each of the preset hash code values, and determine the hash code value corresponding to each sample category in each of the output hash code values;

[0067] The second calculation unit is used to calculate the association strength value corresponding to each of the target feature dimensions based on the hash code values, the same type target hash values ​​and the different type target hash values ​​respectively corresponding to each of the sample categories.

[0068] Optionally, the feature importance visualization device further includes:

[0069] The encoding module is used to obtain the training data and the hash model to be trained, and generate a target hash encoding result corresponding to the training data based on a preset target hash encoding method;

[0070] Iterative training is used to iteratively train the hash coding model to be trained based on the preset hash coding value and the training data to optimize the preset polarization loss function corresponding to the hash coding model to be trained until the hash coding model to be trained reaches a preset iteration end condition, thereby obtaining the preset hash coding model.

[0071] The present application also provides a feature importance visualization device, which is a physical device, and includes: a memory, a processor, and a program of the feature importance visualization method stored in the memory and executable on the processor. When the program of the feature importance visualization method is executed by the processor, the steps of the feature importance visualization method as described above can be implemented.

[0072] The present application also provides a readable storage medium, on which is stored a program for implementing a feature importance visualization method. When the program for implementing a feature importance visualization method is executed by a processor, the steps of the feature importance visualization method as described above are implemented.

[0073] The present application obtains each target feature dimension and the sample category corresponding to each target feature dimension, and determines the feature importance value corresponding to each target feature dimension based on the preset hash coding model and the preset hash coding value corresponding to each sample category, and then determines the target bit corresponding to each target feature dimension based on each feature importance value, and then generates visual feature importance data based on each feature importance value, each target bit and each sample category. That is, the present application provides a method for quantitatively measuring feature importance and visualizing it, that is, after obtaining each target feature dimension and the sample category corresponding to each target feature dimension, the feature importance value corresponding to each target feature dimension can be measured based on the preset hash coding model and the preset hash coding value corresponding to each sample category, wherein the feature importance value represents the contribution of the target feature dimension to the model, thereby achieving the purpose of quantitatively measuring the importance of each target feature dimension by calculating the feature importance value, and then compared with the current model interpretation method, the present application can accurately and meticulously measure the degree of importance of each feature to the model by calculating the feature importance value, thereby improving the model. The accuracy of the model interpretation is improved, thereby improving the model interpretation effect. Furthermore, based on the importance values ​​of each feature, the target bit corresponding to each target feature dimension is determined, and then based on the importance values ​​of each feature, the target bit and the sample category, the visual feature importance data can be generated, thereby achieving the purpose of visualizing the importance values ​​of each feature, improving the intuitiveness and readability of each feature importance value, and then business personnel can simply and directly obtain the model interpretation results based on the visualized feature importance data, thereby improving the intuitiveness and understandability of the model interpretation results, and further improving the model interpretation effect. Therefore, the technical problem of poor model explanation effect is solved. BRIEF DESCRIPTION OF THE DRAWINGS

[0074] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0075] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0076] Figure 1 This is a flow chart of the first embodiment of the feature importance visualization method of the present application;

[0077] Figure 2A schematic diagram of the second initial connection strength map in the feature importance visualization method of the present application;

[0078] Figure 3 A schematic diagram of a target connection strength map described in the feature importance visualization method of the present application;

[0079] Figure 4 A schematic diagram of the back propagation of the preset deep polarization network described in the feature importance visualization method of the present application;

[0080] Figure 5 This is a flow chart of the second embodiment of the feature importance visualization method of the present application;

[0081] Figure 6 This is a schematic diagram of the device structure of the hardware operating environment involved in the embodiment of the present application.

[0082] The realization of the purpose, functional features and advantages of this application will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0083] It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0084] The present application embodiment provides a feature importance visualization method. In the first embodiment of the feature importance visualization method of the present application, refer to Figure 1 , the feature importance visualization method includes:

[0085] Step S10, obtaining each target feature dimension and a sample category corresponding to each target feature dimension, and determining a feature importance value corresponding to each target feature dimension based on a preset hash coding model and a preset hash coding value corresponding to each sample category;

[0086] In this embodiment, a target feature dimension corresponds to a sample category, and the target feature dimension is a set of features to be measured corresponding to a sample set corresponding to the corresponding sample category, wherein the sample set includes at least one sample to be measured. For example, assuming that the sample category is a cat image, the corresponding target feature dimension includes hair features, eye features, etc.

[0087] In addition, it should be noted that the preset hash coding model includes a deep polarization network, wherein the deep polarization network includes a hidden layer and a hash layer, wherein the hidden layer is a one-layer or multi-layer neural network for data processing, wherein the data processing includes convolution and pooling, etc., and the hash coding is a one-layer or multi-layer neural network for hashing the output result of the hidden layer, and the sample set can be represented by a sample matrix to be measured, wherein each row of the sample matrix to be measured corresponds to a feature to be measured, and each column of the sample matrix to be measured corresponds to a sample to be measured. For example, assuming that the sample matrix to be measured is an m*n matrix, the sample matrix to be measured corresponds to m features to be measured and corresponds to n samples to be measured.

[0088] Obtain each target feature dimension and the sample category corresponding to each target feature dimension, and determine the feature importance value corresponding to each target feature dimension based on a preset hash coding model and a preset hash coding value corresponding to each sample category. Specifically, obtain each target feature dimension, and determine the sample category corresponding to each target feature dimension, and then input the sample matrix to be measured corresponding to the sample set corresponding to each sample category into the preset hash coding model, and hash code each sample matrix to be measured to obtain the output hash coding value of each sample to be measured corresponding to each sample matrix to be measured, and then obtain the preset hash coding value corresponding to each sample category, and determine the feature importance value corresponding to each target feature dimension corresponding to each sample category based on each output hash coding value and the preset hash coding value corresponding to each sample category.

[0089] Step S20: determining the target bit position corresponding to each target feature dimension based on the feature importance value.

[0090] In this embodiment, it should be noted that the feature importance value is a measure of the importance of each target feature dimension to the deep polarization network, wherein the feature importance value includes a feature importance representation vector, and the feature importance representation vector includes at least one target bit, wherein each target bit corresponds to one sample category, and the value on the target bit is the degree of fit between the target feature dimension corresponding to the target bit and the sample category corresponding to the target bit.

[0091] Based on each of the feature importance values, the target bit corresponding to each of the target feature dimensions is determined. Specifically, each target bit in each of the feature importance representation vectors is obtained respectively, and based on a one-to-one mapping relationship between the target bit and the sample category and a one-to-one mapping relationship between the sample category and the target feature dimension, the target bit corresponding to each of the target feature dimensions is determined.

[0092] Step S30, generating visual feature importance data based on each of the feature importance values, each of the target bits and each of the sample categories.

[0093] In this embodiment, it should be noted that each of the feature importance representation vectors can be represented by a feature importance matrix, wherein the feature importance matrix is ​​a matrix for storing each of the feature importance vectors, wherein each column of the feature importance matrix corresponds to a target bit, and each row of the feature importance matrix corresponds to a sample category, wherein the bit value on the target bit is the degree of fit between the target bit and the sample category. For example, assuming that the feature importance matrix is ​​a K*C matrix, the feature importance matrix is ​​represented as the degree of fit between K bits and C target sample classifications, that is, the feature importance matrix includes K*C bit values, and if it is assumed that the value range of the bit value is [0.0, 1.0], the closer the bit value is to 1, the higher the degree of fit corresponding to the bit value, and the closer the bit value is to 0, the lower the degree of fit corresponding to the bit value.

[0094] Based on each of the feature importance values, each of the target bits and each of the sample categories, generate visual feature importance data, specifically, generate a bit node corresponding to each of the target bits and a category node corresponding to each of the sample categories, and then based on the size of the bit value of each of the feature importance vectors, connect each of the bit nodes and each of the category nodes with line segments of different thicknesses or colors to obtain a first initial connection strength graph, and then based on the bit node similarity between each of the bit nodes and the category node similarity between each of the category nodes, connect each of the bit nodes with line segments of different thicknesses or colors, connect each of the category nodes, and obtain a second initial connection strength graph, and further, cluster each of the bit nodes and each of the category nodes in the second initial connection strength graph, and obtain a target connection strength graph, such as Figure 2 : is a schematic diagram of the second initial connection strength graph, wherein K represents a bit node, C represents each category node, K1 to K6 are the bit nodes, bus, truck, cat and dog are all category nodes, and 1.0, 0.5 and 0.0 are all numerical values ​​of the feature importance values, such as Figure 3 The schematic diagram of the target connection strength diagram is shown in FIG. cluster Represents each bit node after clustering, C cluster Represents each category node after clustering, K 1-2 To K 3-6All are the bit nodes after clustering, traffic and animals are the category nodes after clustering, and 1.0, 0.5 and 0.0 are the numerical values ​​of the feature importance values.

[0095] Furthermore, it should be noted that each of the bit nodes corresponds to the output layer of the preset deep polarization network. Based on the reverse propagation of the preset deep polarization network, each of the matching degrees can be transmitted to the previous deep polarization network layer in the preset deep polarization network, such as Figure 4 The schematic diagram of the reverse propagation of the preset deep polarization network is shown, which is a schematic diagram of transferring each of the matching degrees to the previous deep polarization network layer, wherein K L-1 It is represented as the L-1th deep polarization network layer in the preset deep polarization network, K L Represented as the L-th deep polarization network layer in the preset deep polarization network, and They are all neurons in the L-1th layer of deep polarization network layer, and are all neurons in the L-th deep polarization network layer, 1.0, 0.5 and 0.0 are all numerical values ​​of the feature importance values, that is, the numerical values ​​of the respective degrees of fit. Furthermore, based on user commands, the thickness and color of the connecting line segments of the target connection strength graph can be adjusted to integrate empirical logical judgment rules into the target connection strength graph, and then based on the back propagation of the preset deep polarization network, the empirical logical judgment rules can be implemented to optimize the preset deep polarization network.

[0096] The visual feature importance data includes a target connection strength graph, and the feature importance value includes each degree of fit between the target bit and each sample category, wherein there is a degree of fit between a target bit and a sample category,

[0097] The step of generating visualized feature importance data based on each feature importance value, each target bit and each sample category comprises:

[0098] Step S21, generating a bit node corresponding to each target bit and a category node corresponding to each target sample category, and connecting the bit node and the category node corresponding to each degree of fit to obtain a first initial connection strength graph;

[0099] In this embodiment, a bit node corresponding to each target bit and a category node corresponding to each target sample category are generated, and the bit node and the category node corresponding to each degree of fit are connected to obtain a first initial connection strength graph. Specifically, a bit node corresponding to each target bit and a category node corresponding to each sample category are generated, and based on the numerical size of each degree of fit, the bit node and the category node corresponding to each degree of fit are connected with line segments of different thicknesses or colors to obtain the first initial connection strength graph.

[0100] Step S22, obtaining the bit consistency results between each pair of the bit nodes and the category consistency results between each pair of the category nodes;

[0101] In this embodiment, it should be noted that the bit consistency result is the bit node correlation degree between the two bit nodes, and the category consistency result is the category node correlation degree between the two category nodes.

[0102] Obtain the bit consistency results between each of the bit nodes and the category consistency results between each of the category nodes. Specifically, obtain the bit representation vector corresponding to each of the bit nodes, and determine the bit consistency results between each of the bit nodes based on each of the bit representation vectors. Similarly, obtain the category representation vector corresponding to each of the category nodes, and determine the category consistency results between each of the category nodes based on each of the category representation vectors.

[0103] Among them, the feature importance vector corresponding to the feature importance value is,

[0104] The step of obtaining the bit consistency results between each pair of the bit nodes comprises:

[0105] Step S221, determining the feature importance vector corresponding to each bit node, and calculating the cosine value of the angle between each pair of the feature importance vectors;

[0106] In this embodiment, it should be noted that the feature importance vector is a vector composed of the bit values ​​corresponding to the bit node. For example, assuming that the bit node is connected to three category nodes, there is a bit value between the bit node and each of the category nodes. Further, assuming that the three bit values ​​are a, b and c, the feature importance vector is (a, b, c).

[0107] Determine the feature importance vector corresponding to each of the bit nodes, and calculate the cosine value of the angle between each of the feature importance vectors. Specifically, obtain the feature importance vector corresponding to each of the bit nodes, and determine the feature importance vector angle between each of the feature importance vectors, and then calculate the cosine value of the angle between each of the feature importance vectors.

[0108] Step S222: determining the bit consistency result between each of the bit nodes based on the cosine value of each of the angles.

[0109] In this embodiment, it should be noted that the bit node correlation degree includes a positive correlation degree and a negative correlation degree, and the value range of the angle cosine value is [-1, 1], wherein the closer the angle cosine value is to 1, the higher the positive correlation degree of the two bits corresponding to the angle cosine value is; the closer the angle cosine value is to -1, the higher the negative correlation degree of the two bits corresponding to the angle cosine value is; the closer the angle cosine value is to 0, the lower the negative correlation degree or positive correlation degree of the two bits corresponding to the angle cosine value is.

[0110] Similarly, the sample category representation vector corresponding to each of the category nodes is obtained, and the cosine value of the angle between each of the sample category representation vectors is calculated, and then based on the cosine value of each angle, the category consistency result between each of the category nodes is determined, wherein the sample category representation vector is a vector composed of the bit values ​​corresponding to the category nodes. For example, assuming that the category node is connected to three bit nodes, there is a bit value between the category node and each of the bit nodes, and then assuming that the three bit values ​​are a, b and c respectively, the sample category representation vector is (a, b, c).

[0111] Step S23, connecting each of the bit nodes in the first initial connection strength graph based on each of the bit consistency results, and connecting each of the category nodes based on each of the category consistency results to obtain a second initial connection strength graph;

[0112] In this embodiment, based on each of the bit consistency results, each of the bit nodes is connected in the first initial connection strength graph, and based on each of the category consistency results, each of the category nodes is connected to obtain a second initial connection strength graph. Specifically, based on the cosine value of the angle corresponding to each of the bit consistency results, each of the bit nodes is connected in the first initial connection strength graph with line segments of different thicknesses, wherein different colors can be assigned to line segments of different thicknesses to indicate whether the two bit nodes are positively correlated or negatively correlated. Similarly, based on the cosine value of the angle corresponding to each of the category consistency results, each of the category nodes is connected in the first initial connection strength graph with line segments of different thicknesses, wherein different colors can be assigned to line segments of different thicknesses to indicate whether the two category nodes are positively correlated or negatively correlated.

[0113] Step S24: clustering each of the bit nodes and each of the category nodes in the second initial connection strength graph respectively to obtain the target connection strength graph.

[0114] In this embodiment, each of the bit nodes and each of the category nodes are clustered in the second initial connection strength graph to obtain the target connection strength graph. Specifically, the bit node correlation degree between adjacent bit nodes and the category node correlation degree between adjacent bit nodes in the second initial connection strength graph are obtained, and then based on the bit node correlation degree, each of the bit nodes is clustered, and based on the category node correlation degree, each of the category nodes is clustered to obtain the target connection strength graph.

[0115] The step of clustering the bit nodes and the category nodes to obtain the target connection strength graph comprises:

[0116] Step S241, obtaining a bit correlation value between each of the bit nodes and a category correlation value between each of the category nodes;

[0117] In this embodiment, it should be noted that the bit correlation value is a numerical value corresponding to the correlation degree of the bit node, that is, the cosine value of the angle between the two feature importance vectors, and the category correlation value is a numerical value corresponding to the correlation degree of the category node, that is, the cosine value of the angle between the two sample category representation vectors.

[0118] Step S242: clustering the bit nodes based on the bit association values ​​to obtain a first clustering result, and clustering the category nodes based on the category association values ​​to obtain a second clustering result.

[0119] In this embodiment, based on each of the bit correlation values, each of the bit nodes is clustered to obtain a first clustering result, and based on each of the category correlation values, each of the category nodes is clustered to obtain a second clustering result. Specifically, each of the bit correlation values ​​is compared with a preset bit correlation threshold. If the bit correlation value is greater than or equal to the preset bit correlation threshold, two adjacent bit nodes corresponding to the bit correlation value are merged into one bit merged node. After the adjacent bit nodes corresponding to each of the bit correlation values ​​greater than or equal to the preset bit correlation threshold are merged, each of the bit merged nodes is used as the first clustering result. Similarly, each of the bit correlation values ​​is compared with a preset bit correlation threshold. The category association value is compared with a preset category association threshold. If the category association value is greater than or equal to the preset category association threshold, the two adjacent category nodes corresponding to the category association value are merged into one category merged node. After the adjacent category nodes corresponding to each category association value greater than or equal to the preset category association threshold are merged, each category merged node is used as the second clustering result. For example, assuming that each bit node includes a node, b node, c node and d node, and a is connected to b, b is connected to c, c is connected to d, and the bit association values ​​between b and c, c and d are greater than the preset bit association threshold, there are two nodes, a node and bcd node, after clustering.

[0120] The step of clustering the bit nodes based on the bit relevance values ​​to obtain a first clustering result, and clustering the category nodes based on the category relevance values ​​to obtain a second clustering result comprises:

[0121] Step A10, comparing each of the bit relevance values ​​with a preset bit relevance threshold, and determining each first target relevance value among the bit relevance values ​​that is greater than or equal to the preset bit relevance threshold;

[0122] In this embodiment, it should be noted that one bit relevance value corresponds to two bit nodes, and the preset bit relevance threshold is a preset bit node correlation degree threshold.

[0123] Each of the bit correlation values ​​is compared with the preset bit correlation threshold respectively, and each first target correlation value greater than or equal to the preset bit correlation threshold is determined among the bit correlation values. Specifically, for each of the bit correlation values, the bit correlation value is compared with the preset bit correlation threshold. If the bit correlation value is greater than or equal to the preset bit correlation threshold, it is determined that the two bit nodes corresponding to the bit correlation value can be merged into one bit merge node, and the bit correlation value is used as the first target correlation value.

[0124] Step A20, clustering adjacent bit nodes corresponding to the first target relevance values ​​respectively to obtain the clustered bit nodes;

[0125] In this embodiment, it should be noted that the adjacent bit nodes include two adjacent bit nodes.

[0126] Cluster the adjacent bit nodes corresponding to each of the first target correlation values ​​respectively to obtain each of the clustered bit nodes. Specifically, for each of the first target correlation values, merge the adjacent bit nodes corresponding to the first target correlation value to obtain each of the bit merged nodes, and generate each of the clustered bit nodes based on each of the bit merged nodes. For example, assuming that the bit merged node A is obtained by merging the bit node a and the bit node b, and the bit merged node B is obtained by merging the bit node b and the bit node c, then the bit merged node A and the bit merged node B can be merged into a bit clustering node C, wherein the bit clustering node includes the bit node a, the bit node b and the bit node c.

[0127] Step A30, comparing each of the category relevance values ​​with a preset category relevance threshold, and determining each second target relevance value among the category relevance values ​​that is greater than or equal to the preset category relevance threshold;

[0128] In this embodiment, it should be noted that one category relevance value corresponds to two category nodes, and the preset category relevance threshold is a preset category node relevance threshold.

[0129] Each of the category association values ​​is compared with a preset category association threshold, and each second target association value greater than or equal to the preset category association threshold is determined. Specifically, for each of the category association values, the category association value is compared with the preset category association threshold. If the category association value is greater than or equal to the preset category association threshold, it is determined that the two category nodes corresponding to the category association value can be merged into one category merged node, and the category association value is used as the second target association value. If the category association value is less than the preset category association threshold, it is determined that the two category nodes corresponding to the category association value cannot be clustered, thereby obtaining each second target association value.

[0130] Step A40: clustering adjacent category nodes corresponding to the second target relevance value respectively to obtain the cluster category nodes.

[0131] In this embodiment, it should be noted that the adjacent category nodes include two adjacent category nodes.

[0132] The adjacent category nodes corresponding to the second target correlation value are clustered respectively to obtain each of the cluster category nodes. Specifically, for each of the second target correlation values, the adjacent category nodes corresponding to the second target correlation value are merged to obtain each of the category merged nodes, and each of the cluster category nodes is generated based on each of the category merged nodes.

[0133] Step S243: generating the target connection strength graph based on the first clustering result and the second clustering result.

[0134] Based on the first clustering result and the second clustering result, the target connection strength graph is generated. Specifically, based on the first clustering result and the second clustering result, a cluster connection strength graph corresponding to the second initial connection strength graph is generated, and it is determined whether the cluster connection strength graph meets the preset clustering end condition. If the cluster connection strength graph meets the preset clustering end condition, the cluster connection strength graph is used as the target connection strength graph. If the cluster connection strength graph does not meet the preset clustering end condition, each node in the cluster connection strength graph is clustered again until The cluster connection strength graph satisfies the preset clustering end condition, wherein the preset clustering end condition is a condition for determining whether to stop clustering, wherein the preset clustering end condition includes reaching the minimum number of nodes, reaching the maximum number of clustering times, etc. Each time the clustering process is performed, a cluster connection strength graph will be generated, and then the second initial connection strength graph, each cluster connection strength graph and the target connection strength graph can be displayed in a preset visual display method, wherein the preset visual display method includes sequential split-screen display, parallel same-screen display and cross-sliding switching display, etc.

[0135] This embodiment obtains each target feature dimension and the sample category corresponding to each target feature dimension, and determines the feature importance value corresponding to each target feature dimension based on a preset hash coding model and a preset hash coding value corresponding to each sample category, and then determines the target bit corresponding to each target feature dimension based on each feature importance value, and then generates visualized feature importance data based on each feature importance value, each target bit and each sample category. That is, this embodiment provides a method for quantitatively measuring feature importance and visualizing it, that is, after obtaining each target feature dimension and the sample category corresponding to each target feature dimension, the feature importance value corresponding to each target feature dimension can be measured based on a preset hash coding model and a preset hash coding value corresponding to each sample category, wherein the feature importance value represents the contribution of the target feature dimension to the model, thereby achieving the purpose of quantitatively measuring the importance of each target feature dimension by calculating the feature importance value, and then compared with the current model interpretation method, this application can accurately and meticulously measure the degree of importance of each feature to the model by calculating the feature importance value, thereby improving The accuracy of model interpretation is improved, thereby improving the model interpretation effect. Furthermore, based on the importance values ​​of each feature, the target bit corresponding to each target feature dimension is determined, and then based on the importance values ​​of each feature, the target bit and the sample category, the visual feature importance data can be generated, thereby achieving the purpose of visualizing the importance values ​​of each feature, improving the intuitiveness and readability of each feature importance value, and then business personnel can simply and directly obtain the model interpretation results based on the visualized feature importance data, thereby improving the intuitiveness and understandability of the model interpretation results, and further improving the model interpretation effect. Therefore, the technical problem of poor model explanation effect is solved.

[0136] Further, refer to Figure 5 Based on the first embodiment of the present application, in another embodiment of the present application, the step of determining the feature importance value corresponding to each of the target feature dimensions based on the preset hash coding model and the preset hash coding value corresponding to each of the sample categories includes:

[0137] Step S11, inputting the sample sets corresponding to the sample categories into a preset hash coding model to obtain output hash coding values ​​corresponding to the sample categories;

[0138] In this embodiment, the sample sets corresponding to each of the sample categories are input into a preset hash coding model to obtain output hash coding values ​​corresponding to each of the sample categories. Specifically, the sample matrix to be measured corresponding to the sample set is input into the hidden layer of the deep polarization network, and the sample matrix to be measured is processed to obtain a feature representation matrix of the samples to be measured, wherein the feature representation matrix of the samples to be measured includes all feature information in the sample set, and then the feature representation matrix of the samples to be measured is input into the hash layer, and the feature representation matrix of the samples to be measured is hash-coded to obtain a hash coding result.

[0139] Wherein, before the step of inputting the sample sets corresponding to the sample categories into a preset hash coding model to obtain the output hash coding values ​​corresponding to the sample categories, the feature importance visualization method includes:

[0140] Step A10, obtaining training data and a hash model to be trained, and generating a target hash coding result corresponding to the training data based on a preset target hash coding method;

[0141] In the present embodiment, it should be noted that the hash coding model to be trained is an untrained neural network model, the preset target hash coding method can be any pre-set hash coding method, the training data is a training sample for training the hash coding model to be trained, and the preset hash coding value is a hash coding value corresponding to the training sample category to which the training sample belongs, wherein one training sample category corresponds to one preset hash coding value, and the training sample category includes at least one training sample.

[0142] Acquire training data and a hash coding model to be trained, and generate the preset hash coding value corresponding to the training data based on a preset target hash coding method. Specifically, extract the training samples and the hash coding model to be trained from a preset training data storage database, and hash code the training samples based on a preset target hash coding method to generate a preset hash coding value corresponding to the training sample category to which the training samples belong.

[0143] Wherein, in step A10, the preset target hash coding method includes random target hash coding and adaptive target hash coding.

[0144] The step of generating the preset hash code value corresponding to the training data based on the preset target hash code method includes:

[0145] Step A11, performing the random target hash coding on the training data to obtain the preset hash coding value;

[0146] In this embodiment, it should be noted that if the preset target hash coding method is random target hash coding, the Hamming distance between the corresponding target hash vectors belonging to different classification samples in the target hash coding result should be the target Hamming distance 2*K*p*(1-p), wherein K is the number of bits in the target hash vector, and p is the probability that the sample corresponding to the target hash vector belongs to the classification sample. For example, assuming that the training data includes two classification vectors, K is 32 bits, and the classification samples include cats and dogs, if the probability that the sample corresponding to the classification vector belongs to a cat is 0.5, and the probability that it belongs to a dog is 0.5, then the maximum Hamming distance between the target hash vector corresponding to the cat and the target hash vector corresponding to the dog is 16.

[0147] The random target hash coding is performed on the training data to obtain the preset hash coding value. Specifically, based on a preset Gaussian random method, a preset hash coding value corresponding to the training sample is generated.

[0148] Step A12: performing the adaptive target hash coding on the training data to obtain the preset hash coding value.

[0149] In this embodiment, the adaptive target hash coding is performed on the training data to obtain the preset hash coding value. Specifically, multiple training samples of the training sample category corresponding to the training data are obtained to generate random hash coding values ​​corresponding to each of the training samples based on a preset Gaussian random method, wherein one training sample corresponds to one random hash coding value, and then the random hash coding value corresponding to each of the training samples in each of the training sample categories is determined, and the average value of each random hash coding value corresponding to each of the training sample categories is calculated to obtain the average hash coding value corresponding to each of the training sample categories, and then the average hash coding value is used as the preset hash coding value corresponding to all training samples in the corresponding training sample category.

[0150] Step A20, based on the preset hash code value and the training data, iteratively train the hash code model to be trained to optimize the preset polarization loss function corresponding to the hash code model to be trained, until the hash code model to be trained reaches a preset iteration end condition, thereby obtaining the preset hash code model.

[0151] In this embodiment, it should be noted that the preset iteration end condition includes reaching a preset iteration number threshold, a preset polarization loss function convergence, etc., and the iterative training includes one or more rounds of training.

[0152] Based on the preset hash code value and the training data, the hash code model to be trained is iteratively trained to optimize the preset polarization loss function corresponding to the hash code model to be trained, until the hash code model to be trained reaches a preset iteration end condition, and the preset hash code model is obtained. Specifically, the training data is input into the hash code model to be trained, so as to update the hash code model to be trained based on the preset hash code value, and determine whether the hash code model to be trained after the training update meets the preset iteration end condition. If the hash code model to be trained after the training update meets the preset iteration end condition, the hash code model to be trained after the training update is used as the preset hash code model. If the hash code model to be trained after the training update does not meet the preset iteration end condition, the initial hash code value output by the hash code model to be trained based on the training data is obtained, and based on the initial hash code value and the preset hash code value, the preset polarization loss function corresponding to each polarization output channel of the hash code model to be trained is optimized, and the hash code model to be trained is re-trained and updated until the hash code model to be trained after the training update meets the preset iteration end condition.

[0153] The step of iteratively training the hash coding model to be trained based on the preset target hash value and the training data until the hash coding model to be trained reaches a preset iteration end condition, and obtaining the preset hash coding model includes:

[0154] Step B21, inputting the training data into the hash coding model to be trained, so as to perform hash coding on the training data based on the preset polarization loss function to obtain an initial hash coding value;

[0155] In this embodiment, the training data includes at least one training sample, and the initial hash code value includes an initial hash code value corresponding to each training sample.

[0156] The training data is input into the hash coding model to be trained, and the training data is hash-coded based on the preset polarization loss function to obtain an initial hash coding value. Specifically, the training matrix to be processed corresponding to the training sample is input into the hash coding model to be trained, wherein the training matrix to be processed is a matrix representation of the training sample, and then the training matrix to be processed is hashed to obtain a training hash vector, and then based on the preset polarization loss function, each bit of the training hash vector is forced to be polarized to obtain a training polarization vector corresponding to the training hash vector, and then based on the polarization identifier corresponding to each bit in the training polarization vector, the initial hash coding value corresponding to the training sample is generated, wherein the preset polarization loss function is as follows,

[0157] L(v, t^c) = max(mv*t^c, 0)

[0158] Among them, L is the preset polarization loss function, m is the preset forced polarization parameter, v is the value of each hash vector bit in the training hash vector, and the absolute value of v is greater than m, t^c is the target hash value corresponding to the hash vector bit, the target hash value is the bit value of the preset hash code value corresponding to the training sample, and t^c={-1,+1}, and the preset polarization loss function converges to 0. For example, assuming that m is 1, t^c is 1, and v is -1, then L=2. If the preset polarization loss function is to converge to 0, v needs to be forced to polarize so that v is 1. At this time, L=0. Then when t^c is equal to 1, the training hash vector is The value on the special bit will gradually move away from 0 in the positive direction. When t^c is equal to -1, the value on the bit of the training hash vector will gradually move away from 0 in the negative direction. After the polarization is successful, the polarization identifier of each bit in the obtained training polarization vector should be consistent with the corresponding target hash value. Furthermore, since the preset hash code values ​​of the same training sample category are the same, the polarization identifiers on each bit in the training polarization vector corresponding to the training samples belonging to the same training sample category are consistent, and then based on the polarization identifiers, the obtained model output values ​​are consistent, that is, for model input samples belonging to the same sample category, the same hash code value can be obtained based on the trained preset hash code model.

[0159] In addition, it should be noted that each bit in the training hash vector corresponds to a polarization output channel in the hash coding model to be trained, and the preset forced polarization parameters corresponding to each polarization output channel are obtained by training and optimizing the hash coding model, and thus the preset forced polarization parameters corresponding to each polarization output channel may be the same or different, wherein the polarization output channel is used to force the polarization of the value on the corresponding bit in the training hash vector based on the preset forced polarization parameter through the corresponding preset polarization loss function, and output the encoded value of the corresponding bit in the initial hash coding value.

[0160] Step A22, calculating a training Hamming distance between the initial hash code value and the preset hash code value, and comparing the training Hamming distance with a preset Hamming distance threshold;

[0161] In this embodiment, a training Hamming distance between the initial hash code value and the preset hash code value is calculated, and the training Hamming distance is compared with a preset Hamming distance threshold. Specifically, the value on each bit of the initial hash code value is compared with the value on each bit of the preset hash code value, the number of bits whose bit values ​​are different between the initial hash code value and the preset hash code value is determined, and the number of bits is used as the training Hamming distance, and the training Hamming distance is compared with the preset Hamming distance threshold. For example, assuming that the initial hash code value is a vector (1, 1, 1, 1), and the target hash code result is a vector (-1, 1, 1, -1), the number of bits is 2, and the training Hamming distance is 2.

[0162] Step A23: if the training Hamming distance is greater than the preset Hamming distance threshold, it is determined that the hash layer to be trained has not reached the preset iteration end condition, and the preset polarization loss function is optimized based on the initial hash code value;

[0163] In this embodiment, if the training Hamming distance is greater than the preset Hamming distance threshold, it is determined that the hash layer to be trained has not reached the preset iteration end condition, and the preset polarization loss function is optimized based on the initial hash code value. Specifically, if the training Hamming distance is greater than the preset Hamming distance threshold, it is determined that the preset polarization loss function has not converged on all the polarization output channels, that is, the preset polarization loss function has not converged, and then it is determined that the hash coding model to be trained has not reached the preset iteration end condition, and then the initial hash code value and the preset hash code are determined. One or more different bits between the values, and determining the unconverged polarization output channels corresponding to the different bits, and then adjusting the preset forced polarization parameters in the preset polarization loss function corresponding to the unconverged polarization output channels, wherein the unconverged polarization output channel is a polarization output channel corresponding to the unconverged preset polarization loss function, wherein the hash coding model to be trained includes at least one polarization output channel, and the number of the polarization output channels is related to the number of bits in the training hash vector, that is, one bit in the training hash vector corresponds to one polarization output channel.

[0164] Step A24, retraining the hash coding model to be trained based on the optimized preset polarization loss function until the training Hamming distance is less than or equal to the preset Hamming distance threshold;

[0165] In this embodiment, based on the optimized preset polarization loss function, the to-be-trained hash coding model is re-trained until the training Hamming distance is less than or equal to the preset Hamming distance threshold. Specifically, the training data is re-acquired, and based on the re-acquired training data, the to-be-trained hash coding model corresponding to the optimized preset polarization loss function is re-iterated to continue optimizing the preset polarization loss function until the training Hamming distance is less than or equal to the preset Hamming distance threshold.

[0166] Step A25: If the training Hamming distance is less than or equal to the preset Hamming distance threshold, it is determined that the hash coding model to be trained meets the preset iteration end condition, and the hash coding model to be trained is used as the preset hash coding model.

[0167] In this embodiment, if the training Hamming distance is less than or equal to the preset Hamming distance threshold, it is determined that the hash coding model to be trained has reached the preset iteration end condition, and the hash coding model to be trained is used as the preset hash coding model. Specifically, if the training Hamming distance is less than or equal to the preset Hamming distance threshold, it is determined that the hash coding model to be trained has reached the preset iteration end condition, that is, the preset polarization loss function corresponding to each polarization output channel in the hash coding model to be trained converges, and then the hash coding model to be trained is used as the preset hash coding model.

[0168] In addition, it should be noted that the current hash coding method based on deep learning usually uses pairwise similarity labels as training targets, and constraints need to be added during training, which leads to more parameters that need to be optimized when training the preset hash coding model. In this embodiment, when training the preset hash coding model, it is only necessary to optimize the preset hash coding model based on a simple polarization loss function, thereby avoiding the situation where pairwise similarity labels are used as training targets and constraints need to be added during training to train the preset hash coding model, thereby significantly improving the efficiency of building the preset hash coding model.

[0169] Step S12, obtaining a preset hash code value corresponding to each of the sample categories, and determining a classification association strength result corresponding to each of the target feature dimensions based on each of the output hash code values ​​and each of the preset hash code values;

[0170] In this embodiment, it should be noted that there is a preset hash coding value corresponding to one sample category, wherein the preset hash coding value is a hash coding value pre-generated based on a preset target hash coding method, and the preset hash coding value is a standard hash result corresponding to each sample category given when training the preset hash coding model, wherein the preset target hash coding method can be any pre-set hash coding method.

[0171] Obtain a preset hash code value corresponding to each of the sample categories, and determine the classification association strength result corresponding to each of the target feature dimensions based on each of the output hash code values ​​and each of the preset hash code values. Specifically, obtain a preset hash code value corresponding to each of the sample categories, and determine the same target hash value and each heterogeneous target hash value corresponding to each sample to be measured in each of the sample categories in each of the preset hash code values, wherein the same target hash value is the preset hash code value corresponding to the sample category of the sample to be measured, and the heterogeneous target hash value is the preset hash code value corresponding to other sample category classifications except the sample category to which the sample to be measured belongs. For example, assuming that the sample categories include sample category A, sample category B, and sample category C, and the preset hash code value corresponding to sample category A is a, the preset hash code value corresponding to sample category B is b, and the preset hash code value corresponding to sample category C is c, then for sample category A, the same target hash value is a, and each of the heterogeneous target hash values ​​is b and c. Further, for each of the sample categories, the following steps are performed:

[0172] Determine the output hash code value corresponding to each sample to be measured in the sample category, and then calculate the first Hamming distance between each output hash code value and the same target hash value, and average the first Hamming distances to obtain the first target Hamming distance. Further, respectively calculate the second Hamming distance between each output hash code value corresponding to the sample category and each heterogeneous target hash value, wherein there is a second Hamming distance between each hash code value and each heterogeneous target hash value, and then average the second Hamming distances corresponding to each heterogeneous target hash value to obtain the second target Hamming distance corresponding to each heterogeneous target hash value, and then convert the first target Hamming distance and the second target Hamming distance into a classification association strength representation vector. For example, assuming that the classification association strength representation vector is D(k, c), k is a bit, the bit is the first target Hamming distance and the second target Hamming distance, and c indicates that the sample category corresponding to each output hash code value is the cth category. Further, after obtaining each classification association strength representation vector, perform the following steps:

[0173] Based on each of the classification association strength representation vectors, a classification association strength matrix corresponding to each of the sample sets is generated, and the classification association strength matrix is ​​used as the classification association strength result. For example, each of the classification association strength representation vectors is used as a column or a row of the classification association strength matrix to generate the classification association strength matrix, etc.

[0174] In addition, in order to eliminate random errors, the sample set corresponding to each target feature dimension is reacquired, and based on each of the sample sets, the above steps S11 to S12 are repeated a preset number of times to obtain multiple classification association strength results, and the classification association strength results are averaged to obtain the target classification association strength result, and the target classification association strength result is normalized to obtain the feature importance result.

[0175] The classification association strength result includes at least one association strength value, one target feature dimension corresponds to one association strength value,

[0176] The step of determining the classification association strength result corresponding to each of the target feature dimensions based on each of the output hash code values ​​and each of the preset hash code values ​​comprises:

[0177] Step S121, determining the same type target hash value and the different type target hash value corresponding to each sample category in each of the preset hash code values, and determining the hash code value corresponding to each sample category in each of the output hash code values;

[0178] In this embodiment, it should be noted that the homogeneous target hash value is a preset hash code value corresponding to the sample category of the sample to be measured, and the heterogeneous target hash value is a preset hash code value corresponding to other sample category classifications except the sample category to which the sample to be measured belongs, and the sample category includes at least one sample to be measured, wherein one sample to be measured corresponds to one output hash code value.

[0179] Step S122, based on the hash code values ​​corresponding to the sample categories, the same type target hash values ​​and the different type target hash values, the association strength values ​​corresponding to the target feature dimensions are calculated.

[0180] In this embodiment, it should be noted that the association strength value can be represented by a classification association strength representation vector. For example, assuming that the vector corresponding to the association strength value is D(k, c), k is the numerical value of the association strength value, and c is the identifier of the sample category corresponding to the association strength value.

[0181] Based on the hash code values, the same target hash values, and the different target hash values ​​corresponding to the sample categories, the association strength values ​​corresponding to the target feature dimensions are calculated. Specifically, the following steps are performed for each sample category:

[0182] Calculate the first Hamming distance between the hash code value corresponding to each of the samples to be measured in the sample category and the same target hash value, and average the first Hamming distances to obtain the first target Hamming distance. Further, calculate the second Hamming distance between each of the hash code values ​​and each of the heterogeneous target hash values, and average the second Hamming distances corresponding to each of the heterogeneous target hash values ​​to obtain the second target Hamming distance corresponding to each of the heterogeneous target hash values. Convert the first target Hamming distance, the second target Hamming distances and the sample category identifier corresponding to the sample category into a classification association strength representation vector. For example, assuming that the first target Hamming distance is a, the second target Hamming distances are b, m, and n respectively, and the sample category identifier is c, then the classification association strength representation vector is (a, b, m, n, c).

[0183] Step S13, determining the feature importance values ​​corresponding to the target feature dimensions respectively according to the association strength values ​​in the classification association strength result.

[0184] In this embodiment, it should be noted that the classification association strength result is a classification association strength matrix composed of the classification association strength representation vectors. For example, assuming that the classification association strength representation vectors are D(k1, c1), D(k2, c1) and D(k3, c3), respectively, the classification association strength matrix is ​​{D(k1, c1), D(k2, c1), D(k3, c3)}.

[0185] According to each association strength value in the classification association strength result, determine the feature importance value corresponding to each target feature dimension respectively. Specifically, based on the preset transformation function, the classification association strength result is normalized to map the first association strength representation value and the second association strength representation value in each classification association strength representation vector to a preset value range, wherein the preset value range includes an upper threshold value and a lower threshold value, and the feature importance value is in the preset value range. It should be noted that for the first association strength representation value, the closer the feature importance value corresponding to the first association strength representation value is to the upper threshold value, the higher the importance of the feature corresponding to the sample category corresponding to the first association strength representation value is, and for the second association strength representation value, the closer the feature importance value corresponding to the second association strength representation value is to the lower threshold value, the higher the importance of the feature corresponding to the sample category corresponding to the second association strength representation value is. Further, the feature importance result is obtained, wherein the preset transformation function is a function for mapping the association strength value to the preset value range, wherein the preset transformation function is as follows:

[0186] The preset transformation function may be one of the following functions:

[0187] 1. a_kc=1.0-~D_n(k,c)

[0188] 2. a_kc=exp(-~D_n(k,c)), where ~D_n(k,c)=(~D_n(k,c)-Dmin) / (Dmax-Dmin)

[0189] Among them, A=[a_kc, ...] is the feature importance representation matrix corresponding to each of the feature importance values, and the feature importance representation matrix is ​​a K*C matrix, and its numerical value represents the degree of fit between K bits and C sample categories, that is, the importance of the features corresponding to the K bits to the deep polarization network, wherein each of the bits has a feature importance value corresponding to the first association strength representation value and a feature importance value corresponding to the second association strength representation value, ~D_n(k, c) is the classification association strength representation vector, a_kc is the classification association strength representation vector after normalization, Dmax is the classification association strength representation vector with the longest length, Dmin is the classification association strength representation vector with the shortest length, and the value range of A is the preset value range, wherein the value range of A is [0.0, 1.0].

[0190] This embodiment inputs the sample sets corresponding to each of the sample categories into a preset hash coding model to obtain output hash coding values ​​corresponding to each of the sample categories, and then obtains preset hash coding values ​​corresponding to each of the sample categories, and based on each of the output hash coding values ​​and each of the preset hash coding values, determines the classification association strength results corresponding to each of the target feature dimensions, and then determines the feature importance values ​​corresponding to each of the target feature dimensions according to each association strength value in the classification association strength results. That is, after determining the sample categories corresponding to each of the target feature dimensions, the present application can determine the classification association strength results corresponding to each of the target feature dimensions based on the output hash code value and the preset hash code value corresponding to each of the sample categories, and then determine the feature importance values ​​corresponding to each of the target feature dimensions according to the classification association strength values, wherein the feature importance values ​​represent the contribution of the target feature dimensions to the model, thereby achieving the purpose of quantitatively measuring the importance of each of the target feature dimensions by calculating the feature importance values, and then compared with the current model interpretation method, by calculating the feature importance values, the degree of importance of each feature dimension to the model can be accurately and meticulously measured, thereby improving the accuracy of the feature importance measurement, thereby making the model interpretation more intuitive and accurate, and improving the model interpretation effect, thereby solving the technical problem of poor model interpretation effect.

[0191] Reference Figure 6 , Figure 6 It is a schematic diagram of the device structure of the hardware operating environment involved in the embodiment of the present application.

[0192] like Figure 6 As shown, the feature importance visualization device may include: a processor 1001, such as a CPU, a memory 1005, and a communication bus 1002. The communication bus 1002 is used to realize the connection and communication between the processor 1001 and the memory 1005. 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.

[0193] Optionally, the feature importance visualization device may also include a rectangular user interface, a network interface, a camera, an RF (Radio Frequency) circuit, a sensor, an audio circuit, a WiFi module, etc. The rectangular user interface may include a display screen (Display), an input submodule such as a keyboard (Keyboard), and the optional rectangular user interface may also include a standard wired interface and a wireless interface. The network interface may optionally include a standard wired interface and a wireless interface (such as a WI-FI interface).

[0194] Those skilled in the art will understand that Figure 6 The feature importance visualization device structure shown in the figure does not constitute a limitation of the feature importance visualization device, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.

[0195] like Figure 6 As shown, the memory 1005 as a computer storage medium may include an operating system, a network communication module, and a feature importance visualization program. The operating system is a program that manages and controls the hardware and software resources of the feature importance visualization device, and supports the operation of the feature importance visualization program and other software and / or programs. The network communication module is used to realize the communication between the components inside the memory 1005, and the communication with other hardware and software in the feature importance visualization system.

[0196] exist Figure 6 In the feature importance visualization device shown, the processor 1001 is used to execute the feature importance visualization program stored in the memory 1005 to implement the steps of any of the feature importance visualization methods described above.

[0197] The specific implementation of the feature importance visualization device of the present application is basically the same as the embodiments of the above-mentioned feature importance visualization method, and will not be repeated here.

[0198] The embodiment of the present application further provides a feature importance visualization device, which is applied to a feature importance visualization device, and the feature importance visualization device includes:

[0199] A first determination module is used to obtain each target feature dimension and a sample category corresponding to each target feature dimension, and determine a feature importance value corresponding to each target feature dimension based on a preset hash coding model and a preset hash coding value corresponding to each sample category;

[0200] A second determination module is used to determine the target bit position corresponding to each of the target feature dimensions based on the feature importance values;

[0201] A generation module is used to generate visual feature importance data based on each of the feature importance values, each of the target bits and each of the sample categories.

[0202] Optionally, the generating module includes:

[0203] A first connection submodule is used to generate a bit node corresponding to each of the target bits and a category node corresponding to each of the target sample categories, and connect the bit node and the category node corresponding to each of the matching degrees to obtain a first initial connection strength graph;

[0204] An acquisition submodule, used for acquiring bit consistency results between each pair of the bit nodes and category consistency results between each pair of the category nodes;

[0205] A second connection submodule, configured to connect each of the bit nodes in the first initial connection strength graph based on each of the bit consistency results, and to connect each of the category nodes based on each of the category consistency results, to obtain a second initial connection strength graph;

[0206] A clustering submodule is used to cluster each of the bit nodes and each of the category nodes in the second initial connection strength graph to obtain the target connection strength graph.

[0207] Optionally, the acquisition submodule includes:

[0208] A first calculation unit, used to determine the feature importance vector corresponding to each of the bit nodes, and calculate the cosine value of the angle between each of the feature importance vectors;

[0209] The first determination unit is used to determine the bit consistency result between each of the bit nodes based on the cosine value of each of the angles.

[0210] Optionally, the clustering submodule includes:

[0211] An acquiring unit, used for acquiring a bit correlation value between each of the bit nodes and a category correlation value between each of the category nodes;

[0212] A clustering unit, configured to cluster the bit nodes based on the bit relevance values ​​to obtain a first clustering result, and cluster the category nodes based on the category relevance values ​​to obtain a second clustering result;

[0213] A generating unit is used to generate the target connection strength graph based on the first clustering result and the second clustering result.

[0214] Optionally, the clustering unit includes:

[0215] A first determining subunit, configured to compare each of the bit relevance values ​​with a preset bit relevance threshold, and determine each first target relevance value among the bit relevance values ​​that is greater than or equal to the preset bit relevance threshold;

[0216] A first clustering subunit, used for clustering adjacent bit nodes corresponding to each of the first target relevance values, respectively, to obtain each of the clustered bit nodes;

[0217] A second determining subunit is used to compare each of the category relevance values ​​with a preset category relevance threshold, and determine each second target relevance value among the category relevance values ​​that is greater than or equal to the preset category relevance threshold;

[0218] The second clustering subunit is used to cluster adjacent category nodes corresponding to the second target relevance value respectively to obtain each of the cluster category nodes.

[0219] Optionally, the first determining module includes:

[0220] A hash coding submodule, used to input the sample sets corresponding to the sample categories into a preset hash coding model to obtain output hash coding values ​​corresponding to the sample categories;

[0221] A first determination submodule is used to obtain a preset hash code value corresponding to each of the sample categories, and determine a classification association strength result corresponding to each of the target feature dimensions based on each of the output hash code values ​​and each of the preset hash code values;

[0222] The second determination submodule is used to determine the feature importance values ​​corresponding to each of the target feature dimensions according to each association strength value in the classification association strength result.

[0223] Optionally, the first determining submodule includes:

[0224] A second determining unit is used to determine the same type target hash value and the different type target hash value corresponding to each sample category in each of the preset hash code values, and determine the hash code value corresponding to each sample category in each of the output hash code values;

[0225] The second calculation unit is used to calculate the association strength value corresponding to each of the target feature dimensions based on the hash code values, the same type target hash values ​​and the different type target hash values ​​respectively corresponding to each of the sample categories.

[0226] Optionally, the feature importance visualization device further includes:

[0227] The encoding module is used to obtain the training data and the hash model to be trained, and generate a target hash encoding result corresponding to the training data based on a preset target hash encoding method;

[0228] Iterative training is used to iteratively train the hash coding model to be trained based on the preset hash coding value and the training data to optimize the preset polarization loss function corresponding to the hash coding model to be trained until the hash coding model to be trained reaches a preset iteration end condition, thereby obtaining the preset hash coding model.

[0229] The specific implementation of the feature importance visualization device of the present application is basically the same as the embodiments of the feature importance visualization method described above, and will not be repeated here.

[0230] An embodiment of the present application provides a readable storage medium, and the readable storage medium stores one or more programs, and the one or more programs can also be executed by one or more processors to implement the steps of any of the feature importance visualization methods described above.

[0231] The specific implementation of the readable storage medium of the present application is basically the same as the embodiments of the above-mentioned feature importance visualization method, and will not be repeated here.

[0232] The above are only preferred embodiments of the present application, and are not intended to limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent processing scope of the present application.

Claims

1. A feature importance visualization method, characterized in that: The feature importance visualization method includes: Obtain each target feature dimension and the sample category corresponding to each target feature dimension, and input the sample set corresponding to each sample category into a preset hash coding model to obtain the output hash coding value corresponding to each sample category; Obtaining a preset hash code value corresponding to each of the sample categories, and determining a classification association strength result corresponding to each of the target feature dimensions based on each of the output hash code values ​​and each of the preset hash code values; Determining, according to each association strength value in the classification association strength result, feature importance values ​​corresponding to each of the target feature dimensions; Based on the importance values ​​of the features, determining the target bits corresponding to the target feature dimensions; Based on the feature importance values, the target bits and the sample categories, visual feature importance data is generated.

2. The feature importance visualization method according to claim 1, characterized in that: The visual feature importance data includes a target connection strength graph, and the feature importance value includes each degree of fit between the target bit and each sample category, wherein there is a degree of fit between a target bit and a sample category, The step of generating visualized feature importance data based on each feature importance value, each target bit and each sample category comprises: Generate a bit node corresponding to each target bit and a category node corresponding to each target sample category, and connect the bit node and the category node corresponding to each degree of fit to obtain a first initial connection strength graph; Obtaining bit consistency results between each pair of the bit nodes and category consistency results between each pair of the category nodes; Based on the bit consistency results, each of the bit nodes is connected in the first initial connection strength graph, and based on the category consistency results, each of the category nodes is connected to obtain a second initial connection strength graph; In the second initial connection strength graph, each of the bit nodes and each of the category nodes are clustered respectively to obtain the target connection strength graph.

3. The feature importance visualization method according to claim 2, characterized in that: The feature importance vector corresponding to the feature importance value, The step of obtaining the bit consistency results between each pair of the bit nodes comprises: Determine the feature importance vector corresponding to each of the bit nodes, and calculate the cosine value of the angle between each of the feature importance vectors; Based on the cosine values ​​of the angles, a bit consistency result between the bit nodes is determined.

4. The feature importance visualization method according to claim 2, characterized in that: The step of clustering the bit nodes and the category nodes respectively to obtain the target connection strength graph comprises: Obtaining a bit correlation value between each of the bit nodes and a category correlation value between each of the category nodes; Based on the bit relevance values, clustering the bit nodes to obtain a first clustering result, and based on the category relevance values, clustering the category nodes to obtain a second clustering result; The target connection strength graph is generated based on the first clustering result and the second clustering result.

5. The feature importance visualization method according to claim 4, characterized in that: The first clustering result includes one or more clustering bit nodes corresponding to each of the bit nodes, and the second clustering result includes one or more clustering category nodes corresponding to each of the category nodes. The step of clustering the bit nodes based on the bit relevance values ​​to obtain a first clustering result, and clustering the category nodes based on the category relevance values ​​to obtain a second clustering result comprises: Comparing each of the bit relevance values ​​with a preset bit relevance threshold, respectively, to determine each first target relevance value among the bit relevance values ​​that is greater than or equal to the preset bit relevance threshold; Clustering adjacent bit nodes corresponding to each of the first target relevance values ​​respectively to obtain each of the clustered bit nodes; Comparing each of the category relevance values ​​with a preset category relevance threshold, respectively, to determine each second target relevance value among the category relevance values ​​that is greater than or equal to the preset category relevance threshold; Adjacent category nodes corresponding to the second target relevance value are clustered respectively to obtain the cluster category nodes.

6. The feature importance visualization method according to claim 1, characterized in that: The classification association strength result includes at least one association strength value, one target feature dimension corresponds to one association strength value, The step of determining the classification association strength result corresponding to each of the target feature dimensions based on each of the output hash code values ​​and each of the preset hash code values ​​comprises: Determine the same type target hash value and the different type target hash value corresponding to each sample category in each of the preset hash code values, and determine the hash code value corresponding to each sample category in each of the output hash code values; Based on the hash code values, the same type target hash values ​​and the different type target hash values ​​respectively corresponding to the sample categories, the association strength values ​​corresponding to the target feature dimensions are calculated.

7. The feature importance visualization method according to claim 1, characterized in that: Before the step of inputting the sample sets corresponding to the sample categories into a preset hash coding model to obtain the output hash coding values ​​corresponding to the sample categories, the feature importance visualization method includes: Obtain training data and a hash model to be trained, and generate a target hash coding result corresponding to the training data based on a preset target hash coding method; Based on the preset hash code value and the training data, the hash code model to be trained is iteratively trained to optimize a preset polarization loss function corresponding to the hash code model to be trained, until the hash code model to be trained reaches a preset iteration end condition, thereby obtaining the preset hash code model.

8. A feature importance visualization device, characterized in that: The feature importance visualization device includes: a memory, a processor, and a program stored in the memory for implementing the feature importance visualization method. The memory is used to store a program for implementing a feature importance visualization method; The processor is used to execute a program for implementing the feature importance visualization method to implement the steps of the feature importance visualization method as claimed in any one of claims 1 to 7.

9. A readable storage medium, characterized in that: The readable storage medium stores a program for implementing a feature importance visualization method, and the program for implementing a feature importance visualization method is executed by a processor to implement the steps of the feature importance visualization method according to any one of claims 1 to 7.