A method, system, device and medium for selecting data features

By introducing population initialization, KNN classifiers and soft/hard puncture strategies in data feature selection, combined with population predation strategies, the problem of difficulty in capturing feature correlation in traditional feature selection methods is solved, and the accuracy and correlation of feature selection are significantly improved.

CN119782774APending Publication Date: 2025-04-08BIG DATA & INFORMATION TECH RES INST OF WENZHOU UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411968599.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-30
Publication Date
2025-04-08

AI Technical Summary

Technical Problem

In the prior art, due to the complex associations and interactions between features in the data set, traditional feature selection methods are difficult to capture these relationships, resulting in poor feature correlation and accuracy.

Method used

By obtaining the target data set, generating populations and initializing the [0,1] matrix of population locations, the features with an individual value of 1 in the data set are input into the KNN classifier, the fitness value is obtained, and the individual is updated through soft search strategies or hard puncture strategies, and the population predation strategy is introduced to improve the accuracy of feature selection.

Benefits of technology

Through the combination of individual update and group predation strategies, the optimal connection between features between data can be more effectively captured, the accuracy and correlation of feature selection can be improved, and a better subset of features can be obtained.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119782774A_ABST
    Figure CN119782774A_ABST
Patent Text Reader

Abstract

The present invention discloses a data feature selection method, system, device and medium, which relates to the field of data processing technology, and includes the steps of: obtaining a dermatology data set; generating a population based on the data set, and initializing a [0,1] matrix including the population position, inputting the feature with an individual value of 1 in the data set into a KNN classifier, obtaining a fitness value, and updating the individual through a soft search strategy or a hard puncture strategy; when the individual is updated, introducing a group predation strategy into a soft search strategy or a hard puncture strategy, obtaining an updated individual, and updating the individual again when hunting is difficult; inputting the updated individual into a classifier to obtain a fitness value, and comparing it with the original individual to obtain an individual with the best fitness value. The present invention captures the best feature connection between data through individual update, increases the optimization capability, and compares the fitness value obtained by the optimal individual with the fitness value before updating, thereby improving the accuracy and relevance during feature selection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data processing technology, and in particular to a data feature selection method, system, device and medium. Background Art

[0002] With the rapid advancement of science and technology, massive amounts of data have been generated in various fields, and researchers hope to discover the most critical features from the data.

[0003] Feature selection is an important technique in machine learning and data mining, which aims to select the most relevant and representative feature subsets from the original feature set for building efficient and accurate prediction models and analysis processes.

[0004] In the prior art, due to the complex associations and interactions between the large number of features contained in the data set, traditional feature selection methods may not be able to capture these relationships, resulting in poor correlation and accuracy of the obtained features. Summary of the invention

[0005] The purpose of the present invention is to provide a data feature selection method, system, device and medium to address the shortcomings of the above-mentioned prior art, so as to solve the problem in the prior art that due to the complex correlations and interactions between the large number of features contained in the data set, the traditional feature selection method may not be able to capture these relationships, resulting in poor correlation and accuracy of the obtained features.

[0006] The present invention specifically provides the following technical solutions:

[0007] A data feature selection method comprises the following steps:

[0008] Obtain a target data set; wherein the data in the target data set is image data;

[0009] Generate a population based on the target data set, initialize a [0,1] matrix including the population position, map the individual values ​​in the population to [0,1], and input the features with individual values ​​of 1 in the data set into the KNN classifier to obtain the fitness value, and update the individuals through the soft search strategy or hard puncture strategy;

[0010] When updating individuals, the group predation strategy is introduced into the soft search strategy or the hard puncture strategy to obtain updated individuals. When hunting is difficult, the new individuals are updated to determine whether to find new prey. When new prey needs to be found, the individuals are updated again.

[0011] The updated individual is input into the KNN classifier to obtain the fitness value, and compared with the fitness value of the individual before the update to obtain the individual with the best fitness value, and the individual with the best fitness is taken as the optimal feature subset.

[0012] Preferably, mapping individual values ​​in the population to between [0, 1] includes:

[0013] Individual value mapping is performed through V-type function, and the specific expression is:

[0014]

[0015] Among them, V(x) is a V-type function, x is a variable, t is time, and erf is an error function.

[0016] Preferably, the updating of individuals by a soft search strategy or a hard puncture strategy includes:

[0017] The individuals are updated through the soft search strategy. The specific expression of the update method is:

[0018]

[0019] in, represents the new individual value of the jth dimension of the i-th generation, X best,j is the value of the global optimal individual in the jth dimension, r is a random number between 0 and 1, Ub and Lb are the upper and lower bounds, E is the adhesion coefficient, It is the current time, α is the angle, β is a variable that changes with iteration, and W is a fixed constant;

[0020] The individuals are updated through the hard puncture strategy. The specific expression of the update method is:

[0021]

[0022] where F normr (Fit i ) represents the normalized value of the current search agent fitness value, X best,j is the value of the global optimal individual in the jth dimension.

[0023] Preferably, the group predation strategy is introduced into the soft search strategy or the hard puncture strategy to obtain the updated individuals, including:

[0024] The group predation strategy is divided into two predation methods, namely, dispersing prey and surrounding prey, and the update method is:

[0025]

[0026] S=2·S 0 ·r 3 -S 0 ;

[0027]

[0028] Among them, r2 , rand, l are all random numbers between [0,1]. When rand is greater than 0.5, the prey encirclement strategy is executed, otherwise the prey dispersion strategy is adopted. Represents the updated position, Represents the location of the prey, It simulates the hunter's hunting route, a is the parameter variable in the hunting, e is the e-pointing function, S 0 is the initial energy of the prey, S is the energy of the prey, and its value is constantly changing, r 3 is a random number, D is the absolute distance between the current individual and the prey, w is a constant, This is the position before the update.

[0029] Preferably, when hunting becomes difficult, the method of updating new individuals to determine whether to search for new prey includes:

[0030] The specific process of updating includes:

[0031]

[0032] in, represents the closest position between individuals, D 1 represents the distance that an individual moves randomly, is a randomly selected individual, r 5 and r 6 is a random number between 0 and 1, and abs is the absolute value function.

[0033] The present invention provides a data feature selection system, comprising:

[0034] An acquisition module is used to acquire a target data set; wherein the data in the target data set is image data;

[0035] The initial update module is used to generate a population based on the target data set, initialize the [0,1] matrix including the population position, map the individual values ​​in the population to [0,1], and input the features with individual values ​​of 1 in the data set into the KNN classifier to obtain the fitness value, and update the individuals through the soft search strategy or the hard puncture strategy;

[0036] The judgment update module is used to introduce the group predation strategy into the soft search strategy or the hard puncture strategy when the individual is updated, obtain the updated individual, and update the new individual when hunting is difficult to determine whether to find new prey, and update the individual again when it is necessary to find new prey;

[0037] The selection module is used to input the updated individual into the KNN classifier to obtain the fitness value, and compare it with the fitness value of the individual before the update to obtain the individual with the best fitness value, and use the individual with the best fitness as the optimal feature subset.

[0038] The present invention provides a computer device, comprising a memory and a processor, wherein a program is stored in the memory, and when the program is executed by the processor, the processor executes the steps of the above-mentioned data feature selection method.

[0039] The present invention provides a storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps of the above-mentioned method for selecting features of data are implemented.

[0040] Compared with the prior art, the present invention has the following significant advantages:

[0041] The present invention maps individual values ​​in a data set, and classifies features with individual values ​​of 1 in the mapping through a KNN classifier to obtain fitness values, obtain associations and interactions between features, and introduce a soft search strategy or a hard puncture strategy through a group predation strategy to update individuals, thereby obtaining updated individuals, and updating individuals again according to conditions when hunting is difficult, thereby capturing the best connection between features in the data through individual updates, which is beneficial to increasing the optimization capability, and comparing the fitness value obtained by the optimal individual with the fitness value before updating to obtain the optimal feature subset, effectively improving the accuracy and correlation during feature selection. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] Figure 1 This is a data feature selection flow chart of the present invention. DETAILED DESCRIPTION

[0043] The following is a clear and complete description of the technical solutions of the embodiments of the present invention in conjunction with the drawings in the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0044] The present embodiment is described in detail with reference to the accompanying drawings. Figure 1 As shown, a data feature selection method in this embodiment includes the following steps:

[0045] Step S1: Obtain a target dataset; the data in the target dataset is image data. The experiment uses a dermatology dataset from the UCI database and four other public datasets to verify the versatility and effectiveness of the method.

[0046] Step S2: Generate a population based on the target data set and initialize the population position X i (i=1,2,…,N) is a [0,1] matrix, taking each individual in the population as a solution vector, and the length of the solution vector is the same as the number of features in the data set.

[0047] Also initialize the parameters: the population size N of the optimization algorithm and the maximum number of iterations MaxIt.

[0048] Step S3: Map the individual values ​​in the population to between [0,1], and input the features and labels of the individual values ​​​​of 1 in the data set into the KNN classifier, obtain the fitness value, and update the individuals through the soft search strategy or the hard puncture strategy.

[0049] The individual value mapping is performed through the V-type function. The specific expression is shown in formula (1):

[0050]

[0051] Among them, V(x) is a V-type function, x is a variable, t is time, and erf is an error function. When the selected features and labels are input into the KNN classifier, an individual value of 0 means that the feature is not selected, and an individual value of 1 means that the feature is selected.

[0052] Individuals are updated through soft search strategies or hard puncture strategies, including:

[0053] The individuals are updated through the algorithm's own soft search strategy. The update method is shown in formula (2) to formula (5):

[0054]

[0055] in, represents the new individual value of the jth dimension of the i-th generation, X best,j is the value of the global optimal individual in the jth dimension, r is a random number between 0 and 1, Ub and Lb are the upper and lower bounds, E is the adhesion coefficient, It is the current time, α is the angle, β is a variable that changes with iteration, and W is a fixed constant (one embodiment is 6).

[0056] The individual is updated through the algorithm's own hard puncture strategy. The calculation scheme is shown in formula (6):

[0057]

[0058] where F normr (Fit i ) represents the normalized value of the current search agent fitness value, X best,j is the value of the global optimal individual in the jth dimension.

[0059] Step S4: When individuals are updated, the group predation strategy is introduced into the soft search strategy or the hard penetration strategy (part of the intelligent algorithm) to guide the update of individuals. When hunting is difficult, the new individuals are updated to decide whether to find new prey, and the heuristic guidance strategy is introduced into the intelligent algorithm to guide the update of individuals.

[0060] The group predation strategy can be divided into two predation methods, namely, dispersing prey and surrounding prey. The update method is shown in formula (7) to formula (11):

[0061]

[0062]

[0063] S=2·S 0 ·r 3 -S 0 (10);

[0064]

[0065] Among them, r 2 , rand, l are all random numbers between [0,1]. When rand is greater than 0.5, the prey encirclement strategy is executed, otherwise the prey dispersion strategy is adopted. Represents the updated position, Represents the location of the prey, It simulates the hunter's hunting route, a is the parameter variable in the hunting, e is the e-pointing function, S 0 is the initial energy of the prey, S is the energy of the prey, and its value is constantly changing, r 3 is a random number, D is the absolute distance between the current individual and the prey, w is a constant (9 in one embodiment), This is the position before the update.

[0066] When hunting becomes difficult, the group predation strategy will make new updates to decide whether to find new prey. The update process is shown in formulas (12) to (14):

[0067]

[0068] in, represents the closest position between individuals, D 1 represents the distance that an individual moves randomly, is a randomly selected individual, r 5 and r 6 is a random number between 0 and 1, and abs is the absolute value function.

[0069] The heuristic guidance strategy is introduced into the intelligent algorithm to guide the update of individuals. The update method is shown in formula (15) to formula (16):

[0070] HD=k·(X best,j -X i,j ) (15);

[0071]

[0072] Among them, k is the influence factor of adjusting the heuristic information, which is a constant with a value of 0.3.

[0073] Step S5: Input the updated individual into the KNN classifier to obtain the fitness value, and compare it with the fitness value of the individual before the update to obtain the individual with the best fitness value, and use the individual with the best fitness as the optimal feature subset.

[0074] Check the population termination condition. If the number of iterations has not reached the maximum number of iterations, return to continue the calculation and return the optimal population individual and the best model accuracy value.

[0075] According to a preferred embodiment of the present invention, 5 data sets were selected for testing, and the test set information is shown in Table 1. The weighted sum of the size ratio of the selected feature subset in the total features and the model classification error rate is used as the fitness function, and the lower the fitness value, the better the quality of the solution. Tables 2-4 show the statistical results of this method and other various comparison algorithms on 5 data sets, including fitness value comparison, error rate comparison and selected feature subset size comparison. It can be confirmed from Tables 2-4 that the classification quality of the feature selection dimensionality reduction algorithm of the present invention is better than and better than other similar methods, such as the bat algorithm (BA), the Salp Sac algorithm (SSA), the Harris Hawk algorithm (HHO), the slime mold algorithm (SMA), and the improved slime mold optimization algorithm (SDCSMA), wherein the optimal results of the statistical indicators on each data set are marked in bold.

[0076] Table 1 Dataset

[0077] Dataset Number of samples Number of features category Dermatology 358 35 6 JPNdata 152 11 2 transfusion 748 5 2 Vote 101 17 2 WineEW 178 14 3

[0078] Table 2. Fitness analysis results

[0079]

[0080] Table 3. Model error rate analysis results

[0081]

[0082] Table 4. Analysis results of the number of features selected by the model

[0083]

[0084] Based on the above method, the present invention provides a data feature selection system, including: an acquisition module, an initial update module, a judgment update module and a selection module.

[0085] Among them, the acquisition module is used to obtain the target data set; the data in the target data set is image data; the initial update module is used to generate a population based on the target data set, and initialize the [0,1] matrix including the population position, map the individual values ​​in the population to [0,1], and input the features with individual values ​​of 1 in the data set into the KNN classifier to obtain the fitness value, and update the individuals through the soft search strategy or the hard puncture strategy; the judgment update module is used to introduce the group predation strategy into the soft search strategy or the hard puncture strategy when the individuals are updated, obtain the updated individuals, and update the new individuals when hunting is difficult to determine whether to find new prey, and update the individuals again when new prey needs to be found; the selection module is used to input the updated individuals into the KNN classifier to obtain the fitness value, and compare it with the fitness value of the individual before the update, to obtain the individual with the best fitness value, and use the individual with the best fitness as the optimal feature subset.

[0086] The present invention also provides a computer device, including a memory and a processor, wherein a program is stored in the memory, and when the program is executed by the processor, the processor executes the steps of a data feature selection method.

[0087] In accordance with the disclosed embodiments, a computing device may communicate with one or more external devices (e.g., keyboards, pointing devices, Bluetooth communications, etc.), or with any device (e.g., routers, modems, etc.) that enables a computing device to communicate with one or more other computing devices.

[0088] The present invention also provides a storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps of a data feature selection method are implemented.

[0089] According to the disclosed embodiments, the storage medium may be a non-volatile computer-readable storage medium, such as but not limited to: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present invention, the storage medium may be any tangible medium containing or storing a program that may be used by or in conjunction with an instruction execution system, apparatus, or device.

[0090] The above content is a further detailed description of the present invention in combination with a specific preferred embodiment. For technicians in the technical field to which the present invention belongs, several simple deductions or substitutions can be made without departing from the concept of the present invention, which should be regarded as belonging to the protection scope of the present invention.

Claims

1. A data feature selection method, characterized in that: The steps include: Obtain a target data set; wherein the data in the target data set is image data; Generate a population based on the target data set, initialize a [0,1] matrix including the population position, map the individual values ​​in the population to [0,1], and input the features with individual values ​​of 1 in the data set into the KNN classifier to obtain the fitness value, and update the individuals through the soft search strategy or hard puncture strategy; When updating individuals, the group predation strategy is introduced into the soft search strategy or the hard puncture strategy to obtain updated individuals. When hunting is difficult, the new individuals are updated to determine whether to find new prey. When new prey needs to be found, the individuals are updated again. The updated individual is input into the KNN classifier to obtain the fitness value, and compared with the fitness value of the individual before the update to obtain the individual with the best fitness value, and the individual with the best fitness is taken as the optimal feature subset.

2. A data feature selection method as claimed in claim 1, characterized in that: The mapping of individual values ​​in the population to between [0,1] includes: Individual value mapping is performed through V-type function, and the specific expression is: Among them, V(x) is a V-type function, x is a variable, t is time, and erf is an error function.

3. A data feature selection method as claimed in claim 1, characterized in that: The updating of individuals by a soft search strategy or a hard puncture strategy includes: The individuals are updated through the soft search strategy. The specific expression of the update method is: in, represents the new individual value of the jth dimension of the i-th generation, X best,j is the value of the global optimal individual in the jth dimension, r is a random number between 0 and 1, Ub and Lb are the upper and lower bounds, E is the adhesion coefficient, It is the current time, α is the angle, β is a variable that changes with iteration, and W is a fixed constant; The individuals are updated through the hard puncture strategy. The specific expression of the update method is: where F normr (Fit i ) represents the normalized value of the current search agent fitness value.

4. A data feature selection method as claimed in claim 3, characterized in that: The group predation strategy is introduced into the soft search strategy or the hard puncture strategy to obtain updated individuals, including: The group predation strategy is divided into two predation methods, namely, dispersing prey and surrounding prey, and the update method is: S = 2·S0·r3-S0; Among them, r2, rand, and l are all random numbers between [0, 1]. When rand is greater than 0.5, the prey encirclement strategy is executed, otherwise the prey dispersion strategy is adopted. Represents the updated position, Represents the location of the prey, It simulates the hunter's hunting route. a is the parameter variable in the hunting process, e is the e-pointing function, S0 is the initial energy of the prey, S is the energy of the prey, and its value keeps changing. r3 is a random number, D is the absolute distance between the current individual and the prey, and w is a constant. This is the position before the update.

5. A data feature selection method as claimed in claim 4, characterized in that: When hunting is difficult, the method of updating the new individuals and determining whether to search for new prey includes: The specific process of updating includes: in, represents the closest position between individuals, D1 represents the distance that individuals move randomly, is a randomly selected individual, r5 and r6 are random numbers between 0 and 1, and abs is the absolute value function.

6. A data feature selection system, characterized in that: include: An acquisition module, used to obtain a target data set; The data in the target data set is image data; The initial update module is used to generate a population based on the target data set, initialize the [0,1] matrix including the population position, map the individual values ​​in the population to [0,1], and input the features with individual values ​​of 1 in the data set into the KNN classifier to obtain the fitness value, and update the individuals through the soft search strategy or the hard puncture strategy; The judgment update module is used to introduce the group predation strategy into the soft search strategy or the hard puncture strategy when the individual is updated, obtain the updated individual, and update the new individual when hunting is difficult to determine whether to find new prey, and update the individual again when it is necessary to find new prey; The selection module is used to input the updated individual into the KNN classifier to obtain the fitness value, and compare it with the fitness value of the individual before the update to obtain the individual with the best fitness value, and use the individual with the best fitness as the optimal feature subset.

7. A computer device, characterized in that: The method comprises a memory and a processor, wherein a program is stored in the memory, and when the program is executed by the processor, the processor executes the steps of a data feature selection method as claimed in any one of claims 1 to 5.

8. A storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of a data feature selection method according to any one of claims 1 to 5 are implemented.