Diabetes prediction model feature selection method and device

Through the iterative process of using the random forest classifier and the raccoon algae algorithm in the diabetes prediction model, feature selection is optimized, and the problems of low efficiency and insufficient accuracy in the existing technology are solved, and efficient and accurate feature subset selection is achieved. Improves the training and prediction performance of the model.

CN119252500APending Publication Date: 2025-01-03WEBANK (CHINA)
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411456808.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-18
Publication Date
2025-01-03

AI Technical Summary

Technical Problem

When the number of features in the existing diabetes prediction model has high computational complexity and low efficiency. The common wrapper methods consume a lot of time and have low accuracy, and the filter method has low accuracy, making it difficult to effectively select the best subset of features.

Method used

A method for feature selection of diabetes prediction model is proposed. By initializing the feature selection result set, using the random forest classifier and the raccoon algae algorithm to explore iteration and development iteration process, gradually optimize the feature selection results, reduce the calculation amount, improve efficiency, and determine the best Feature subset.

Benefits of technology

It significantly improves feature selection efficiency and accuracy, reduces computational complexity, and can determine the best subset of features related to diabetes prediction in a short time, improving the training efficiency and prediction accuracy of the model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119252500A_ABST
    Figure CN119252500A_ABST
Patent Text Reader

Abstract

The invention provides a diabetes prediction model feature selection method and device. The method comprises the following steps: determining M to-be-selected features related to diabetes prediction; a feature selection result set is initialized, any feature selection result in the feature selection result set is composed of an M-bit binary number used for representing the selection condition of M to-be-selected features, and the total number of the feature selection results in the feature selection result set is smaller than 2M-1; determining a feature selection result with the best fitness in the feature selection result set; on the basis of the feature selection result with the best fitness in the feature selection result set of the (t-1) th round, iteratively updating each feature selection result in the feature selection result set of the (t-1) th round to obtain a feature selection result set of the t th round; and on the basis of the feature selection result set of the mth round when the iteration termination condition is satisfied, determining that the feature selection result with the optimal fitness in the feature selection result set of the mth round is N optimal features related to diabetes prediction.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a method and device for selecting features of a diabetes prediction model. Background Art

[0002] Feature selection is the preprocessing stage of training diabetes prediction models, which directly affects the training efficiency and accuracy of diabetes prediction models. By eliminating redundant features, the complexity of model training can be reduced and the training efficiency can be improved. Feature selection can be regarded as a combinatorial optimization task. Assuming that the dataset contains n original features, the feature selection process tends to select from 2 n -1 possible feature combinations. However, when the number of features is large, it is almost impossible to find the optimal feature subset using exhaustive search.

[0003] Currently, there are two common feature selection methods: wrapper methods and filter methods. Filter methods evaluate features based on intrinsic properties of the data, such as distance metrics, correlation metrics, consistency metrics, and information metrics. Wrapper methods use the prediction accuracy of classification algorithms, such as K-nearest neighbor, support vector machines, neural networks, and Bayesian networks, to evaluate selected feature subsets. In comparison, wrapper methods can achieve higher classification accuracy but are more time-consuming, while filter methods typically require less computation time but achieve lower accuracy.

[0004] Therefore, there is an urgent need for a better feature selection method to select features for training diabetes prediction models. Summary of the Invention

[0005] The present application provides a method and device for feature selection of a diabetes prediction model to improve the efficiency of feature selection.

[0006] In a first aspect, the present application provides a method for selecting features of a diabetes prediction model, the method comprising:

[0007] Determining M features to be selected that are relevant to diabetes prediction, where M is a positive integer; the M features to be selected include at least one of the number of pregnancies, blood glucose concentration, blood pressure level, triceps skinfold thickness, insulin level, body mass index, family heritability of diabetes, and age;

[0008] Initialize the feature selection result set, where any feature selection result in the feature selection result set consists of M-bit binary numbers, and the M-bit binary numbers are used to represent the selection of the M features to be selected; the total number of feature selection results in the feature selection result set is less than 2 M -1;

[0009] For any one of the feature selection results in the feature selection result set, determining the fitness of the feature selection result based on the prediction results of multiple samples constructed from the feature selection result under a preset classifier; the prediction result represents a prediction indication of whether the sample suffers from diabetes;

[0010] Determine the feature selection result with the best fitness in the feature selection result set;

[0011] Based on the feature selection result with the best fitness in the feature selection result set of the t-1 round, iteratively update each feature selection result in the feature selection result set of the t-1 round to obtain the feature selection result set of the t round;

[0012] Based on the feature selection result set of the mth round when the iteration termination condition is met, the feature selection result with the best fitness in the feature selection result set of the mth round is determined to be the N best features related to diabetes prediction, where N is a positive integer and N is less than or equal to M.

[0013] When selecting several features from M to be selected features to train a diabetes prediction model, it is usually necessary to exhaustively enumerate the selection of M to be selected features. M -1 selection situation, and then calculate these 2 separately M -1 fitness of the selected cases, the one with the highest fitness score is taken as the final selection result; when M is large, exhaustively select 2 M -1 selection situation and the calculation of fitness of various selection situations are large and inefficient. The method proposed in this application first initializes a feature selection result set, and the total number of feature selection results of the feature selection result set is less than 2 M -1, and then determine the feature selection result with the best fitness in the feature selection result set, and then iteratively update based on the feature selection result with the best fitness to obtain more new feature selection results, increase the number of feature selection results in the feature selection result set, and thus increase the probability of a feature selection result with better fitness. In addition, the number of feature selection results for which the fitness needs to be calculated in this application is significantly reduced, which can speed up the process of m rounds of iterations, and thus speed up the determination of the N best features, that is, improve the efficiency of determining the N best features.

[0014] In a possible design, the prediction results of the plurality of samples constructed according to the feature selection results under a preset classifier, and determining the fitness of the feature selection results, include:

[0015] For any sample constructed from the feature selection results, input the sample into a random forest classifier to obtain a prediction indication of the sample;

[0016] Determining, based on the prediction indications of the plurality of samples and the true labels of the plurality of samples, a misjudgment result of the feature selection result;

[0017] Based on the misjudgment result of the feature selection result, the fitness of the feature selection result is determined.

[0018] The random forest classifier performs well in the diabetes prediction scenario. In other words, the random forest classifier has a good accuracy rate in predicting diabetes. Therefore, calculating the fitness of the feature selection results based on the output of the random forest classifier can improve the accuracy of the fitness.

[0019] In one possible design, based on the best-fitting feature selection result in the feature selection result set of the t-1 round, each feature selection result in the feature selection result set of the t-1 round is iteratively updated, including:

[0020] Before each round of iteration, a first random number is determined;

[0021] If the first random number is less than a preset value, the exploration iteration process of the raccoon algae algorithm is used to iteratively update each feature selection result in the feature selection result set of the t-1 round based on the feature selection result with the best fitness in the feature selection result set of the t-1 round;

[0022] If the first random number is greater than or equal to the preset value, the development iteration process of the raccoon algae algorithm is adopted, and each feature selection result in the feature selection result set of the t-1 round is iteratively updated based on the feature selection result with the best fitness in the feature selection result set of the t-1 round.

[0023] This application randomly switches the iterative mode of each round of iteration by determining a first random number before each round of iteration. One is the exploration iterative process of the Hezao algorithm, and the other is the development iterative process of the Hezao algorithm. Among them, the exploration iterative process of the Hezao algorithm focuses on the possibility of searching for feature selection results in a large range, while the development iterative process of the Hezao algorithm focuses on local search, and more finely optimizes the feature selection results with the best current fitness. By alternating these two iterative processes, it is possible to effectively balance global search and local development, avoid falling into local optimality, and improve search efficiency.

[0024] In a possible design, the exploration iteration process using the raccoon algae algorithm iteratively updates each feature selection result in the feature selection result set of the t-1 round based on the feature selection result with the best fitness in the feature selection result set of the t-1 round, including:

[0025] The calculation formula of the feature selection result p(t) obtained by iteratively updating each feature selection result in the feature selection result set of the t-1 round using the exploration iteration process of the raccoon algae algorithm is:

[0026] p(t)=p(t-1)+W1(2K+r1)

[0027] Among them, p(t-1) is the feature selection result in the feature selection result set of the t-1th round; W1 is r2×(KP best +2K), P best is the feature selection result with the best fitness in the feature selection result set of the t-1 round, K is r1 and r2 are random numbers determined before each round of iteration.

[0028] W1 in the exploration and iteration process of the Hezao algorithm is independent of the feature selection results in the feature selection result set of the t-1th round, and p(t) is also related to the random number r1. Therefore, the feature selection result p(t) after the iteration determined in the exploration and iteration process of the Hezao algorithm is more jumpy and has a large difference from the feature selection result p(t-1) before the iteration, which increases the possibility of obtaining different feature selection results.

[0029] In one possible design, if the exploration iterative process of the raccoon algae algorithm is used to iteratively update each feature selection result in the feature selection result set of the t-1th round, and at least one feature selection result remains unchanged after a preset number of iterations, Gaussian distribution perturbation is introduced to iteratively update the at least one feature selection result to obtain a new feature selection result.

[0030] The exploration iteration process of the raccoon algae algorithm hopes to expand the exploration scope, or in other words, it is expected that the feature selection results after the iteration will be significantly different from the feature selection results before the iteration. The characteristic of Gaussian distribution perturbation is randomness. This randomness makes the impact of the perturbation more unpredictable, which can help explore the search space more widely and increase the chance of finding the feature selection result with the best global fitness.

[0031] In one possible design, the development iteration process using the raccoon algae algorithm iteratively updates each feature selection result in the feature selection result set of the t-1 round based on the feature selection result with the best fitness in the feature selection result set of the t-1 round, including:

[0032] The calculation formula of the feature selection result p(t) obtained by iteratively updating each feature selection result in the feature selection result set of the t-1 round using the development iteration process of the raccoon algae algorithm is:

[0033] p(t)=p(t-1)+KW2

[0034] Among them, p(t-1) is the feature selection result in the feature selection result set of the t-1th round, W2 is r3×(KP best +r3P(t-1)), K is P best is the feature selection result with the best fitness in the feature selection result set of round t-1, and r3 is the random number determined before each round of iteration.

[0035] In the iterative development process of the raccoon algae algorithm, W2 is related to the feature selection result p(t-1) before the iteration. Therefore, W2 is more closely associated with the feature selection result before the iteration. Then, the feature selection result p(t) after the iteration is determined based on W2 and the feature selection result p(t-1) before the iteration, which can make p(t) and p(t-1) more closely associated. In other words, the difference between the feature selection result p(t) after the iteration and the feature selection result p(t-1) before the iteration is smaller.

[0036] In addition, whether it is the exploration iteration process or the development iteration process of the raccoon algae algorithm, the calculation formula of the feature selection results after iteration involves the parameter K, and K gradually decreases with the increase in the number of iteration rounds. The decrease in K makes the search gradually focus on the feature selection results with the best fitness for fine search, so that the method proposed in this application can effectively utilize each round of iteration and improve efficiency.

[0037] In one possible design, if the development iteration process of the raccoon algae algorithm is used to iteratively update each feature selection result in the feature selection result set of the t-1th round, and at least one feature selection result remains unchanged after a preset number of iterations, a sinusoidal perturbation is introduced to iteratively update the at least one feature selection result to obtain a new feature selection result.

[0038] The iterative development process of the Hezao algorithm expects that the feature selection results after iteration are slightly different from those before iteration. The characteristic of sinusoidal perturbation is periodicity, which is manifested as fluctuations around the feature selection results. Therefore, the feature selection results after iteration determined based on sinusoidal perturbation are slightly different from those before iteration, which fully utilizes the characteristics of sinusoidal perturbation.

[0039] In a second aspect, the present application further provides a diabetes prediction model feature selection device, the device comprising: a determination module, an initialization module, and an iteration module;

[0040] The determining module is configured to determine M features to be selected that are relevant to diabetes prediction, where M is a positive integer; the M features to be selected include at least one of the number of pregnancies, blood glucose concentration, blood pressure level, triceps skinfold thickness, insulin level, body mass index, family heritability of diabetes, and age;

[0041] The initialization module is used to initialize the feature selection result set. Any feature selection result in the feature selection result set is composed of M-bit binary numbers, and the M-bit binary numbers are used to represent the selection status of the M features to be selected; the total number of feature selection results in the feature selection result set is less than 2 M -1;

[0042] The determination module is further configured to determine the fitness of any one of the feature selection results in the feature selection result set based on prediction results of multiple samples constructed from the feature selection results under a preset classifier; the prediction result represents a prediction indication of whether the sample suffers from diabetes;

[0043] The determining module is further configured to determine the feature selection result with the best fitness in the feature selection result set;

[0044] The iteration module is used to iteratively update each feature selection result in the feature selection result set of the t-1 round based on the feature selection result with the best fitness in the feature selection result set of the t-1 round, to obtain the feature selection result set of the t round;

[0045] The determination module is also used to determine, based on the feature selection result set of the mth round when the iteration termination condition is met, that the feature selection result with the best fitness in the feature selection result set of the mth round is the N best features related to diabetes prediction, where N is a positive integer and N is less than or equal to M.

[0046] In one possible design, the determination module is specifically used to input any sample constructed from the feature selection result into a random forest classifier to obtain a prediction indication of the sample; determine the misjudgment result of the feature selection result based on the prediction indications of multiple samples and the true labels of multiple samples; and determine the fitness of the feature selection result based on the misjudgment result of the feature selection result.

[0047] In one possible design, the iteration module is specifically configured to determine a first random number before each round of iteration;

[0048] If the first random number is less than a preset value, the exploration iteration process of the raccoon algae algorithm is used to iteratively update each feature selection result in the feature selection result set of the t-1 round based on the feature selection result with the best fitness in the feature selection result set of the t-1 round;

[0049] If the first random number is greater than or equal to the preset value, the development iteration process of the raccoon algae algorithm is adopted, and each feature selection result in the feature selection result set of the t-1 round is iteratively updated based on the feature selection result with the best fitness in the feature selection result set of the t-1 round.

[0050] In a possible design, the iteration module is specifically used to calculate the feature selection result p(t) obtained after iteratively updating each feature selection result in the feature selection result set of the t-1th round using the exploration iteration process of the raccoon algae algorithm:

[0051] p(t)=p(t-1)+W1(2K+r1)

[0052] Among them, p(t-1) is the feature selection result in the feature selection result set of the t-1th round; W1 is r2×(KP best +2K), P best is the feature selection result with the best fitness in the feature selection result set of the t-1 round, K is r1 and r2 are random numbers determined before each round of iteration.

[0053] In a possible design, the further step includes: if, when the exploration iterative process of the raccoon algae algorithm is used to iteratively update each feature selection result in the feature selection result set of the t-1th round, at least one feature selection result remains unchanged after a preset number of iterations, then the iteration module introduces Gaussian distribution perturbation to iteratively update the at least one feature selection result to obtain a new feature selection result.

[0054] In a possible design, the iteration module is specifically used to calculate the feature selection result p(t) obtained by iteratively updating each feature selection result in the feature selection result set of the t-1th round using the development iteration process of the raccoon algae algorithm:

[0055] p(t)=p(t-1)+KW2

[0056] Among them, p(t-1) is the feature selection result in the feature selection result set of the t-1th round, W2 is r3×(KP best +r3P(t-1)), K is P bestis the feature selection result with the best fitness in the feature selection result set of round t-1, and r3 is the random number determined before each round of iteration.

[0057] In one possible design, the further step includes: if, when iteratively updating each feature selection result in the feature selection result set of the t-1th round using the development iteration process of the raccoon algae algorithm, at least one feature selection result remains unchanged after a preset number of iterations, the iteration module introduces a sinusoidal perturbation to iteratively update the at least one feature selection result to obtain a new feature selection result.

[0058] In a third aspect, the present application further provides a diabetes prediction model feature selection device, the device comprising: a processor, and a memory communicatively connected to the processor;

[0059] The memory stores computer-executable instructions;

[0060] The processor executes the computer-executable instructions stored in the memory to implement the method described in the first aspect above.

[0061] In a fourth aspect, the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium includes a program, and when the program is executed on a device, the device executes the method as described in any one of the above-mentioned first aspects.

[0062] In a fifth aspect, the present application further provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, it implements the method described in the first aspect above. BRIEF DESCRIPTION OF THE DRAWINGS

[0063] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0064] Figure 1 Schematic diagram of the diabetes prediction model feature selection method provided in the embodiment of this application Figure 1 ;

[0065] Figure 2 Schematic diagram of the diabetes prediction model feature selection method provided in the embodiment of this application Figure 2 ;

[0066] Figure 3 Schematic diagram of the structure of the diabetes prediction model feature selection device provided in the embodiment of this application Figure 1 ;

[0067] Figure 4 Schematic diagram of the structure of the diabetes prediction model feature selection device provided in the embodiment of this application Figure 2 . DETAILED DESCRIPTION

[0068] To make the objectives, technical solutions, and advantages of this application more clear, this application will be further described in detail below with reference to the accompanying drawings. Obviously, the embodiments described are only some of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making any creative efforts are within the scope of protection of this application.

[0069] The application scenarios described in the embodiments of this application are intended to more clearly illustrate the technical solutions of the embodiments of this application and do not constitute a limitation on the technical solutions provided by the embodiments of this application. Persons skilled in the art will appreciate that, as new application scenarios emerge, the technical solutions provided by the embodiments of this application are equally applicable to similar technical problems. In the description of this application, unless otherwise specified, "multiple" means two or more.

[0070] If the existing packaging method and filtering method are used for feature selection, when selecting features for training the diabetes prediction model, the problem of high computational complexity may occur. For example, when there are many features related to diabetes, the problem of high computational complexity may occur. Therefore, this application proposes the following method: Figure 1 The method shown is used to improve the efficiency of feature selection. The execution subject of this method is a server, or a chip in the server, or a functional module in the server, which is not limited in this application. The following is an explanation using the server as the execution subject. The method specifically includes:

[0071] Step 100: Determine M features to be selected that are related to diabetes prediction, where M is a positive integer; the M features to be selected include at least one of the number of pregnancies, blood glucose concentration, blood pressure level, triceps skinfold thickness, insulin level, body mass index, family heritability of diabetes, and age.

[0072] For example, the dataset used in this application is the Pima diabetes dataset, also known as the UCI dataset. This dataset originally comes from the National Institute of Diabetes and Digestive Kidney Diseases of the United States and can be used to predict whether an individual has diabetes. This dataset covers the medical records of the Pima people and whether they have had diabetes in the past five years. All data in the dataset are presented in digital form.

[0073] Exemplarily, the UCI dataset includes a total of 8 feature attributes, namely, number of pregnancies, blood glucose concentration, blood pressure level, triceps skinfold thickness, insulin level, body mass index, family inheritance rate of diabetes, and age. The M features to be selected related to diabetes prediction are derived from the above 8 features. Therefore, the M features to be selected include at least one of the number of pregnancies, blood glucose concentration, blood pressure level, triceps skinfold thickness, insulin level, body mass index, family inheritance rate of diabetes, and age.

[0074] The method proposed in this application is used to select several features with the highest correlation from M features to train a diabetes prediction model, so as to improve the efficiency and effect of feature selection, and thus improve the accuracy of the diabetes prediction model.

[0075] Step 101: Initialize a feature selection result set. Any feature selection result in the feature selection result set is composed of M-bit binary numbers, and the M-bit binary numbers are used to represent the selection status of M features to be selected.

[0076] For example, a feature selection result set is first initialized, and the total number of feature selection results in the feature selection result set is less than 2 M -1, a feature selection result can also be called a solution, or a solution, or a feature subset. Each feature selection result is represented by an M-bit binary number, and each binary number is used to indicate whether the corresponding feature is selected.

[0077] For example, assuming that M is 8, the eight features to be selected are the number of pregnancies, blood glucose concentration, blood pressure level, triceps skinfold thickness, insulin level, body mass index, family inheritance rate of diabetes, and age. Accordingly, the feature selection results in the feature selection result set are composed of 8 binary numbers, which are used to represent the selection of the above eight features. For example, the first binary number is used to represent the selection of the number of pregnancies feature, the second binary number is used to represent the selection of the blood glucose concentration feature, the third binary number is used to represent the selection of the blood pressure level feature, the fourth binary number is used to represent the selection of the triceps skinfold thickness feature, the fifth binary number is used to represent the selection of the insulin level feature, the sixth binary number is used to represent the selection of the body mass index feature, the seventh binary number is used to represent the selection of the family inheritance rate of diabetes feature, and the eighth binary number is used to represent the selection of the age feature.

[0078] Here, it can be agreed that a binary number of 1 indicates that the corresponding feature is selected, and a binary number of 0 indicates that the corresponding feature is not selected; or, alternatively, a binary number of 0 indicates that the corresponding feature is selected, and a binary number of 1 indicates that the corresponding feature is not selected. This application does not limit this. The following description uses the example of a binary number of 1 indicating that the corresponding feature is selected, and a binary number of 0 indicating that the corresponding feature is not selected.

[0079] For example, to facilitate understanding, the feature selection result set can be represented in the form of a matrix. For example, assuming that there are 10 feature selection results in the initialized feature selection result set, the feature selection result set can be represented as a 10-row × 10-column matrix, where each row represents a feature selection result, as shown below:

[0080]

[0081] Assume that there is a feature selection result in the feature selection result set as [0,1,1,0,0,0,0,0]. Since the second and third binary digits of the feature selection result are 1, the feature selection result indicates that the blood glucose concentration feature and the blood pressure level feature are selected to train the diabetes prediction model.

[0082] Step 102: For any feature selection result in the feature selection result set, determine the fitness of the feature selection result based on the prediction results of multiple samples constructed based on the feature selection result under a preset classifier; the prediction result represents a prediction indication of whether the sample has diabetes.

[0083] Exemplarily, the present application uses fitness to select the current best feature selection result. The calculation of fitness depends on the classifier. After comparing multiple classifiers, for example, the naive Bayes classifier, the K-nearest neighbor classifier, and the random forest classifier, it is determined that the random forest classifier is more accurate in predicting whether the input sample has diabetes. Therefore, the present application uses the random forest classifier to obtain the prediction results of multiple samples constructed based on the feature selection results.

[0084] Exemplarily, after obtaining the feature selection result set through step 101, a sample can be constructed based on the feature selection results in the feature selection result set. For any sample constructed by the feature selection result, the sample is input into the random forest classifier to obtain a prediction indication of the sample; then, based on the prediction indications of multiple samples and the true labels of multiple samples, the misjudgment results of the feature selection results are determined; finally, the fitness of the feature selection results is determined based on the misjudgment results of the feature selection results; wherein, misjudgment means that after a sample is constructed based on the feature selection results, the sample is input into the random forest classifier, and the prediction result output by the random forest classifier indicates that the sample has diabetes, while the true label of the sample in the data set is not diabetes; generally speaking, the misjudgment result is a decimal in the range of 0 to 1, for example, the misjudgment result is 0.8. The fitness can be calculated using the following formula:

[0085]

[0086] Among them, Ω is the preset parameter, is the misjudgment result of the feature selection result, is the number of binary numbers that are 1 in the feature selection result. For example, taking the feature selection result [0,1,1,0,0,0,0,0] in the feature selection result set as an example, the number of binary numbers that are 1 in the feature selection result set is Then it is 2.

[0087] For example, assuming Ω is 0.5 and the error rate of the feature selection result [0, 1, 1, 0, 0, 0, 0] is 0.8, then the fitness of the feature selection result = 0.5 × (1-0.8) + (1-0.5) = 0.1 + 0.5 = 0.6.

[0088] By adopting the above calculation method, the fitness of each feature selection result in the feature selection result set is calculated in sequence, and the fitness of each feature selection result can be obtained.

[0089] Step 103: Determine the feature selection result with the best fitness in the feature selection result set.

[0090] Illustratively, through step 102, the fitness of each feature selection result in the feature selection result set is obtained, and the feature selection result with the highest fitness score is determined as the feature selection result with the best fitness in the feature selection result set.

[0091] For example, assuming that there are 10 feature selection results in the feature selection result set, the fitness of these 10 feature selection results are 0.2, 0.1, 0.2, 0.2, 0.15, 0.3, 0.5, 0.32, 0.6, and 0.45 respectively. It can be seen that the fitness score of the 9th feature selection result is the highest. Therefore, the 9th feature selection result is determined as the feature selection result with the best fitness.

[0092] Step 104: Based on the feature selection result with the best fitness in the feature selection result set of the t-1th round, iteratively update each feature selection result in the feature selection result set of the t-1th round to obtain the feature selection result set of the tth round.

[0093] For example, in order to obtain more different feature selection results and increase the probability of feature selection results with better fitness, the present application performs multiple rounds of iterative updates on each feature selection result based on the exploration iteration process and development iteration process of the raccoon algae algorithm. A complete round of iterative update means that each feature selection result in the feature selection result set is iterated once. For example, there are 10 feature selection results in the feature selection result set before the iteration. It is a complete round of iterative update only after these 10 feature selection results are iterated once. After one round of iterative update, the number of feature selection results in the feature selection result set increases from 10 to 20.

[0094] Before each round of iteration, a first random number is first determined. The first random number can be denoted as r. The present application does not limit the method for determining the first random number. For example, a random algorithm can be used to determine the first random number, and then the exploration iteration process of the Hezao algorithm or the development iteration process of the Hezao algorithm is determined based on the first random number. Specifically: if the first random number is less than a preset value, the exploration iteration process of the Hezao algorithm is adopted, and based on the feature selection result with the best fitness in the feature selection result set of the t-1 round, each feature selection result in the feature selection result set of the t-1 round is iteratively updated; correspondingly, if the first random number is greater than or equal to the preset value, the development iteration process of the Hezao algorithm is adopted, and based on the feature selection result with the best fitness in the feature selection result set of the t-1 round, each feature selection result in the feature selection result set of the t-1 round is iteratively updated.

[0095] For example, assuming that the preset value is 0.5, before the first round of iteration, the first random number determined is 0.3. Since the first random number 0.3 is smaller than the preset value 0.5, the first round of iteration adopts the exploration iteration process of the raccoon algae algorithm.

[0096] For example, the process of iterating the feature selection results using the exploration iteration process of the raccoon algae algorithm is first explained. The feature selection results after iterative update can be determined by the following calculation formula:

[0097] p(t)=p(t-1)+W1(2K+r1)

[0098] Among them, p(t-1) is the feature selection result in the feature selection result set of the t-1th round; W1 is r2×(KP best+2K), P best It is the result of converting the feature selection result with the best current fitness into a decimal number, K is r1 and r2 are random numbers determined before each round of iteration.

[0099] It should be noted that p(t-1) is the result of converting the feature selection result before iteration into a decimal number. For example, if the feature selection result before iteration is [0,1,1,0,0,0,0,0], the decimal p(t-1) is 64. 1 +32 1 =96; similarly, P best It is the result of converting the current best fitness feature selection result into a decimal number. Obviously, the calculation result p(t) is a decimal number. It is necessary to convert p(t) into a binary number and then use it as the feature selection result after iterative update. If p(t) is a non-integer, round p(t) up and then convert it. For example, if p(t) is 6.4, round it up to 7 and convert it into a binary number [0,0,0,0,0,1,1,1], and use [0,0,0,0,0,1,1,1] as the feature selection result after iterative update.

[0100] W1 in the exploration and iteration process of the Hezao algorithm is independent of the feature selection results in the feature selection result set of the t-1th round, and p(t) is also related to the random number r1. Therefore, the feature selection result p(t) after the iteration determined in the exploration and iteration process of the Hezao algorithm is more jumpy and has a large difference from the feature selection result p(t-1) before the iteration, which increases the possibility of obtaining different feature selection results.

[0101] Further exemplarily, if the exploration iteration process of the raccoon algae algorithm is used to iteratively update each feature selection result in the feature selection result set of the t-1th round, and there is at least one feature selection result that has not changed after the preset number of iterations, then Gaussian distribution perturbation is introduced to iteratively update at least one feature selection result to obtain a new feature selection result. For example, if there is a feature selection result that has not changed after 3 rounds of iteration, then Gaussian distribution perturbation is introduced to obtain a new feature selection result; wherein, the characteristic of Gaussian distribution perturbation is randomness, and this randomness makes the impact of the perturbation more unpredictable, which can help to explore the search space more widely, increase the chance of finding the feature selection result with the best global fitness, and make full use of the characteristics of Gaussian distribution perturbation. After the introduction of Gaussian distribution perturbation, the calculation formula of p(t) is updated to:

[0102]

[0103] Among them, Gaussian is the Gaussian program, μ pis the mean of the feature selection results with the best fitness after t-1 rounds of iteration converted into decimal numbers, σ is the current feature selection result and μ p The variance of p(t-1) is the result of converting the feature selection result before iteration into a decimal number, and K is P best It is the result of converting the current best fitness feature selection result into a decimal number.

[0104] For example, the following further explains the process of iterating the feature selection results using the iterative development process of the raccoon algae algorithm. The feature selection results after iterative update can be determined by the following calculation formula:

[0105] p(t)=p(t-1)+KW2

[0106] Among them, p(t-1) is the feature selection result in the feature selection result set of the t-1th round, W2 is r3×(KP best +r3p(t-1)), K is P best It is the result of converting the current best fitness feature selection result into a decimal number, and r3 is a random number determined before each round of iteration.

[0107] In the iterative development process of the raccoon algae algorithm, W2 is related to the feature selection result p(t-1) before the iteration. Therefore, W2 is more closely associated with the feature selection result before the iteration. Then, the feature selection result p(t) after the iteration is determined based on W2 and the feature selection result p(t-1) before the iteration, which can make p(t) and p(t-1) more closely associated. In other words, the difference between the feature selection result p(t) after the iteration and the feature selection result p(t-1) before the iteration is smaller.

[0108] Similarly, if the iterative development process of the raccoon algae algorithm is used to iteratively update each feature selection result in the feature selection result set of round t-1, and at least one feature selection result remains unchanged after a preset number of iterations, a sinusoidal perturbation is introduced to iteratively update at least one feature selection result to obtain a new feature selection result. After the sinusoidal perturbation is introduced, the calculation formula of p(t) is updated to:

[0109]

[0110] Among them, r1 is the random number determined before each round of iteration, and K is also F and C are random numbers in the range of -5 to 5, and θ is a parameter for adjusting the period of the sine function.

[0111] The iterative development process of the Hezao algorithm expects that the feature selection results after iteration are slightly different from those before iteration. The characteristic of sinusoidal perturbation is periodicity, which is manifested as fluctuations around the feature selection results. Therefore, the feature selection results after iteration determined based on sinusoidal perturbation are slightly different from those before iteration, which fully utilizes the characteristics of sinusoidal perturbation.

[0112] After each round of iteration, the fitness of the new feature selection result needs to be calculated to determine whether to update the feature selection result with the best fitness determined after the previous round of iteration. For example, the fitness score of the feature selection result with the best fitness determined after the previous round of iteration is 0.6. After calculating the fitness of the new feature selection result in this round, there is a new feature selection result with a fitness score of 0.7, which is greater than 0.6. Then, the feature selection result is used to replace the feature selection result with the best fitness determined after the previous round of iteration. Otherwise, the feature selection result with the best fitness determined after the previous round of iteration remains unchanged.

[0113] According to the above content, whether it is the exploration iteration process or the development iteration process of the raccoon algae algorithm, the calculation formula of the feature selection result after iteration involves the parameter K, and K gradually decreases with the increase of the number of iteration rounds. The decrease of K makes the search gradually focus on the feature selection result with the best fitness for fine search, so that the method proposed in this application can effectively utilize each round of iteration and improve efficiency.

[0114] Step 105: Based on the feature selection result set of the mth round when the iteration termination condition is satisfied, determine that the feature selection result with the best fitness in the feature selection result set of the mth round is the N best features related to diabetes prediction, where N is a positive integer and N is less than or equal to M.

[0115] Exemplarily, before iteration, the maximum number of iteration rounds m is determined. Relevant technicians can set the maximum number of iteration rounds based on empirical values, for example, setting the maximum number of iteration rounds to 30; satisfying the iteration termination condition means that the number of iteration rounds has reached the maximum number of iteration rounds. Still taking m as 30 as an example, when the 30th round of iteration is completed, the iteration is terminated, and the feature selection result with the best fitness in the feature selection result set of the 30th round is determined as N features related to diabetes prediction. For example, assuming that the feature selection result with the best fitness in the feature selection result set of the 30th round is [1, 0, 1, 1, 0, 0, 1, 0], it means that N is 4, and a total of 4 optimal features are determined, namely, the number of pregnancies, blood glucose concentration, triceps skin fold thickness and family inheritance rate of diabetes. When the above 4 optimal features are used to train the diabetes prediction model, better accuracy can be obtained.

[0116] The above steps 100 to 105 can also refer to Figure 2 The process diagram shown is Figure 2 Where t is the number of rounds of the current iteration, and i is the order of the feature selection results of the current iteration in the feature selection result set. According to step 101, the feature selection result set can be regarded as a matrix. Then, the number of rows of the feature selection results in the matrix can be used as the order of the feature selection results in the feature selection result set. For example, when iterating the feature selection results of the third row in the matrix, i is 3.

[0117] Figure 3 and Figure 4 This is a schematic diagram of a possible diabetes prediction model feature selection device provided in an embodiment of the present application. These diabetes prediction model feature selection devices can be used to implement the server functions in the above method embodiments, thereby also achieving the beneficial effects of the above method embodiments.

[0118] like Figure 3 As shown, the diabetes prediction model feature selection device 300 includes a determination module 301, an initialization module 302 and an iteration module 303. When the diabetes prediction model feature selection device is used to implement Figure 1 The functions of the server in the method embodiment shown are:

[0119] The determining module 301 is configured to determine M features to be selected that are relevant to diabetes prediction, where M is a positive integer; the M features to be selected include at least one of the number of pregnancies, blood glucose concentration, blood pressure level, triceps skinfold thickness, insulin level, body mass index, family heritability of diabetes, and age;

[0120] The initialization module 302 is used to initialize the feature selection result set. Any feature selection result in the feature selection result set is composed of M-bit binary numbers, and the M-bit binary numbers are used to represent the selection status of the M features to be selected; the total number of feature selection results in the feature selection result set is less than 2 M -1;

[0121] The determining module 301 is further configured to determine the fitness of any one of the feature selection results in the feature selection result set based on the prediction results of multiple samples constructed from the feature selection results under a preset classifier; the prediction result represents a prediction indication of whether the sample suffers from diabetes;

[0122] The determining module 301 is further configured to determine the feature selection result with the best fitness in the feature selection result set;

[0123] The iteration module 303 is configured to iteratively update each feature selection result in the feature selection result set of the t-1th round based on the feature selection result with the best fitness in the feature selection result set of the t-1th round, to obtain the feature selection result set of the tth round;

[0124] The determination module 301 is further used to determine, based on the feature selection result set of the mth round when the iteration termination condition is met, that the feature selection result with the best fitness in the feature selection result set of the mth round is the N best features related to diabetes prediction, where N is a positive integer and N is less than or equal to M.

[0125] In one possible design, the determination module 301 is specifically used to input any sample constructed from the feature selection result into a random forest classifier to obtain a prediction indication of the sample; determine the misjudgment result of the feature selection result based on the prediction indications of multiple samples and the true labels of multiple samples; and determine the fitness of the feature selection result based on the misjudgment result of the feature selection result.

[0126] In one possible design, the iteration module 303 is specifically configured to determine a first random number before each round of iteration;

[0127] If the first random number is less than a preset value, the exploration iteration process of the raccoon algae algorithm is used to iteratively update each feature selection result in the feature selection result set of the t-1 round based on the feature selection result with the best fitness in the feature selection result set of the t-1 round;

[0128] If the first random number is greater than or equal to the preset value, the development iteration process of the raccoon algae algorithm is adopted, and each feature selection result in the feature selection result set of the t-1 round is iteratively updated based on the feature selection result with the best fitness in the feature selection result set of the t-1 round.

[0129] In one possible design, the iteration module 303 is specifically configured to use the exploration iteration process of the raccoon algae algorithm to iteratively update each feature selection result in the feature selection result set of the t-1th round, and the calculation formula of the feature selection result p(t) obtained is:

[0130] p(t)=p(t-1)+W1(2K+r1)

[0131] Among them, p(t-1) is the feature selection result in the feature selection result set of the t-1th round; W1 is r2×(KP best +2K), P best is the feature selection result with the best fitness in the feature selection result set of the t-1 round, K is r1 and r2 are random numbers determined before each round of iteration.

[0132] In one possible design, the further step includes: if, when the exploration iterative process of the raccoon algae algorithm is used to iteratively update each feature selection result in the feature selection result set of the t-1th round, at least one feature selection result remains unchanged after a preset number of iterations, the iteration module 303 introduces Gaussian distribution perturbation to iteratively update the at least one feature selection result to obtain a new feature selection result.

[0133] In one possible design, the iteration module 303 is specifically configured to use the development iteration process of the raccoon algae algorithm to iteratively update each feature selection result in the feature selection result set of the t-1th round, and the calculation formula of the feature selection result p(t) obtained is:

[0134] p(t)=p(t-1)+KW2

[0135] Among them, p(t-1) is the feature selection result in the feature selection result set of the t-1th round, W2 is r3×(KP best +r3P(t-1)), K is P best is the feature selection result with the best fitness in the feature selection result set of round t-1, and r3 is the random number determined before each round of iteration.

[0136] In one possible design, the further step includes: if, when iteratively updating each feature selection result in the feature selection result set of the t-1th round using the development iteration process of the raccoon algae algorithm, at least one feature selection result remains unchanged after a preset number of iterations, the iteration module 303 introduces a sinusoidal perturbation to iteratively update the at least one feature selection result to obtain a new feature selection result.

[0137] For a more detailed description of the determination module 301, the initialization module 302 and the iteration module 303, please refer to Figure 1 The relevant description in the method embodiment shown is directly obtained and will not be repeated here.

[0138] like Figure 4 As shown, the diabetes prediction model feature extraction device 400 includes a processor 410 and an interface circuit 420. The processor 410 and the interface circuit 420 are coupled to each other. It is understood that the interface circuit 420 can be a transceiver or an input / output interface. Optionally, the diabetes prediction model feature extraction device 400 may further include a memory 430 for storing instructions executed by the processor 410, input data required by the processor 410 to execute instructions, or data generated after the processor 410 executes instructions.

[0139] When the diabetes prediction model feature selection device 400 is used to implement Figure 1 In the method shown, the processor 410 is used to implement the functions of the above-mentioned determination module 301 and initialization module 302, and the interface circuit 420 is used to implement the function of the above-mentioned iteration module 303.

[0140] The division of units in the embodiments of the present application is illustrative and is merely a logical functional division. In actual implementation, other division methods may be used. Furthermore, the functional units in the various embodiments of the present application may be integrated into a single processor, or may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.

[0141] Although the preferred embodiments of the present application have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present application.

[0142] Obviously, those skilled in the art may make various changes and modifications to the present application without departing from the scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is intended to include these modifications and variations.

Claims

1. A diabetes prediction model feature selection method, characterized in that: The method includes: Determine M features to be selected that are related to diabetes prediction; M is a positive integer; the M features to be selected include at least one of the number of pregnancies, blood sugar concentration, blood pressure level, triceps skinfold thickness, insulin level, body mass index, family inheritance rate of diabetes, and age; Initialize a feature selection result set, wherein any feature selection result in the feature selection result set is composed of M-bit binary numbers, and the M-bit binary numbers are respectively used to represent the selection conditions of the M features to be selected; the total number of feature selection results in the feature selection result set is less than; For any one of the feature selection results in the feature selection result set, the fitness of the feature selection result is determined according to the prediction results of multiple samples constructed by the feature selection result under a preset classifier; the prediction result represents a prediction indication of whether the sample suffers from diabetes; Determine the feature selection result with the best fitness in the feature selection result set; Based on the feature selection result with the best fitness in the feature selection result set of the t-1th round, iteratively update each feature selection result in the feature selection result set of the t-1th round to obtain the feature selection result set of the tth round; Based on the feature selection result set of the mth round when the iteration termination condition is met, determine that the feature selection result with the best fitness in the feature selection result set of the mth round is the N best features related to diabetes prediction, where N is a positive integer and N is less than or equal to M.

2. The method according to claim 1, characterized in that The prediction results of the plurality of samples constructed according to the feature selection results under a preset classifier, and determining the fitness of the feature selection results, include: For any sample constructed by the feature selection result, input the sample into a random forest classifier to obtain a prediction indication of the sample; Determining misjudgment results of the feature selection results according to the prediction indications of the multiple samples and the true labels of the multiple samples; Based on the misjudgment result of the feature selection result, the fitness of the feature selection result is determined.

3. The method according to claim 1, characterized in that Based on the feature selection result with the best fitness in the feature selection result set of the t-1th round, each feature selection result in the feature selection result set of the t-1th round is iteratively updated, including: Before each round of iteration, a first random number is determined; If the first random number is less than a preset value, the exploration iteration process of the raccoon algae algorithm is used to iteratively update each feature selection result in the feature selection result set of the t-1 round based on the feature selection result with the best fitness in the feature selection result set of the t-1 round; If the first random number is greater than or equal to the preset value, the development iteration process of the raccoon algae algorithm is adopted, and each feature selection result in the feature selection result set of the t-1 round is iteratively updated based on the feature selection result with the best fitness in the feature selection result set of the t-1 round.

4. The method according to claim 3, characterized in that The exploration and iteration process using the raccoon algae algorithm iteratively updates each feature selection result in the feature selection result set of the t-1 round based on the feature selection result with the best fitness in the feature selection result set of the t-1 round, including: The calculation formula of the feature selection result p(t) obtained by iteratively updating each feature selection result in the feature selection result set of the t-1th round using the exploration iteration process of the raccoon algae algorithm is: p(t)=p(t-1)+W1(2K+r1) Among them, p(t-1) is the feature selection result in the feature selection result set of the t-1th round; W1 is r2×(KP best +2K), P best is the feature selection result with the best fitness in the feature selection result set of the t-1th round, K is r1 and r2 are random numbers determined before each round of iteration.

5. The method according to claim 3, characterized in that Also includes: If the exploration iteration process of the raccoon algae algorithm is used to iteratively update each feature selection result in the feature selection result set of the t-1th round, and there is at least one feature selection result that has not changed after a preset number of iterations, then Gaussian distribution perturbation is introduced to iteratively update the at least one feature selection result to obtain a new feature selection result.

6. The method according to claim 3, characterized in that The development iteration process using the raccoon algae algorithm, based on the feature selection result with the best fitness in the feature selection result set of the t-1 round, iteratively updates each feature selection result in the feature selection result set of the t-1 round, including: The calculation formula of the feature selection result p(t) obtained by iteratively updating each feature selection result in the feature selection result set of the t-1th round using the development iteration process of the raccoon algae algorithm is: p(t)=p(t-1)+KW2 Among them, p(t-1) is the feature selection result in the feature selection result set of the t-1th round, W2 is r3×(KP best +r3P(t-1)), K is P best is the feature selection result with the best fitness in the feature selection result set of the t-1th round, and r3 is a random number determined before each round of iteration.

7. The method according to claim 3, characterized in that Also includes: If the development iteration process of the raccoon algae algorithm is used to iteratively update each feature selection result in the feature selection result set of the t-1th round, and there is at least one feature selection result that has not changed after a preset number of iterations, a sinusoidal perturbation is introduced to iteratively update the at least one feature selection result to obtain a new feature selection result.

8. A diabetes prediction model feature selection device, characterized in that: The device comprises a determination module, an initialization module and an iteration module; The determination module is used to determine M features to be selected that are related to diabetes prediction, where M is a positive integer; the M features to be selected include at least one of the number of pregnancies, blood sugar concentration, blood pressure level, triceps skinfold thickness, insulin level, body mass index, family inheritance rate of diabetes, and age; The initialization module is used to initialize the feature selection result set, and any feature selection result in the feature selection result set is composed of M-bit binary numbers, and the M-bit binary numbers are used to represent the selection of the M features to be selected; the total number of feature selection results in the feature selection result set is less than 2 M -1; The determination module is further used to determine the fitness of any one of the feature selection results in the feature selection result set according to the prediction results of multiple samples constructed by the feature selection result under a preset classifier; the prediction result represents a prediction indication of whether the sample suffers from diabetes; The determination module is further used to determine the feature selection result with the best fitness in the feature selection result set; The iteration module is used to iteratively update each feature selection result in the feature selection result set of the t-1 round based on the feature selection result with the best fitness in the feature selection result set of the t-1 round, so as to obtain the feature selection result set of the t round; The determination module is also used to determine, based on the feature selection result set of the mth round when the iteration termination condition is met, that the feature selection result with the best fitness in the feature selection result set of the mth round is the N best features related to diabetes prediction, where N is a positive integer and N is less than or equal to M.

9. A diabetes prediction model feature selection device, characterized in that: include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory to implement the method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, which are used to implement the method according to any one of claims 1 to 7 when executed by a processor.

11. A computer program product, characterized in that The invention comprises a computer program, which implements the method according to any one of claims 1 to 7 when being executed by a processor.

Citation Information

Patent Citations

  • Feature selection method and device for medical data of disease categories

    CN110322968A

  • Enhanced PID (Proportion Integration Differentiation) control optimization method for disinfection robot

    CN117850213A