Feature selection method, device and readable storage medium
By creating a feature network and using the differential evolution algorithm to group and filter data features, the problems of long feature selection time and low accuracy in existing technologies are solved, and a more efficient feature selection process is achieved.
Patent Information
- Application Number
- CN202111179187.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-10-09
- Publication Date
- 2026-02-13
- Estimated Expiration
- 2041-10-09
AI Technical Summary
Existing wrapper-style feature selection methods suffer from long screening times and low accuracy when filtering data features, especially due to the failure to effectively mine and utilize the potential information in the data feature space.
By acquiring multiple data features of the target business data in different dimensions, a feature network is created, and the features are grouped according to the degree of aggregation in the feature network. The differential evolution algorithm is used to filter the data features to obtain a set of data features that characterize the target business data.
It shortens the data feature selection time, improves the selection accuracy, utilizes the potential information in the data feature space, and achieves more efficient feature selection.
Smart Images

Figure CN114004279B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of machine learning, in particular to a feature selection method, device and readable storage medium. BACKGROUND
[0002] At present, in order to avoid the problems of unsatisfactory prediction results and resource waste, it is necessary to select features before model training through features, so as to obtain the most relevant and non-redundant features.
[0003] For the feature selection method, the existing feature selection methods can be divided into the following three categories: filter, embedded and wrapped. Among them, the wrapped feature selection method is to train a certain model according to different data feature subsets, and then select the data feature subset that makes the model best as the feature selection result. Since this method directly uses the prediction model for feature selection, although its time complexity is higher than the former two, its effect is better. Especially with the continuous improvement of computing power, the advantage of the wrapped feature selection method is more and more prominent. It can be understood that the wrapped feature selection method searches for the best subset in the entire feature space as the result of feature selection.
[0004] However, if the brute force search method (i.e. testing each data feature subset) is used, the time complexity will increase exponentially with the increase of the number of features. Therefore, the existing wrapped feature selection method usually uses heuristic methods to complete the search of the feature space, and the evolutionary algorithm as an excellent heuristic search method is widely used in the wrapped feature selection method.
[0005] However, the current wrapped feature selection method directly uses a certain evolutionary algorithm as a search method, which does not exploit and utilize the potential information of the data feature space, making the search process of the data feature subset time-consuming and the data feature subset easy to fall into a local optimal solution.
[0006] That is, the existing technology has the problems of long screening time and low screening accuracy when screening data features. SUMMARY
[0007] The main purpose of the present application is to provide a feature selection method, device and readable storage medium, which aims to solve the technical problems of how to shorten the screening time and improve the screening accuracy when screening data features.
[0008] To achieve the above purpose, the present application provides a feature selection method, which comprises the following steps:
[0009] obtaining a plurality of data features of target business data in different dimensions;
[0010] create a feature network corresponding to the target business data according to the plurality of data features and the correlations between the plurality of data features;
[0011] group the plurality of data features according to the aggregation degrees of the plurality of data features in the feature network, to obtain a plurality of data feature groups;
[0012] filter the plurality of data features by using a differential evolution algorithm corresponding to the feature network and the plurality of data feature groups, to obtain a plurality of target data features, the plurality of target data features being a data feature set for representing characteristics of the target business data.
[0013] Optionally, the creating of the feature network corresponding to the target business data according to the plurality of data features and the correlations between the plurality of data features comprises:
[0014] traversing a data feature pair composed of each two data features in the plurality of data features;
[0015] calculating a feature correlation coefficient of the data feature pair;
[0016] if an absolute value of the feature correlation coefficient is greater than a preset correlation coefficient threshold, establishing a connection relationship between the data feature pair, obtaining a data feature edge, and a weight value of the data feature edge being the absolute value of the feature correlation coefficient;
[0017] after the traversal ends, creating the feature network corresponding to the target business data based on the plurality of data features and the data feature edge.
[0018] Optionally, a connection tightness between data features in a data feature group is greater than a connection tightness between data features in different data feature groups.
[0019] Optionally, the filtering of the plurality of data features by using the differential evolution algorithm corresponding to the feature network and the plurality of data feature groups to obtain the plurality of target data features comprises:
[0020] generating an initial population, wherein the initial population is composed of a preset number of initial individuals, wherein the initial individual is a vector with a dimension of a number of the plurality of data features, each element in the vector corresponds to a data feature, and a numerical value of the element includes a random number in a preset numerical range in the target business data;
[0021] performing iterative updating on the initial population for a preset number of iterations based on a preset machine learning model, the feature network, and the plurality of data feature groups, to obtain a target individual.
[0022] determining a plurality of target data features based on the target individual.
[0023] Optionally, at each iteration update, the method further comprises:
[0024] mutating each of the initial individuals to obtain mutated individuals;
[0025] normalizing the mutated individuals based on a preset normalization method to obtain normalized individuals;
[0026] calculating a crossover probability based on the feature network and the plurality of data feature groups;
[0027] crossover processing the initial individuals and the normalized individuals based on the crossover probability to obtain crossed individuals;
[0028] determining an iterated individual based on the crossed individuals and the initial individuals, wherein the iterated individual is used to determine a target individual.
[0029] Optionally, the calculating a crossover probability based on the feature network and the plurality of data feature groups comprises:
[0030] randomly traversing elements of the initial individuals, and obtaining a pair of target data features and a pair of to-be-crossed data features corresponding to the elements;
[0031] determining a weight value of a data feature edge between the pair of target data features to obtain a first weight value;
[0032] obtaining first other data features in the pair of target data features except the to-be-crossed data features, determining a number of the first other data features in which element values corresponding to the first other data features are greater than a preset value to obtain a second weight value;
[0033] determining second other data features in a data feature group in which the to-be-crossed data features are located except the to-be-crossed data features, determining a number of the second other data features in which element values corresponding to the second other data features are greater than the preset value to obtain a third weight value;
[0034] calculating a crossover probability based on the first weight value, the second weight value, and the third weight value.
[0035] Optionally, the determining an iterated individual based on the crossed individuals and the initial individuals comprises:
[0036] Based on the fitness function corresponding to the preset machine learning model, the fitness values corresponding to the initial individual and the individual after the crossover are respectively calculated, and the initial individual or the individual after the crossover corresponding to the maximum fitness value is taken as the individual after the iteration.
[0037] Optionally, after the plurality of target data features are obtained by screening the plurality of data features by using the differential evolution algorithm corresponding to the feature network and the plurality of data feature groups, the method further comprises:
[0038] Target sub-business data corresponding to the plurality of target data features in the target business data is obtained.
[0039] A preset predictor is trained based on the target sub-business data to obtain a prediction model, so as to predict to-be-predicted business data by using the prediction model.
[0040] In addition, to achieve the above object, the present application further provides a feature selection device, which comprises a memory, a processor, and a feature selection program stored in the memory and executable on the processor, and the feature selection program implements the steps of the feature selection method when executed by the processor.
[0041] In addition, to achieve the above object, the present application further provides a computer readable storage medium, which stores a feature selection program, and the feature selection program implements the steps of the feature selection method when executed by a processor.
[0042] Compared with the prior art in which a certain evolution algorithm is directly used as a search method to perform feature screening, resulting in long screening time and low screening accuracy when screening data features, the present application obtains a plurality of data features in different dimensions of target business data, creates a feature network corresponding to the target business data according to the plurality of data features and the relevance between the plurality of data features, groups the plurality of data features according to the aggregation degree of the plurality of data features in the feature network to obtain a plurality of data feature groups, and screens the plurality of data features by using a differential evolution algorithm corresponding to the feature network and the plurality of data feature groups to obtain a plurality of target data features, which are a data feature set used to represent the characteristics of the target business data. The present application realizes grouping of the plurality of data features by using the aggregation degree of the plurality of data features in the feature network, which mines the potential information of the data feature space, and screens the plurality of data feature groups by using the differential evolution algorithm, which utilizes the potential information of the data feature space, thereby shortening the screening time when screening the data features and improving the screening accuracy when screening the data features. BRIEF DESCRIPTION OF DRAWINGS
[0043] Figure 1 is a flowchart of a first embodiment of the feature selection method of the present application;
[0044] Figure 2 is a schematic diagram of a data feature group involved in the embodiment of the present application;
[0045] Figure 3 is a schematic diagram of an example of the feature selection process involved in the embodiment of the present application;
[0046] Figure 4 is a structural schematic diagram of a hardware running environment involved in the embodiment of the present application.
[0047] The implementation, functional features and advantages of the present application will be further described with reference to the embodiments and the accompanying drawings. DETAILED DESCRIPTION
[0048] It should be understood that the specific embodiments described herein are merely intended to explain the present application and not to limit the present application.
[0049] The present application provides a feature selection method, with reference to Figure 1 , Figure 1 is a flowchart of a first embodiment of the feature selection method of the present application.
[0050] The embodiments of the feature selection method are provided in the present application, and it should be noted that although the logical order is shown in the flowchart, in some cases, the steps shown or described herein can be performed in an order different from that described herein. The feature selection method can be applied in a terminal and / or a server. In order to facilitate the description, the following omits the description of the execution subject of each step of the feature selection method. The feature selection method comprises:
[0051] In step S10, a plurality of data features of target service data in different dimensions are obtained.
[0052] In the present embodiment, the target service data comprises a plurality of dimensions, each dimension corresponding to a different data feature. The target service data comprises data composed of card information and historical consumption records of a credit card, and also comprises data corresponding to scenarios such as cancer diagnosis in the medical field, weather prediction in the meteorological field and congestion prediction in the traffic field.
[0053] For data features, taking credit card data composed of card information and historical consumption records as an example, the credit card data is used for credit card default prediction, which refers to predicting whether a credit card will default in the future period of time by using card information and historical consumption record information of the credit card. The card information includes card type number, card brand, etc.; the historical consumption record includes consumption frequency in the last 1 month, consumption frequency in the last 3 months, consumption frequency in the last 6 months, consumption amount in the last 1 month, consumption amount in the last 3 months, consumption amount in the last 6 months, and the number of days from the last transaction to the application date, etc. The bank can obtain the credit card data T by recording and collecting relevant information of all credit cards under its own brand. Assuming that d pieces of information of n credit cards have been collected, each piece of information of the credit card (including card type number, consumption frequency in the last 3 months, and consumption frequency in the last 6 months, etc.) is regarded as a data feature, then T = {(x1, y1), (x2, y2), …, (x n , y n )}, where is a d-dimensional data feature vector composed of values of the credit card i on d data features (i.e., d pieces of information), y i ∈{0, 1} is the label of the credit card i, 0 represents non-default, and 1 represents default.
[0054] Referring to Table 1, Table 1 is a specific credit card data T instance (due to limited space, only part of the samples and part of the data features are listed in the table). The credit card data T records 87 data features (i.e., n = 5450, d = 87) of 5450 credit cards, each row corresponds to a credit card (usually referred to as a sample), except that the first column represents the sample name and the last column represents the label, each column corresponds to a data feature, for example, data feature f2, data feature f9, and data feature f15, etc. The information represented by the listed data features is shown in Table 2, wherein the data feature values of all data features related to card information have been desensitized.
[0055] f2 f9 f15 f37 f38 f39 f40 f41 f42 … y x1 1 0 14 3 15 7 117.8 520.7 1448.1 … 1 x2 1 0 5 5 11 8 13791.09 26173.27 33864.36 … 1 x3 1 0 5 0 6 2 0 14149.28 29289.28 … 1 x4 1 AA 38 1 5 2 18.5 215.5 633.5 … 1 … … … … … … … … … … … … x 5447 ]]> 1 0 2 5 21 13 11553 25113.6 35522.3 … 0 x 5448 ]]> 1 0 29 1 12 7 17101 72420.05 102807.5 … 0 x 5449 ]]> 1 0 8 3 7 5 6240.26 9420.03 12530.68 … 0 x 5450 ]]> 1 0 29 2 10 5 2690 3190 4066 … 0
[0056] Table 1
[0057] Data characteristics Information meaning f2 Number of card types f9 Card brand f15 Days from the last transaction to the application date f37 Consumption times in the last 1 month f38 Consumption times in the last 6 months f39 Consumption times in the last 3 months f40 Consumption amount in the last 1 month f41 Consumption amount in the last 6 months f42 Consumption amount in the last 3 months … …
[0058] Table 2
[0059] Step S20, creating a feature network corresponding to the target business data according to the plurality of data features and the association between the plurality of data features.
[0060] Further, the creating a feature network corresponding to the target business data according to the plurality of data features and the association between the plurality of data features comprises:
[0061] Step a, traversing data feature pairs composed of each two data features in the plurality of data features.
[0062] In the embodiment, data feature pairs are traversed, wherein each data feature pair is composed of two data features. Specifically, the traversal process first needs to ensure that each data feature pair corresponding to each two data features needs to be traversed, that is, there is no omission of data features. It can be understood that the traversal process is a combination process in permutation and combination. For example, there are data feature A, data feature B and data feature C in the plurality of data features, and the data feature pairs obtained by combining data feature A, data feature B and data feature C include (data feature A, data feature B), (data feature B, data feature C) and (data feature A, data feature C).
[0063] Step b, calculating a feature correlation coefficient of the data feature pair.
[0064] In the embodiment, referring to Table 1, after removing the feature names in the first row, the sample names in the first column and the labels in the last column in the table, it can be regarded as an nxd matrix X, that is, the matrix X is composed of data in n data features of d samples. In the matrix X, each column represents a data feature in the global sample, and each row represents the data feature value of all data features contained in each sample. The feature correlation coefficient is calculated through the data feature pair, wherein the feature correlation coefficient can be a Pearson correlation coefficient, a Spearman correlation coefficient or a cosine similarity.
[0065] Wherein, the Pearson correlation coefficient pc(j, k) is calculated by the following formula:
[0066]
[0067] Wherein, the Spearman correlation coefficient rc(j, k) is calculated by the following formula:
[0068]
[0069] Wherein, the cosine similarity cc(j, k) is calculated by the following formula:
[0070]
[0071] In the above three calculation formulas, X i,j represents the element of the i-th row and the j-th column of the matrix X; X *,j and X *,k respectively represent the j-th and k-th columns of the matrix X, (1≤i, j, k≤n); is the average value of all elements in X *,j , that is, the average value of all elements in the j-th column of the matrix X; rij is X i,j in X *,j the average rating of all elements in X. is X *,j the average rating of all elements in X.
[0072] Step c, if the absolute value of the feature correlation coefficient is greater than a preset correlation coefficient threshold, a connection relationship between the data feature pair is established, and a data feature edge is obtained, wherein the weight of the data feature edge is the absolute value of the feature correlation coefficient.
[0073] In this embodiment, if the absolute value of the feature correlation coefficient is greater than a preset correlation coefficient threshold, the correlation of the data feature pair is high, and the two data features in the data feature pair are connected to obtain a data feature edge, and the weight of the data feature edge is the absolute value of the feature correlation coefficient; if the absolute value of the feature correlation coefficient is less than or equal to the preset correlation coefficient threshold, the correlation of the data feature pair is low, and the two data features in the data feature pair are not connected. The preset correlation coefficient threshold can be set as needed, and the present embodiment is not limited in detail.
[0074] Step d, after the traversal ends, a feature network corresponding to the target business data is created based on the plurality of data features and the data feature edges.
[0075] In this embodiment, after the traversal ends, a network is constructed by connecting data features through one or more data feature edges, and a feature network is obtained. It can be understood that the data feature edge is a connection between data features, and the data feature and the data feature edge together constitute the feature network.
[0076] Step S30, according to the aggregation degree of the plurality of data features in the feature network, the plurality of data features are grouped to obtain a plurality of data feature groups.
[0077] Further, the connection tightness between the data features in the data feature group is greater than the connection tightness between the data features in the data feature group.
[0078] In this embodiment, in the above feature network, the data features with high correlation degree will show an aggregation phenomenon, that is, the highly correlated data features are tightly connected with each other, and the connection with other data features is relatively sparse, and the part of the tight connection corresponds to a data feature group. According to the aggregation degree of the plurality of data features, the plurality of data features in the feature network are divided into a plurality of data feature groups, wherein the data feature group can be composed of one or more data features. For example, referring to Figure 2 , Figure 2For a feature community detected in the aforementioned credit card data T, it can be understood that this feature community consists of data features f40, f41, f39, f63, f64, and f65, as well as data feature edges between each pair of data features. Correspondingly, the data feature group corresponding to this feature community consists of f40, f41, f39, f63, f64, and f65. Dividing multiple data features in the feature network into multiple data feature groups based on the degree of aggregation (connectivity) can be accomplished using a graph clustering algorithm; this embodiment does not specify a particular method. It can be understood that the connectivity is also calculated using a graph clustering algorithm.
[0079] Step S40: The feature network and the differential evolution algorithm corresponding to the multiple data feature groups are used to filter the multiple data features to obtain multiple target data features. The multiple target data features are a set of data features used to characterize the features of the target business data.
[0080] In this embodiment, the differential evolution algorithm is used to select multiple target data features from multiple data feature groups and remove unnecessary data features. The multiple target data features are a set of data features that can characterize the features of the target business data.
[0081] For the differential evolution algorithm, the differential evolution algorithm corresponding to the feature network and the multiple data feature groups is used to filter the multiple data features to obtain multiple target data features, including:
[0082] Step g: Generate an initial population, wherein the initial population consists of a preset number of initial individuals, wherein each initial individual is a vector with a dimension equal to the number of the multiple data features, wherein each element in the vector corresponds to a data feature, and its value is a random number within a preset numerical range.
[0083] Step h: Based on the preset machine learning model, the feature network, and the multiple data feature groups, the initial population is iteratively updated a preset number of times to obtain the target individual;
[0084] Step i: Determine multiple target data features based on the target individual.
[0085] In the embodiment, based on the feature network and the feature group, an initial population corresponding to the target service data is subjected to single-target optimization, wherein the initial population is composed of a preset number of initial individuals, the preset number can be set as required, and the embodiment does not make specific limitation, the initial individual is a vector with a dimension of the number of the plurality of data features, for example, if the number of data features is 5, the vector dimension is also 5; and the element value is a random number in a preset numerical range (for example, [0, 1]). It should be noted that the process of generating the initial individual by the random number is based on individual coding.
[0086] For example, referring to Table 3, which is an individual instance corresponding to the credit card default prediction task, the vector dimension of the individual is 87.
[0087] f1 f2 ... f14 f15 ... f38 f39 f40 f41 ... f64 f65 ... f87 0.1 0.6 ... 0.2 0.8 ... 0.8 0.7 0.05 0.1 ... 0.3 0.4 ... 0.2
[0088] Table 3
[0089] For the initial population, the generation process of the initial population is to randomly generate N initial individuals to form an initial population with a size of N Meanwhile, the data in the target service data is divided into a training set and a test set at a certain ratio, and a preset machine learning model using the target service data is determined, wherein the preset machine learning model is a logistic regression, a Bayesian or a support vector machine, etc., for example, a logistic regression model is used as the machine learning model, and the ratio of the training set and the test set is 7:3, for example, taking the target service data T as an example, 3815 credit cards corresponding to the sample in Table 1 are randomly selected to form the training set of the logistic regression model, and the remaining 1635 credit cards corresponding to the sample form the test set of the logistic regression model. It should be noted that the positive and negative samples in the sample need to be evenly divided.
[0090] It should be noted that the target individual is determined by P g record, and the P g initial value is a zero vector with a size of d, and after the target individual is obtained, a plurality of target data features are determined by the target individual.
[0091] In addition, since the initial population needs to be iteratively updated for a preset number of iterations, the preset number of iterations t corresponding to the initial population also needs to be set, for example, the number of iterations t is 1, 2, etc.
[0092] Further, in each iteration update, the method further comprises:
[0093] Step j, each initial individual is subjected to mutation processing to obtain a mutated individual.
[0094] In the embodiment, the mutated individual is denoted as V i . The mutation processing process is implemented by the following formula:
[0095]
[0096] wherein, is a random number, is an individual randomly selected from the initial population P t and k≠i.
[0097] Step k, performing normalization processing on the mutated individual based on a preset normalization method, to obtain a normalized individual.
[0098] In this embodiment, the maximum value in the mutated individual V i is taken as V imax , the minimum value is taken as V imin , and the mutated individual V i is normalized by a preset normalization method: so that the value of each dimension in V ij is in the interval [0, 1].
[0099] Step l, calculating a crossover probability based on the feature network and the plurality of data feature groups;
[0100] Step m, performing crossover processing on the initial individual and the normalized individual based on the crossover probability, to obtain a crossed individual.
[0101] In this embodiment, the crossover processing is implemented by the following formula:
[0102]
[0103] wherein,
[0104]
[0105] wherein, perm(1, 2, …, d) is a random permutation sequence of 1, 2, …, d, indicating that each bit of U i is obtained in a random order; rand(0, 1) is a random number function, whose value range is [0, 1]. When P ij ≠ V ij , the crossover probability p j controls the jth bit of U i , whose value is determined by the neighborhood of the corresponding data feature in the feature network and the data feature group to which the data feature belongs.
[0106] wherein, for the crossover probability p j , the calculating of the crossover probability based on the feature network and the plurality of data feature groups comprises:
[0107] Step l1, randomly traversing elements of the initial individual, and obtaining data features corresponding to the elements and data feature pairs where the elements are located, to obtain a to-be-crossed data feature and a target data feature pair respectively;
[0108] Step l2, determining a weight value of a data feature edge between the target data feature pair, to obtain a first weight value;
[0109] Step l3, obtaining a first other data feature in the target data feature pair except the to-be-crossed data feature, determining a number of first other data features in which element values corresponding to the first other data features are greater than a preset value, to obtain a second weight value;
[0110] Step l4, determining a second other data feature in a data feature group where the to-be-crossed data feature is located except the to-be-crossed data feature, determining a number of second other data features in which element values corresponding to the second other data features are greater than the preset value, to obtain a third weight value;
[0111] Step l5, calculating a crossover probability based on the first weight value, the second weight value and the third weight value.
[0112] In an embodiment, p j The crossover probability is calculated by the following formula:
[0113]
[0114] wherein, d jw represents the first weight value of the data feature corresponding to the jth element; w jN represents the weighted number of element values greater than the preset value of the adjacent data feature corresponding to the data feature, that is, the weighted number of selected adjacent points, and the weight value is the weight value of the data feature edge corresponding to the data feature and the adjacent data feature, which is the second weight value; n jC represents the number of element values greater than the preset value of the data features in the data feature group to which the data feature belongs, which is the third weight value. The preset value is set as needed, for example, the preset value is 0.5, and the embodiment is not limited specifically.
[0115] The first term of the above formula promotes the selection of the jth corresponding data feature according to the information amount (the greater the first weight value, the greater the information amount), and the second and third terms inhibit the selection (if the jth corresponding data feature has adjacent data features and data features in the data feature group that have been selected, the selection needs to be inhibited). The values of α, β and γ control the proportion of the three terms, the value range of each of them is [0, 1], and α+β+γ=1, the values of α, β and γ are set as needed, and the embodiment is not limited specifically. For example, referring to Table 1, Figure 2For data feature f40: its first weight is the sum of the weights of all feature edges connected to it, i.e., d 40w =w(40,39)+w(40,41)+w(40,64)+w(40,65); If the data feature value corresponding to data feature f39 in U is greater than the preset value, while the data feature values corresponding to data features f41, f64, and f65 are all considered to be 0 since they have not yet been processed, then w 40N =w(40, 39)*1; Since only the data feature value corresponding to f39 in the data feature group {f39, f40, f41, f63, f64, f65} to which f40 belongs is currently greater than the preset value, n 40C =1; d 40w w 40N and n 40C By substituting the three terms into the formula, the probability p corresponding to the data feature f40 can be calculated. 40 .
[0116] Step n: Determine the iterative individual based on the crossover individual and the initial individual, wherein the iterative individual is used to determine the target individual.
[0117] Further, determining the iteratively successive individual based on the crossover individual and the initial individual includes:
[0118] Step n1: Based on the fitness function corresponding to the preset machine learning model, calculate the fitness values corresponding to the initial individual and the crossover individual respectively; and take the initial individual or the crossover individual with the largest fitness value as the iterative individual.
[0119] In this embodiment, after iteration, individuals need to be selected from the initial individuals or crossover individuals based on their fitness values, which are calculated using the following fitness function formula:
[0120]
[0121] in,
[0122] in, Represents an individual The accuracy of the corresponding predictor is obtained by training a machine learning model based on a subset S of data features selected from the target business data, where the subset S is composed of individual... Let tp and tn represent the number of correctly predicted defaulted samples and the number of non-defaulted samples, respectively, and fp and fn represent the number of incorrectly predicted defaulted samples and the number of non-defaulted samples, respectively. The larger the value, the better the predictor; The reciprocal of the proportion of the data feature subset S, the greater the value, the smaller S; λ is a specified parameter, used to adjust the proportion of f1 and f2 in the fitness function. It should be noted that λ can be set according to specific needs, and the embodiment is not limited.
[0123] After the fitness values of the initial individuals and the individuals after crossover are calculated, the individual (initial individual or individual after crossover) corresponding to the maximum fitness value among all fitness values is determined as the individual after iteration.
[0124] Specifically, the individual after iteration is determined by the following formula:
[0125]
[0126] Further, all individuals after iteration form the next generation population. Specifically, for each initial individual, there is a corresponding individual after crossover. The individual with a larger fitness value between the initial individual and the individual after crossover is taken as the corresponding individual after iteration. For example, if the fitness value of the initial individual is greater than the fitness value of the individual after crossover, the initial individual is taken as the corresponding individual after iteration. It should be noted that each initial individual in the initial population corresponds to an individual after iteration, and the next generation population is formed by all individuals after iteration.
[0127] Then, a target individual is selected from the next generation population, and the selection process is realized by the following formula:
[0128]
[0129] Specifically, the individuals in the next generation population are compared with P g in turn, and if the fitness value of the individual is greater than the fitness value of P g , P g is updated to the individual, otherwise P g remains unchanged. It should be noted that in the process of selecting the target individual, the number of iterations and the actual situation of P g are also considered. Specifically, during the population iteration process, if P g is not updated or the number of iterations reaches the preset number of iterations, the P g is determined as the final target individual; if P g is updated or the number of iterations does not reach the preset number of iterations, the next generation population is taken as the initial population, and the above step of performing mutation processing on each initial individual to obtain the individual after mutation is returned, so as to determine the individual after mutation according to the next generation population, and further determine the individual after crossover and the new next generation population, so as to obtain the new P g . Then, a plurality of target data features are determined according to P g , and the feature selection is completed.
[0130] The process described above, which uses the differential evolution algorithm to filter multiple data feature groups to obtain multiple target data features, refers to... Figure 3 First, the data features in the target business data are f1, f2, f3, f4, f5, f6, f7, and the population size N = 2, iteration number T = 1, λ = 0.2, α = 0.1, β = 0.5, γ = 0.4 are set; an initial population is generated. Next, in step ②, through random generation and After performing mutation operations on each individual in the initial population and normalizing them, the mutated individuals V1 and V2 are obtained; secondly, in step ③, the mutated individuals V1 and V2 are obtained. Perform a crossover operation with V1(V2) to obtain individual U1(U2), where perm(1,2,…,d)={6,4,2,5,3,1,7}); then, in step ④, calculate The fitness functions of U1 and U2 are 0.77 (0.87) and 0.47 (1.08) respectively. The individual with the largest fitness value between the two is selected as the next generation individual, thus obtaining the next generation population. and population P 2 As the initial population described above, steps ②, ③, and ④ are executed again. Since the number of iterations is 1, the individual with the highest fitness value obtained in this iteration (i.e., the individual with the highest fitness value) is selected. As the target individual, that is This concludes the differential evolution algorithm based on feature networks. In step ⑤, according to P... g The result of data feature selection is S = {f1, f3, f4, f6, f7}.
[0131] Further, after filtering the multiple data features using the feature network and the differential evolution algorithm corresponding to the multiple data feature groups to obtain multiple target data features, the process includes:
[0132] Step o: Obtain the target sub-business data corresponding to the multiple target data features in the target business data;
[0133] Step p: Train a preset predictor based on the target sub-business data to obtain a prediction model, and use the prediction model to predict the business data to be predicted.
[0134] In the embodiment, the target sub-business data is selected from the target business data by the plurality of target data features, the target sub-business data is taken as a training data set, a preset predictor is trained, that is, the predictor corresponding to the calculation of the fitness value, and a prediction model is obtained, thereby avoiding the interference of useless data to the training of the preset predictor, resulting in a poor prediction model and deviating from the actual result.
[0135] Compared with the prior art, in which a certain evolution algorithm is directly used as a search method to perform feature screening, resulting in long screening time and low screening accuracy when screening data features, the application obtains a plurality of data features of target business data in different dimensions, creates a feature network corresponding to the target business data according to the plurality of data features and the relevance between the plurality of data features, groups the plurality of data features according to the aggregation degree of the plurality of data features in the feature network to obtain a plurality of data feature groups, and screens the plurality of data features by using a differential evolution algorithm corresponding to the feature network and the plurality of data feature groups to obtain a plurality of target data features, which are a data feature set for representing the characteristics of the target business data. The application realizes grouping of the plurality of data features according to the aggregation degree of the plurality of data features in the feature network, which mines the potential information of the data feature space, and screens the plurality of data feature groups by using the differential evolution algorithm, which utilizes the potential information of the data feature space, thereby shortening the screening time and improving the screening accuracy when screening data features.
[0136] In addition, the application further provides a feature selection device, which comprises:
[0137] a first obtaining module configured to obtain a plurality of data features of target business data in different dimensions;
[0138] a creating module configured to create a feature network corresponding to the target business data according to the plurality of data features and the relevance between the plurality of data features;
[0139] a grouping module configured to group the plurality of data features according to the aggregation degree of the plurality of data features in the feature network to obtain a plurality of data feature groups;
[0140] a screening module configured to screen the plurality of data features by using a differential evolution algorithm corresponding to the feature network and the plurality of data feature groups to obtain a plurality of target data features, which are a data feature set for representing the characteristics of the target business data.
[0141] Optionally, the creating module is further configured to:
[0142] traversing a data feature pair composed of each two data features in the plurality of data features;
[0143] calculating a feature correlation coefficient of the data feature pair;
[0144] if an absolute value of the feature correlation coefficient is greater than a preset correlation coefficient threshold, establishing a connection relationship between the data feature pair, to obtain a data feature edge, wherein a weight of the data feature edge is the absolute value of the feature correlation coefficient;
[0145] after the traversal ends, creating a feature network corresponding to the target business data based on the plurality of data features and the data feature edge.
[0146] Optionally, a connection tightness between data features in the plurality of data feature groups is greater than a connection tightness between data features between the plurality of data feature groups.
[0147] Optionally, the screening module is further configured to:
[0148] generating an initial population, wherein the initial population is composed of a preset number of initial individuals, wherein the initial individual is a vector with a dimension of a number of the plurality of data features, each element in the vector corresponds to a data feature, and a numerical value thereof is a random number in a preset numerical value range;
[0149] performing iterative updating on the initial population for a preset number of iterations based on a preset machine learning model, the feature network and the plurality of data feature groups, to obtain a target individual;
[0150] determining a plurality of target data features based on the target individual.
[0151] Optionally, at each time of iterative updating, the screening module is further configured to:
[0152] performing mutation processing on each of the initial individuals to obtain a mutated individual;
[0153] performing normalization processing on the mutated individual based on a preset normalization method to obtain a normalized individual;
[0154] calculating a crossover probability based on the feature network and the plurality of data feature groups;
[0155] performing crossover processing on the initial individual and the normalized individual based on the crossover probability to obtain a crossed individual;
[0156] determining an iterated individual based on the crossed individual and the initial individual, wherein the iterated individual is used to determine a target individual.
[0157] Optionally, the screening module is further configured to:
[0158] randomly traverse elements of the initial individual, and obtain data features corresponding to the elements and data feature pairs in which the elements are located, to obtain a to-be-crossed data feature and a target data feature pair respectively;
[0159] determine a weight value of a data feature edge between the target data feature pair, to obtain a first weight value;
[0160] obtain a first other data feature in the target data feature pair except the to-be-crossed data feature, determine a number of first other data features in which element values corresponding to the first other data features are greater than a preset value, to obtain a second weight value;
[0161] determine a second other data feature in a data feature group in which the to-be-crossed data feature is located except the to-be-crossed data feature, determine a number of second other data features in which element values corresponding to the second other data features are greater than the preset value, to obtain a third weight value;
[0162] calculate a crossing probability based on the first weight value, the second weight value and the third weight value.
[0163] Optionally, the screening module is further configured to:
[0164] calculate fitness values corresponding to the initial individual and the crossed individual respectively based on a fitness function corresponding to the preset machine learning model, and take the initial individual or the crossed individual corresponding to the maximum fitness value as an iterated individual.
[0165] Optionally, the feature selection apparatus further includes:
[0166] a second obtaining module configured to obtain target sub-business data in the target business data corresponding to the plurality of target data features;
[0167] a training module configured to train a preset predictor based on the target sub-business data, to obtain a prediction model, and to predict to-be-predicted business data through the prediction model.
[0168] The feature selection apparatus embodiment of the present application is basically the same as the above-mentioned feature selection method embodiments, and thus will not be described here again.
[0169] In addition, the present application further provides a feature selection device. As shown in Figure 4 , Figure 4 is a structural schematic diagram of a hardware running environment related to an embodiment scheme of the present application.
[0170] It should be noted that Figure 4 , that is, the structural schematic diagram of the hardware running environment of the feature selection device.
[0171] As shown in Figure 4 The feature selection device can include a processor 1001, such as a CPU, a memory 1005, a user interface 1003, a network interface 1004, and a communication bus 1002. The communication bus 1002 is used to realize the connection communication between the components. The user interface 1003 can include a display, an input unit such as a keyboard, and can also include a standard wired interface, a wireless interface. The network interface 1004 can optionally include a standard wired interface, a wireless interface (such as a WI-FI interface). The memory 1005 can be a high-speed RAM memory, or a stable memory (non-volatile memory) such as a disk memory. The memory 1005 can also be a storage device independent of the aforementioned processor 1001.
[0172] Optionally, the feature selection device can also include RF (Radio Frequency, radio frequency) circuit, sensor, audio circuit, WiFi module, etc.
[0173] Those skilled in the art can understand that Figure 4 The feature selection device structure shown in the above description does not constitute a limitation on the feature selection device, and can include more or fewer components than the drawings, or combine certain components, or different component arrangements.
[0174] As shown in Figure 4 The memory 1005 as a computer storage medium can include an operating system, a network communication module, a user interface module, and a feature selection program. The operating system is a program that manages and controls the hardware and software resources of the feature selection device, and supports the running of the feature selection program and other software or programs.
[0175] In the feature selection device shown in Figure 4 The user interface 1003 is mainly used to connect the terminal and communicate data with the terminal, such as receiving user signaling data sent by the terminal; the network interface 1004 is mainly used for background server and communicates data with the background server; the processor 1001 can be used to call the feature selection program stored in the memory 1005 and execute the steps of the feature selection method as described above.
[0176] The feature selection device specific embodiments of the present application are basically the same as the above-mentioned feature selection method embodiments, and will not be repeated here.
[0177] In addition, the embodiment of the present application further provides a computer readable storage medium, wherein the computer readable storage medium stores a feature selection program, and the feature selection program is executed by a processor to implement the steps of the feature selection method.
[0178] The computer readable storage medium of the present application has the same implementation as the above-mentioned feature selection method, and thus is not described here again.
[0179] It should be noted that, in the present document, the term "comprising" or "including" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements, but also includes other elements not explicitly listed or inherent to such a process, method, article or device. Without more limitations, the element defined by the statement "comprising a" does not exclude the presence of other identical elements in the process, method, article or device including the element.
[0180] The serial numbers of the above-mentioned embodiments of the present application are only for description, and do not represent the advantages or disadvantages of the embodiments.
[0181] Through the above description of the embodiments, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be realized by means of software and necessary general hardware platforms, of course, they can also be realized by hardware, but in many cases, the former is a better embodiment. Based on such understanding, the technical solutions of the present application can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes a plurality of instructions for making a terminal device (which can be a mobile phone, computer, server, device, or network device, etc.) execute the methods described in the embodiments of the present application.
[0182] The above is only the preferred embodiment of the present application, and does not limit the patent scope of the present application, and any equivalent structure or equivalent process transformation, or direct or indirect application in other related technical fields based on the content of the present application specification and drawings, are also included in the patent protection scope of the present application.
Claims
1. A risk prediction method, characterized in that, When applied to a server, the risk prediction method includes the following steps: The target business data is obtained from multiple data features in different dimensions. The target business data includes credit card data composed of card information and historical consumption records. The data features include the number of card types, card brands, number of card transactions, and card transaction amount. Based on the multiple data features and the correlations between the multiple data features, a feature network corresponding to the target business data is created; Based on the degree of aggregation of the multiple data features in the feature network, the multiple data features are grouped to obtain multiple data feature groups; The feature network and the differential evolution algorithm corresponding to the multiple data feature groups are used to filter the multiple data features to obtain multiple target data features. The multiple target data features are a set of data features used to characterize the features of the target business data. Obtain the target sub-business data corresponding to the multiple target data features from the target business data; A preset predictor is trained based on the target sub-business data to obtain a prediction model, which is then used to predict the credit card data to be predicted and determine whether the credit card corresponding to the credit card data to be predicted has a default risk. The step involves using the feature network and the differential evolution algorithm corresponding to the multiple data feature groups to filter the multiple data features, resulting in multiple target data features, including: Generate an initial population, wherein the initial population consists of a preset number of initial individuals, wherein each initial individual is a vector with dimension equal to the number of the plurality of data features, and each element in the vector corresponds to a data feature, and its value is a random number within a preset numerical range; Based on the preset machine learning model, the feature network, and the multiple data feature groups, the initial population is iteratively updated a preset number of times to obtain the target individual; Based on the target individual, multiple target data features are determined; During each iteration update, the method further includes: Based on the feature network and the multiple data feature groups, the crossover probability is calculated.
2. The risk prediction method as described in claim 1, characterized in that, The step of creating a feature network corresponding to the target business data based on the multiple data features and the correlation between the multiple data features includes: Iterate through every pair of data features consisting of two data features from the plurality of data features; Calculate the feature correlation coefficient of the data feature pairs; If the absolute value of the feature correlation coefficient is greater than a preset correlation coefficient threshold, then a connection relationship is established between the data feature pairs to obtain a data feature edge, wherein the weight of the data feature edge is the absolute value of the feature correlation coefficient; After the traversal is completed, a feature network corresponding to the target business data is created based on the multiple data features and the data feature edges.
3. The risk prediction method as described in claim 1, characterized in that, The degree of connection between data features within the multiple data feature groups is greater than the degree of connection between data features between the multiple data feature groups.
4. The risk prediction method as described in claim 1, characterized in that, During each iteration update, the method further includes: Each of the initial individuals is subjected to mutation processing to obtain the mutated individuals; The mutated individuals are normalized based on a preset normalization method to obtain normalized individuals; Based on the feature network and the multiple data feature groups, calculate the crossover probability; Based on the crossover probability, the initial individual and the normalized individual are crossovered to obtain the crossover individual; Based on the crossover individuals and the initial individuals, iterative individuals are determined, wherein the iterative individuals are used to determine the target individuals.
5. The risk prediction method as described in claim 4, characterized in that, The calculation of the crossover probability based on the feature network and the multiple data feature groups includes: Randomly traverse the elements of the initial individual and obtain the data features corresponding to the elements and the data feature pairs they belong to, so as to obtain the data features to be crossed and the target data feature pairs respectively; Determine the weights of the data feature edges between the target data feature pairs to obtain the first weight; Obtain the first other data feature in the target data feature pair besides the data feature to be crossed, determine the number of first other data features whose element value is greater than a preset value, and obtain the second weight; Determine the second other data feature in the data feature group where the data feature to be crossed is located, excluding the data feature to be crossed, and determine the number of second other data features whose element values are greater than the preset value to obtain the third weight. The crossover probability is calculated based on the first weight, the second weight, and the third weight.
6. The risk prediction method as described in claim 4, characterized in that, The process of determining the iteratively successive individual based on the crossover individual and the initial individual includes: Based on the fitness function corresponding to the preset machine learning model, the fitness values corresponding to the initial individual and the crossover individual are calculated respectively; and the initial individual or the crossover individual with the largest fitness value is taken as the iterative individual.
7. A risk prediction device, characterized in that, The risk prediction device includes a memory, a processor, and a risk prediction program stored in the memory and executable on the processor, wherein the risk prediction program, when executed by the processor, implements the steps of the risk prediction method as described in any one of claims 1 to 6.
8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a risk prediction program, which, when executed by a processor, implements the steps of the risk prediction method as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Modeling method and device for credit score card model, medium and electronic device
CN112184412A