Modeling feature screening method and device, medium and product
By combining multi-dimensional evaluation and genetic algorithms, feature combinations with strong adaptability and good generalization ability are selected, which solves the limitations of existing feature selection methods in terms of efficiency and adaptability, and achieves efficient and accurate feature selection.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CHINA MOBILE SHANGHAI ICT CO LTD
- Filing Date
- 2026-01-12
- Publication Date
- 2026-05-05
AI Technical Summary
Existing feature selection methods have limitations in terms of efficiency, generalization and model adaptability. In particular, in credit risk control scenarios, existing methods are unable to efficiently select feature combinations with strong adaptability and good generalization ability.
A multi-dimensional evaluation method combined with a genetic algorithm is adopted. The first U chromosomes are selected through V evaluation methods, and multiple rounds of iterative optimization are performed. After deduplication, the highest-ranking candidate feature combination is selected to ensure that the feature combination performs well in multiple dimensions and is suitable for specific modeling scenarios.
It improves the accuracy and efficiency of feature selection, avoids local optima traps, enhances the generalization ability of feature combinations, and ensures that the selected feature combinations perform consistently and are highly adaptable in different scenarios.
Smart Images

Figure CN121980231A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of artificial intelligence technology, specifically to a modeling feature selection method, apparatus, medium, and product. Background Technology
[0002] Model building in the current data science industry often involves filtering features from multiple categories and formats. In credit risk control scenarios, developers need to acquire extremely complex data from multiple channels, and the selection of input features largely determines the model's final performance. Inappropriate feature selection fails to provide sufficient information for model prediction; while detailed exploration of each feature consumes a significant amount of time, potentially extending the model development cycle. Currently, the mainstream feature selection methods in the data science industry are filtering, wrapping, and embedding methods.
[0003] The above schemes have the following disadvantages: (1) The filtering method has low efficiency in feature selection. The focus of each filtering condition is different. For example, correlation can only consider linear relationships, chi-square test cannot handle discrete variables, and it is difficult to consider the synergistic effect between different features. Secondly, the logic of the filtering process itself is easily affected by noise and may not be compatible with the corresponding model, resulting in the deletion of variables that play an important role in model prediction. (2) The packaging method is based on a greedy algorithm, so the running efficiency is very low, especially for models that require long-term budgeting. Secondly, the combination of features may fall into local optima. That is, when two features need to work together to produce an effect, the forward search method may discard two features that have a synergistic effect after combination. (3) The embedding method is limited by specific models. For example, feature importance can only be used by tree models. The balance of regularization may also lead to result bias. In addition, this method will increase the training burden of the model and reduce the training efficiency of the model. Summary of the Invention
[0004] At least one embodiment of this application provides a modeling feature selection method, apparatus, medium, and product to address the limitations of existing feature selection methods in terms of efficiency, generalization, and model adaptability.
[0005] To solve the above-mentioned technical problems, this application is implemented as follows:
[0006] In a first aspect, embodiments of this application provide a modeling feature selection method, including:
[0007] Receive sample data input by the user;
[0008] Using the training set and the test set, V different evaluation methods are used for evaluation. Based on each evaluation method, the corresponding first U chromosome is obtained, and a set of candidate feature combinations associated with the evaluation method and the chromosome is determined.
[0009] The candidate feature combination set is ranked by fitness, and the combination feature with the highest ranking is selected as the target feature.
[0010] Optionally, using the sample data, V different evaluation methods are employed for evaluation, and based on the pre-U chromosome obtained from each evaluation method, a set of candidate feature combinations associated with the evaluation method and the chromosome is determined, including:
[0011] Using the sample data, the evaluation result corresponding to each evaluation method is determined; the evaluation result is used to represent the fitness calculation rule based on the corresponding evaluation method.
[0012] During the evaluation process of each evaluation method, the chromosome with the highest fitness ranking (U position) in the evaluation method is determined based on the evaluation results and the preset genetic algorithm.
[0013] The pre-U chromosomes corresponding to each evaluation method are deduplicated to obtain a set of candidate feature combinations associated with the evaluation method and chromosome.
[0014] Optionally, when the evaluation method includes model prediction evaluation, the evaluation result corresponding to each evaluation method is determined using the sample data, including:
[0015] The sample data is preprocessed to determine the training set and the test set;
[0016] The training set and the test set are modeled and predicted according to the preset prediction model, and the prediction results of the training set and the test set are output respectively.
[0017] Select at least one classification or regression performance index, and convert the minimum value index in the prediction results of the training set and the test set into the maximum value form respectively, and determine the corresponding training set evaluation index and test set evaluation index.
[0018] The evaluation result is determined based on the training set evaluation metric, the test set evaluation metric, and the ratio of the total number of features to the currently selected number of features.
[0019] Optionally, when the evaluation method includes feature vector partitioning evaluation, the evaluation result corresponding to each evaluation method is determined using the sample data, including:
[0020] Based on the sample data, determine the total number of categories, the total number of samples, the number of samples in a single category, the overall mean vector, the mean vector of a single category, and the individual vector in a single category.
[0021] The overall intra-class scatter matrix is determined based on the total number of categories, the total number of samples, the number of samples in a single category, the mean vector of a single category, and the individual vectors in a single category.
[0022] The overall inter-class scatter matrix is determined based on the total number of categories, the total number of samples, the number of samples in a single category, the overall mean vector, and the mean vector of a single category.
[0023] Based on the overall intra-class scatter matrix and the overall inter-class scatter matrix, the evaluation results are determined using either the intra-class and inter-class distance method or the Fisher criterion.
[0024] Optionally, when the evaluation method includes feature vector partitioning evaluation, determining the evaluation result corresponding to each evaluation method using the sample data further includes:
[0025] The sample data is standardized, and the difference between the mean of the standardized features in the target category samples and the mean of the standardized features in the non-target category samples is calculated to determine the importance matrix between the features and the categories.
[0026] Based on the importance matrix, the average feature contribution and the contribution of highly important features are calculated; the average feature contribution is used to represent the overall predictive power of the features; the contribution of highly important features is used to represent features whose contribution is higher than the average feature contribution.
[0027] The evaluation results are determined based on the average feature contribution and the high-importance feature contribution.
[0028] Optionally, during the evaluation process of each evaluation method, determining the chromosome with the highest fitness ranking (U position) in the evaluation method based on the evaluation results and a preset genetic algorithm includes:
[0029] During the evaluation process of each evaluation method, N chromosomes are randomly generated as the initial population; the gene sequence of each chromosome is used to characterize a set of candidate feature combinations; the size of the initial population and the gene length are respectively adapted to the population size and the total number of features to be screened in the initial population.
[0030] The iteration process is executed according to the preset total number of iterations, and in each iteration, based on the evaluation results of the evaluation method, the fitness metric is calculated for all chromosomes in the current population, and selection, genetics, and mutation operations are executed in sequence; wherein, in the first iteration, the current population is the initial population;
[0031] After the preset total number of iterations, the chromosome with the highest fitness (U position) among all chromosomes in the entire iteration process is retained.
[0032] Optionally, ranking each set of candidate feature combinations and selecting the combined feature from the highest-ranked set of candidate feature combinations as the target feature includes:
[0033] For each candidate feature set, for any combination feature in the candidate feature combination set, the square of the chromosome ranking under the corresponding evaluation method is used as the score calculation rule for the feature combination.
[0034] According to the scoring calculation rules, the sum of the scores of all combined features in the candidate feature combination set is taken as the total score of the candidate feature combination set, and the combined feature in the candidate feature combination set with the highest ranking is selected as the target feature.
[0035] Secondly, embodiments of this application provide a modeling feature filtering device, including:
[0036] The first processing module is used to receive sample data input by the user;
[0037] The second processing module is used to evaluate the sample data using V different evaluation methods, and based on the first U chromosomes obtained by each evaluation method, to determine a set of candidate feature combinations associated with the evaluation method and the chromosome.
[0038] The third processing module is used to rank each set of candidate feature combinations and select the combined feature from the set of candidate feature combinations with the highest ranking as the target feature.
[0039] Thirdly, embodiments of this application provide a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the method as described in any one of the first aspects.
[0040] Fourthly, embodiments of this application provide a computer program product, including computer instructions that, when executed by a processor, implement the steps of the method as described in any one of the first aspects.
[0041] Compared with existing technologies, the modeling feature screening method, apparatus, medium, and product provided in this application solve the limitations of existing methods in terms of efficiency, generalization, and model adaptability through a collaborative design of multi-dimensional evaluation coverage, efficient iterative screening, and targeted adaptation optimization. On the one hand, by using V different evaluation methods, different core requirements for feature selection are covered, avoiding the bias of a single evaluation standard. At the same time, the genetic algorithm is used to retain only the first U high-fitness chromosomes through multiple rounds of iteration, improving the screening accuracy. On the other hand, the cross-validation of multiple evaluation methods and the construction of candidate sets after deduplication break the dependence of a single method on specific data distributions or scenarios, allowing candidate feature combinations to undergo multi-dimensional performance verification, effectively avoiding local optimum traps, and enhancing the generalization ability of feature combinations. Attached Figure Description
[0042] Various other advantages and benefits will become apparent to those skilled in the art upon reading the following detailed description of preferred embodiments. The accompanying drawings are for illustrative purposes only and are not intended to limit the scope of this application. Furthermore, the same reference numerals denote the same parts throughout the drawings. In the drawings:
[0043] Figure 1 A flowchart illustrating the modeling feature selection method provided in this application embodiment;
[0044] Figure 2 This is a schematic diagram of the structure of the modeling feature screening device provided in the embodiments of this application. Detailed Implementation
[0045] The terms "first," "second," etc., used in this application are used to distinguish similar objects and not to describe a specific order or sequence. It should be understood that such terms can be used interchangeably where appropriate so that embodiments of this application can be implemented in orders other than those illustrated or described herein, and the objects distinguished by "first" and "second" are generally of the same class, without limiting the number of objects; for example, the first object can be one or more. Furthermore, "or" in this application indicates at least one of the connected objects. For example, "A or B" covers three scenarios: Scenario 1: including A but not B; Scenario 2: including B but not A; Scenario 3: including both A and B. The character " / " generally indicates that the preceding and following objects are in an "or" relationship.
[0046] The term "instruction" in this application can be either a direct instruction (or explicit instruction) or an indirect instruction (or implicit instruction). A direct instruction can be understood as one in which the sender explicitly informs the receiver of specific information, the operation to be performed, or the requested result, etc.; an indirect instruction can be understood as one in which the receiver determines the corresponding information based on the instruction sent by the sender, or makes a judgment and determines the operation to be performed or the requested result, etc., based on the judgment result.
[0047] To enable those skilled in the art to better understand the embodiments of this application, the following description is provided first:
[0048] Genetic algorithms are a type of global optimization search algorithm widely used in optimization and search problems. Their principle simulates evolutionary theory, such as natural selection and genetic inheritance. They use randomization techniques to search for near-optimal feature combinations in a large feature subset space. Therefore, they do not require direct calculation through differentiation or functions and are widely used in engineering, scientific research and other fields.
[0049] However, traditional genetic algorithm feature selection schemes still have shortcomings. If the fitness function is poorly designed, the genetic algorithm may favor the feature set that performs best on the training set, but these feature combinations may overfit to unseen data, resulting in poor performance on the test set. Furthermore, unconstrained genetic algorithms may tend to select as many features as possible to maximize training performance, violating the initial goal of dimensionality reduction and leading to a complex and difficult-to-interpret model. This is especially true in microcredit risk control scenarios, where high data noise and extremely imbalanced fraud samples further exacerbate the risks of model overfitting and generalization failure. Current technologies lack a feature selection scheme that combines business scenario requirements with a balance between model performance and simplicity.
[0050] This application provides a modeling feature screening method, apparatus, medium, and product. The method and apparatus are based on the same concept, and since they solve problems based on similar principles, their implementations can be mutually referenced; repeated details will not be repeated.
[0051] Please refer to Figure 1 This application provides a modeling feature selection method, including:
[0052] Step 11: Receive sample data input by the user.
[0053] Here, the sample data contains the original features to be screened and their corresponding labels or target values. Sample data refers to a dataset containing multiple features and corresponding prediction targets, serving as the original input for feature screening. Step 11 is the foundational preparation stage for feature screening, ensuring data quality and the effectiveness of the screening process. First, the user-inputted raw sample data (including feature variables and corresponding label information) is received. Then, data preprocessing operations are performed, such as cleaning outliers, filling missing values, standardizing data formats, and eliminating differences in feature dimensions, adapting to the computational needs of subsequent multivariate evaluation methods. Finally, the preprocessed complete data is divided into training and test sets according to a preset ratio or rule. The training set supports model training, genetic algorithm iterative optimization, and fitness calculation in subsequent rounds of evaluation. The test set is used to verify the predictive performance and generalization ability of feature combinations, avoiding overfitting problems caused by using data in isolation, and providing reliable data support for subsequent feature screening.
[0054] Step 12: Using the sample data, evaluate using V different evaluation methods, and based on the pre-U chromosome obtained by each evaluation method, determine the set of candidate feature combinations associated with the evaluation method and the chromosome.
[0055] In this application, pre-defined sample data (including training and test sets) is used as the evaluation basis to ensure consistency in the verification scenarios of all evaluation methods and guarantee the comparability of the screening results. V different evaluation methods are employed, each containing unique fitness calculation rules and independent iterative optimization parameters. Different fitness calculation rules are used to measure the suitability of feature combinations from different dimensions; independent iterative optimization parameters are used to adapt to the optimization needs of different feature combinations. Through the design of multi-dimensional evaluation methods, the performance dimensions of feature combinations are comprehensively covered, avoiding the omission of high-quality combinations due to a single standard. Chromosomes are used as the encoding carrier for feature combinations, with the structure of the chromosomes matching the total number of features to be screened, ensuring that each chromosome uniquely corresponds to a set of feature combinations. For each evaluation method, a genetic algorithm is used to perform multiple rounds of iterative optimization. Each iteration scores the suitability of the currently generated feature combinations (chromosomes) based on the fitness calculation rules of that evaluation method. Finally, only the chromosomes with the top U fitness rankings during the iteration process under that evaluation method are retained, i.e., high-quality feature combinations, ensuring a high-quality threshold for selected combinations. After all V evaluation methods have completed iterative selection, the top U feature combinations output by all evaluation methods are collected. Duplicate combinations are removed through deduplication, ultimately forming a candidate feature combination set. The size of this set is strictly controlled to not exceed V×U, that is, the number of evaluation methods × the number of top U features retained for each evaluation method. This avoids redundant data consuming computational resources and retains high-quality combinations from different dimensions through the design of multivariate evaluation, laying the foundation for further screening.
[0056] Step 13: Rank each set of candidate feature combinations and select the combined feature from the set of candidate feature combinations with the highest ranking as the target feature.
[0057] In this embodiment, step 13 serves as the final decision-making stage for feature selection. From the candidate feature combination set integrated and deduplicated in step 12, the optimal feature combination suitable for the specific modeling scenario is precisely selected, balancing scenario adaptability, predictive performance, and generalization ability. All V evaluation methods used in step 12 are employed, each containing fitness calculation rules and evaluation parameter configurations to avoid introducing new evaluation dimensions that could lead to decision bias. These V evaluation methods are uniformly applied to the candidate feature combination set formed in step 12, ensuring that all candidate combinations are compared horizontally under the same standards as the previous selection, guaranteeing the consistency and fairness of the decision. For each evaluation method, all candidate feature combinations are sorted from low to high fitness under that method, and the specific ranking of each candidate combination under that evaluation method is recorded, i.e., the relative performance position of the combination under the current standard. Through standardized ranking, the fitness results of different evaluation methods are transformed into comparable quantitative indicators, providing data support for subsequent comprehensive decision-making. To highlight combinations that excel under one or more evaluation criteria and avoid selecting combinations that perform moderately under all criteria, a targeted overall ranking calculation logic is adopted. This amplifies the advantage of high rankings under a single criterion, allowing combinations that perform exceptionally well in key evaluation dimensions to achieve higher overall rankings. This ensures that the optimal feature combination accurately matches the core requirements of the scenario. The key evaluation dimensions here refer to the evaluation methods corresponding to the core requirements of the scenario. Based on the overall ranking results, the candidate feature combination with the highest total score is selected as the target feature. This target feature combination not only verifies its reliable performance across different dimensions through multivariate evaluation but also possesses core competitiveness for scenario adaptation due to its outstanding design logic. Furthermore, it ensures generalization ability through iterative optimization and deduplication integration in the early stages, ultimately completing the closed-loop selection from multiple candidates to the optimal feature. Step 13 avoids the one-sidedness of a single criterion while rejecting balanced, moderate combinations, achieving precise locking of the optimal feature combination for scenario adaptation.
[0058] It should be noted that in step 11, this application can set up a data preparation unit. This data preparation unit represents a traditional machine learning data preparation or cleaning stage. Users can input data, specify the label columns, the ratio of training to test sets, and the random number seed used to partition the dataset. The data preparation unit will automatically complete the following steps:
[0059] Depending on the user's decision, some data may be processed, such as converting data in a specified string format into a one-hot vector; filling in null values in some columns; defining the upper and lower limits of some rows and columns; and discarding some rows and columns of data.
[0060] The label column is locked as y, and the other columns are as x. The dataset is divided into training and test sets according to the specified ratio and random number seed.
[0061] Record relevant information about the data for use in subsequent coding and evaluation steps.
[0062] If users do not wish to provide their own data, this interface can also call datasets from the sklearn package, such as "iris", "wine", "breast_cancer", "digits", etc., and customize the data processing method, the proportion to be used, and the random number seed.
[0063] Furthermore, in step 12, this application may also set up an encoding generation unit. The encoding generation unit will generate various encoding and evaluation processes for feature combinations. According to evolutionary theory, chromosomes carry genes, and genes represent certain characteristics ultimately reflected in an individual. The genetic algorithm uses the principle of similarity to randomly generate chromosomes into a specific length array containing [0, 1] variables, the length of which is equal to the number of input features to be selected. The [0, 1] variable at each position will indicate whether the feature corresponding to that position participates in the current feature combination; 0 indicates no participation, and 1 indicates participation.
[0064] In the initial stage, users of this application can first set the length of the chromosome (corresponding to the number of features), and the chromosomes in subsequent iterations will be generated by the system. The information volume or predictive effect of a single individual feature combination in the iteration will be evaluated according to the following method.
[0065] Optionally, step 12 above includes:
[0066] Using the sample data, the evaluation result corresponding to each evaluation method is determined; the evaluation result is used to represent the fitness calculation rule based on the corresponding evaluation method.
[0067] During the evaluation process of each evaluation method, the chromosome with the highest fitness ranking (U position) in the evaluation method is determined based on the evaluation results and the preset genetic algorithm.
[0068] The pre-U chromosomes corresponding to each evaluation method are deduplicated to obtain a set of candidate feature combinations associated with the evaluation method and chromosome.
[0069] In this embodiment, a closed-loop process of chromosome coding feature combination, genetic algorithm iterative screening, and multivariate evaluation and deduplication is used to accurately construct a candidate feature combination set that combines high quality, diversity, and conciseness.
[0070] In the encoding-iterative screening process of a single evaluation, when any evaluation method is started, the selection status of the feature to be screened is first uniquely encoded through the chromosome. The structure of the chromosome is completely matched with the total number of features to be screened. A certain gene is set to "1" to represent that the corresponding feature is selected, and set to "0" to represent that the corresponding feature is not selected. That is, one chromosome uniquely maps to a set of candidate feature combinations, realizing the structured expression of feature combinations.
[0071] Based on the fitness calculation rules of the current evaluation method, a pre-defined genetic algorithm is used to conduct multiple rounds of iterative optimization on the initially generated chromosome population. During the iteration process, the evaluation result is used as the sole criterion for determining chromosome fitness: the better the evaluation result, such as higher model prediction accuracy and a larger inter-class and intra-class distance ratio of feature classes, the higher the fitness of the corresponding chromosome (feature combination) and the higher its ranking. After all iterations are completed for each evaluation method, only the chromosomes with the top U positions in fitness under that method are retained, ensuring that the output of each evaluation is a high-quality feature combination under that standard, providing high-quality basic data for subsequent aggregation.
[0072] After all V different evaluation methods have been executed, the first U chromosomes generated by all evaluations are collected, forming at most V×U sets of candidate feature combinations, meaning each evaluation method outputs U sets of high-quality combinations. All collected candidate feature combinations are deduplicated, removing chromosomes that encode duplicates (i.e., duplicate feature combinations) to avoid redundancy in the candidate set, ultimately forming a set of candidate feature combinations associated with the number of evaluations. Each feature combination in this set comes from the high-quality screening results of at least one evaluation, preserving the dimensionality brought by multivariate evaluation while ensuring the conciseness of the set through deduplication, reducing the computational cost of subsequent screening.
[0073] Optionally, the evaluation methods include model prediction evaluation and feature vector partitioning evaluation. This application supports the use of these two evaluation methods individually or in combination, comprehensively covering the screening needs of different scenarios, and each evaluation method uses quantitative results as the evaluation basis.
[0074] It should be noted that the model prediction evaluation directly uses a pre-set prediction model (such as a classification model or a regression model) to model the sample data, and uses the model's prediction performance (such as accuracy, goodness of fit, recall, etc.) as the evaluation result to intuitively reflect the modeling performance of the feature combination.
[0075] It should also be noted that the feature vector partitioning evaluation is based on the characteristics of the features of the sample data itself, and one of the following four methods can be selected: (1) Calculate the intra-class and inter-class distances of features to measure the feature discrimination ability; (2) Evaluate the feature utility based on the contribution of standardized features; (3) Optimize the feature classification effect using the Fisher criterion; (4) Judge the feature information content through the prediction effect after feature dimensionality reduction, and realize the accurate evaluation of the essential value of features.
[0076] Optionally, when the evaluation method includes model prediction evaluation, the evaluation result corresponding to each evaluation method is determined using the sample data, including:
[0077] The sample data is preprocessed to determine the training set and the test set;
[0078] The training set and the test set are modeled and predicted according to the preset prediction model, and the prediction results of the training set and the test set are output respectively.
[0079] Select at least one classification or regression performance index, and convert the minimum value index in the prediction results of the training set and the test set into the maximum value form respectively, and determine the corresponding training set evaluation index and test set evaluation index.
[0080] The evaluation result is determined based on the training set evaluation metric, the test set evaluation metric, and the ratio of the total number of features to the currently selected number of features.
[0081] In this embodiment, sample preprocessing and dataset partitioning involve performing preprocessing operations on the input sample data, dividing it into training and test sets to provide a data foundation for subsequent modeling, prediction, and evaluation, ensuring the effectiveness of the evaluation process and the reliability of the results. Feature combination encoding and modeling prediction use chromosomes as the encoding carrier for candidate feature combinations. The structure of the chromosome matches the total number of features to be screened, with one chromosome corresponding to a set of input variables (feature combinations). The prediction model used for modeling can be selected from built-in models, including but not limited to: linear regression models, logistic regression models, Naive Bayes models, support vector machine models, K-nearest neighbor models, decision tree models, K-means models, etc., and the training parameters of these built-in models can be customized; alternatively, an initial custom model can be passed in, and the algorithm will automatically complete the modeling after providing custom parameters. Based on the selected or passed-in model, modeling and prediction are performed using the training and test sets respectively, outputting the prediction results corresponding to the training set and the prediction results corresponding to the test set.
[0082] In the process of selecting and converting evaluation metrics, at least one classification or regression performance metric is selected as the evaluation basis. Optional metrics include, but are not limited to, KS value, AUC value, precision, and mean squared error. The selected metrics are then converted: if the metric is a minimum value metric (i.e., the smaller the value, the better the performance), it is converted to a maximum value form, usually by taking a negative value, ensuring that all evaluation metrics are judged based on the criterion that a larger value indicates a better model prediction effect.
[0083] Finally, the final evaluation result is calculated by incorporating the feature quantity penalty term. Determine the parameters required for the evaluation calculation: set the parameters manually. Used to adjust the importance of test set evaluation metrics in the results. Used to adjust the importance of training set evaluation metrics in the results. To adjust the penalty applied to the result by the number of features, it is generally recommended that 1 ≤ ≤ -1、 ≤2. Clearly define the calculation logic: The final evaluation result is combined with the training set evaluation metrics ( ), test set evaluation metrics ( The calculation of the feature quantity penalty term (the ratio of the total number of features n to the currently selected number of features d) is achieved by scaling parameters to make the metrics of the training set and the test set comparable, balancing their performance to prevent overfitting, and controlling feature redundancy through the feature quantity penalty term.
[0084] Specifically, the evaluation formula for the preset model can be expressed as: ;in, This is represented as the final evaluation result; Represented as an evaluation metric for the training set; This is represented as an evaluation metric for the test set; This is expressed as the total number of features (i.e., chromosome length). This represents the number of currently selected features; , , These represent manually set parameters, with the default settings being 2, 1, 1; optional settings are 1≤ ≤ -1、 ≤2. This formula helps in selecting specific metrics for evaluation in the model. Once the metric is selected (prediction accuracy is set by default), the algorithm will calculate the metric based on the training set and the test set respectively, and an additional penalty term for the number of features is added.
[0085] This evaluation method can effectively examine the modeling and prediction effects of candidate feature subsets. Taking risk control modeling scenarios as an example, it can filter duplicate information features based on the synergistic effect of features, select features of different types and collection methods, maximize the information value provided by features, and improve the prediction accuracy of target samples such as samples involving organized crime.
[0086] Optionally, when the evaluation method includes feature vector partitioning evaluation, the evaluation result corresponding to each evaluation method is determined using the sample data, including:
[0087] Based on the sample data, determine the total number of categories, the total number of samples, the number of samples in a single category, the overall mean vector, the mean vector of a single category, and the individual vector in a single category.
[0088] The overall intra-class scatter matrix is determined based on the total number of categories, the total number of samples, the number of samples in a single category, the mean vector of a single category, and the individual vectors in a single category.
[0089] The overall inter-class scatter matrix is determined based on the total number of categories, the total number of samples, the number of samples in a single category, the overall mean vector, and the mean vector of a single category.
[0090] Based on the overall intra-class scatter matrix and the overall inter-class scatter matrix, the evaluation results are determined using either the intra-class and inter-class distance method or the Fisher criterion.
[0091] In this embodiment, based on the input sample data, the key basic parameters required for evaluation are identified, including the total number of categories, the total number of samples, the number of samples in each individual category, the overall mean vector, the mean vector of each individual category, and the feature vector of each individual in each category. This provides data support for the subsequent calculation of the scatter matrix and the implementation of the evaluation logic. The core advantage of this evaluation method is its low computational complexity and wide applicability. It can solve the problem of high iteration time cost of complex models when there are many features and a large sample size, and directly evaluate the amount of feature information through the feature matrix and label vector.
[0092] Based on the extracted parameters, the overall intra-class scatter matrix is calculated: For each class, the deviation between the feature vector of each individual in that class and the mean vector of that class is calculated first, and the outer product operation is performed on each deviation. Then, the outer products of the deviations of all individuals in the same class are summed. Subsequently, the calculation results of all classes are summarized, and finally divided by the total number of samples to obtain the overall intra-class scatter matrix. The core function of this matrix is to quantify the dispersion of samples within each class. The larger the matrix value, the more obvious the difference between samples within a certain class.
[0093] Based on the core parameters of the samples, the overall inter-class scatter matrix is calculated: first, the proportion of samples in each class to the total number of samples is calculated; then, the deviation between the mean vector of that class and the overall mean vector is calculated and the outer product is performed; after multiplying the proportion by the corresponding deviation outer product, the calculation results for all classes are summed to obtain the overall inter-class scatter matrix; the core function of this matrix is to quantify the degree of dispersion of samples between different classes. The larger the matrix value, the more obvious the difference between samples in different classes.
[0094] Specifically, the within-class scatter matrix and between-class scatter matrix of the selected features are calculated, as defined below: The overall intra-class scatter matrix can be represented as: ; The overall inter-class scatter matrix can be represented as: ; in, This is expressed as the total number of categories in the sample data; The total number of samples in the sample data is expressed as ; the number of samples in a single category is expressed as . express, Represented as category Sample size; Represented as the population mean vector; the mean vector of a single category is shown here as... express, Represented as category Mean vector; the vector of individuals in a single category. express, Represented as category medium-sized individuals vector.
[0095] Furthermore, based on the overall intra-class scatter matrix and the overall inter-class scatter matrix, the evaluation result is determined using the intra-class and inter-class distances of the feature classes. Specifically, based on the overall intra-class scatter matrix and the overall inter-class scatter matrix, the overall inter-class scatter matrix is determined. ) and the overall intra-class scatter matrix ( The trace (tr) of a matrix is the sum of its main diagonal elements, where tr( ) is used to quantify the overall degree of difference in sample features across all categories, tr( This is used to quantify the overall dispersion of sample features within each category; it introduces an adjustment parameter, which can be set manually. The core function of this parameter is to determine the contribution weights of differentiated inter-class distance and intra-class distance in the evaluation results. Users can flexibly adjust it according to the needs of the actual scenario. This application will calculate the trace of the two matrices and output the final evaluation result, denoted as: The trace tr( of the inter-class scatter matrix) )of The power is used as the numerator, and the trace tr of the in-class scatter matrix is used as the numerator. The evaluation result is determined by the ratio of the two values, which serves as the denominator. Here, the goal is to maximize the difference in sample features between categories while minimizing the dispersion of sample features within each category. When the ratio is maximized, it means that the current feature combination achieves the best balance between maximizing inter-class differences and minimizing intra-class differences; this feature combination is the optimal feature combination under this evaluation criterion.
[0096] Furthermore, based on the overall intra-class scatter matrix and the overall inter-class scatter matrix, the evaluation result is determined using the Fisher criterion. Specifically, for each class, the optimal projection direction to other classes is calculated, obtained by multiplying the inverse of the overall intra-class scatter matrix by the difference between the mean vector of that class and the mean vector of other classes. Then, the Fisher criterion function value is calculated using this projection direction, which is the ratio of the inter-class projection variance to the intra-class projection variance. After summing the Fisher criterion function values for all classes, the result is divided by a parameter scaling factor of the total number of samples. This parameter defaults to 1.5 and can be manually set to penalize excessive sample sizes, thus determining the evaluation result. The core purpose of this method is to maximize the distinguishing effect of different class samples in the feature space and select the feature combinations that maximize the difference between samples of each class.
[0097] For example, this part attempts to determine the classification effect of the feature matrix on the samples based on Fisher's criterion. First, assume that the optimal projection direction vector that distinguishes a certain class of sample j from other samples is: ;in, Represented as the overall intra-class scatter matrix; Represented as category The vector mean; Represented as non-category The vector mean.
[0098] The Fisher criterion function can be derived from the projection. ;in, This is represented as the overall inter-class scatter matrix. The final fitness function will be constructed as follows: This application aims to find the best distinguishing effect that a feature matrix can achieve for different classes of features in all possible high-dimensional spaces. This is used to penalize excessive sample counts; the default value is 1.5, but it can be manually set. According to the formula above, the final result, after selecting the feature combination, maximizes the ability to distinguish between different classes of samples, that is, maximizing the Fisher criterion result (maximizing the spatial difference between samples of different classes) with the same number of features.
[0099] Optionally, when the evaluation method includes feature vector partitioning evaluation, determining the evaluation result corresponding to each evaluation method using the sample data further includes:
[0100] The sample data is standardized, and the difference between the mean of the standardized features in the target category samples and the mean of the standardized features in the non-target category samples is calculated to determine the importance matrix between the features and the categories.
[0101] Based on the importance matrix, the average feature contribution and the contribution of highly important features are calculated; the average feature contribution is used to represent the overall predictive power of the features; the contribution of highly important features is used to represent features whose contribution is higher than the average feature contribution.
[0102] The evaluation results are determined based on the average feature contribution and the high-importance feature contribution.
[0103] In this embodiment, the sample data is standardized, and the difference between the mean of the standardized features in the target category samples and the mean of the standardized features in the non-target category samples is calculated to determine the importance matrix associated with the features and categories. First, the feature matrix of the sample data needs to be standardized, that is, for the feature vector X of the sample data, the following values are taken: Where X represents the feature vector of the sample data; This is represented as the standard deviation of the feature vector. Then, the difference between the mean of samples belonging to a certain type and those not belonging to that type among all standardized features is calculated as the importance of that feature for that type, thus determining the importance matrix F between features and categories.
[0104] ; ;in, This indicates the distinguishing importance of the i-th feature to the j-th category; Represented as the number of categories; Represented as the number of vector features; That is, the value of sample i in category j; N represents the total number of samples in the sample data; F represents the importance matrix associated with features and categories; c represents the total number of categories in the sample data; d represents the total number of features in the sample data.
[0105] At this point, this application will separately measure the average feature contribution and the contribution of highly important features within the feature combination, whereby the average feature contribution measures the overall predictive power of the features, and is calculated as follows: ; Where c represents the total number of categories in the sample data; d represents the total number of features in the sample data; It represents the average discriminative importance of all features to all categories, and measures the overall predictive power of feature combinations; This represents the sum of all elements in the importance matrix F; This indicates that only those distinctions of higher-than-average importance will be made. The characteristics are included in the summation range.
[0106] The final fitness function is: .
[0107] The primary objective of this application is to maximize the overall contribution of features. Contribution of highly important features. It measures the balance of contributions of the selected features, preventing excessive differences between features of high and low importance, i.e., the existence of some low-value features that interfere with the calculation process of the model and are used as the denominator of the final result. This parameter is used to balance the user's choice between the overall predictive power of features and the differences in feature importance, and is set manually by the user. When the ratio after scaling by this parameter is maximized, it means that the feature combination selected by the user has achieved the best predictive effect, while minimizing the low-contribution features within the feature combination and simplifying the combination content. This feature set will be selected as the best feature set.
[0108] Furthermore, this application can also perform feature dimensionality reduction based on principal component analysis (PCA) to obtain the prediction effect, that is, determine the evaluation result corresponding to the sample data.
[0109] This application will directly use PCA to reduce the dimensionality of the feature space, and then calculate the vector reduced to 1 dimension and compare the result with the classification label to evaluate the classification effect of the features. That is, firstly, for each sample space, take: ; ;in, represents the original sample feature vector, which represents the set of original feature values for the i-th sample in the sample data; M represents the population mean vector in the sample data; N represents the total number of samples in the sample data; This represents the feature vector of the i-th sample after mean centering; This represents the feature matrix after centering the mean of all samples. Represents the centered feature matrix The transpose of the matrix; This represents the covariance matrix of the sample data.
[0110] Eigenvalue decomposition yields vectors Let the final one-dimensional vector be: The principle of PCA is to select the direction with the largest variance after dimensionality reduction, which is similar to unsupervised learning. The vector with the highest information content after dimensionality reduction is selected and compared with the original classification vector to calculate KS, which yields: The aim of this study is to maximize the retention of all feature differences after dimensionality reduction, i.e., the amount of feature information, and then fit the sample results based on the reduced one-dimensional features. This may improve the predictive effectiveness of the label. Used to penalize excessive sample sizes, with a default value of 0.5, to appropriately compress the corresponding dimensional parameters. It can be set manually. KS is short for Kolmogorov-Smirnov Test, and its core function is to measure the degree of difference between two data distributions.
[0111] Optionally, during the evaluation process of each evaluation method, determining the chromosome with the highest fitness ranking (U position) in the evaluation method based on the evaluation results and a preset genetic algorithm includes:
[0112] During the evaluation process of each evaluation method, N chromosomes are randomly generated as the initial population; the gene sequence of each chromosome is used to characterize a set of candidate feature combinations; the size of the initial population and the gene length are respectively adapted to the population size and the total number of features to be screened in the initial population.
[0113] The iteration process is executed according to the preset total number of iterations, and in each iteration, based on the evaluation results of the evaluation method, the fitness metric is calculated for all chromosomes in the current population, and selection, genetics, and mutation operations are executed in sequence; wherein, in the first iteration, the current population is the initial population;
[0114] After the preset total number of iterations, the chromosome with the highest fitness (U position) among all chromosomes in the entire iteration process is retained.
[0115] In this embodiment, after each evaluation method is initiated, N chromosomes are first randomly generated as the initial population for the genetic algorithm. The gene sequence of each chromosome is perfectly matched with the total number of features to be screened, where the value of each gene uniquely represents the selection status of the corresponding feature, i.e., one chromosome corresponds to a set of candidate feature combinations; at the same time, the size (number N) and gene length (corresponding to the total number of features to be screened) of the initial population are set according to the adaptation requirements of the evaluation method to ensure population diversity and the effectiveness of subsequent iterative optimization. The complete iteration process is executed according to the preset total number of iterations M, and each iteration follows the standardized logic of adaptation quantification-selection-genetics-mutation, and the current population of the first iteration is the aforementioned initial population:
[0116] Based on the evaluation results of the current evaluation method, that is, the fitness calculation rules corresponding to this method, the fitness of all chromosomes in the current population is quantitatively scored to obtain the fitness value of each chromosome.
[0117] The selection, genetic (crossover), and mutation operations are performed sequentially. The selection operation retains chromosomes with high fitness in the population, the genetic operation generates new individuals by exchanging chromosome segments, and the mutation operation introduces population diversity by randomly changing the values of some genes, ensuring that high-quality feature combinations are preserved during the iteration process.
[0118] After completing the preset M rounds of iteration, all chromosomes generated throughout the entire iteration under this evaluation method are summarized, including the initial population and new individuals generated in each round of iteration. They are sorted according to their fitness values, and only the chromosomes ranked in the top U position are retained. This yields the encoding results corresponding to the high-quality feature combinations under this evaluation method.
[0119] When there are a total of V evaluation methods, each evaluation method selects U high-quality chromosomes through the above process. Therefore, theoretically, a maximum of V×U sets of candidate feature combination data can be collected. After deduplication, a set of candidate feature combinations is formed, which not only ensures the coverage of multivariate evaluation, but also provides sufficient high-quality samples for subsequent screening.
[0120] In this application, the population size is set to N and the number of iterations is set to M during the iterative process. Subsequently, during the algorithm's execution, three important evolutionary behaviors will be simulated by the genetic algorithm, which includes selection, inheritance, and mutation.
[0121] Furthermore, the selection behavior includes: this behavior simulates the process of natural selection, where the higher an individual's fitness, the more likely it is to pass through natural selection and enter the next generation; while individuals with lower fitness may be eliminated. The first step is to select... Three samples are directly exempted from the next iteration (default is 3, can be defined). This application, after comparing commonly used selection methods in genetic algorithms such as roulette wheel selection and random selection, ultimately decided on the roulette wheel selection method and made modifications accordingly: The second individual was returned from the total population. In the selection of a single individual, the probability of each individual being selected is:
[0122] , here This is the fitness function of sample i, calculated by calling the data preparation unit, where m is the current round. The power of can selectively choose individuals with strong fitness to advance to the next round when the model is chaotic and disordered, enabling rapid iteration of sample content. Later in the iteration process, after selecting a certain number of excellent individuals, the elimination rate is slowed down to avoid eliminating still valuable samples. This function allows those with higher fitness to enter the next iteration first, repeating the process. This process continues until an individual of similar size to the original population is selected.
[0123] Furthermore, the genetic behavior includes: this behavior simulates crossover inheritance in nature, where each selected individual in a generation generates new offspring through crossover and recombination. This application selects uniform crossover; the algorithm pairs individuals together and determines the number of offspring based on chromosome length (total number of features). Simultaneously, two offspring are constructed. Each individual in the first offspring is randomly selected from one parent, while the other individual receives the corresponding gene from the other parent. This ensures that each trait is fairly and independently selected to enter a particular individual in the next generation. There are two original sets of chromosomes: ; .
[0124] The random reorganization will be: ; .
[0125] Moving on to the next stage.
[0126] Furthermore, the mutation behavior includes: this behavior simulates gene mutation in nature, and each individual's genetic material will have a certain probability of mutation, and its corresponding gene will be modified, which is intended to increase the randomness of the algorithm and prevent the selection of a local optimum.
[0127] Considering that the elements in chromosomes consist of [0,1], this application selects a position flipping mutation, assigning a uniform probability to all genes in all individuals. Perform a [0,1] swap, here The value of is defined as the following function: In this function That is, the fitness function of sample i. This is the mean of the fitness function for all samples in this round. This function aims to increase the mutation probability of samples with lower fitness and decrease the mutation probability of samples with higher fitness. It quickly aggregates features with sufficient predictive information, helping feature combinations converge towards the top high-fitness combinations. In practice, this function helps remove useless features from the model combination and add high-predictive-effect features that were not selected. Head samples are used to retain high-fitness feature combinations, while tail samples continuously attempt mutation until a high-fitness sample is added to the head. This function is based on the relative ratio of fitness rather than simply the absolute level of fitness; that is, once a lower-ranked sample has high fitness, it will automatically cause previously higher-ranked samples to drop in fitness, initiating a high-speed mutation phase.
[0128] In the initial stage, this application randomly generates N individuals. After M iterations involving selection, inheritance, and mutation, and after the preset total number of iterations, N new individuals with higher fitness based on natural selection are generated. The application also records the iteration process of all individuals, retaining the top U chromosomes with the highest fitness across all chromosomes throughout the entire iteration process in the current evaluation method. U can be selected manually.
[0129] Optionally, step 13 above includes:
[0130] For each candidate feature set, for any combination feature in the candidate feature combination set, the square of the chromosome ranking under the corresponding evaluation method is used as the score calculation rule for the feature combination.
[0131] According to the scoring calculation rules, the sum of the scores of all combined features in the candidate feature combination set is taken as the total score of the candidate feature combination set, and the combined feature in the candidate feature combination set with the highest ranking is selected as the target feature.
[0132] In this embodiment, the total score is calculated by weighting the sum of squared rankings, and the optimal feature combination for scene adaptation is accurately selected from the candidate feature combination set. The candidate feature combination set originates from the multivariate evaluation and deduplication process in step 12. Users can call the previous related steps multiple times with different evaluation methods, evaluation parameters, sample sizes, and iteration rounds. After each call, the top U high-fitness feature combinations are recorded and represented in chromosome encoding form. After deduplication, they are retained as the final candidate combinations. When V evaluation methods are selected, the total number of candidate combinations after deduplication is W, which does not exceed V×U, i.e., the number of evaluation methods × the number of top U combinations retained by each evaluation method.
[0133] The encoding generation unit is invoked again, and all V evaluation methods used in step 12 are uniformly applied to the above W candidate feature combinations. For each evaluation method, all candidate combinations are sorted from low to high fitness under that method, and the specific ranking of each candidate combination under the v-th (v∈[1,V]) evaluation method is recorded. u is the index of the candidate combination, u∈[1,W].
[0134] For each candidate feature combination, the total score is calculated based on its ranking across all V evaluation methods, using the following formula: ,in, The total score for a single candidate combination. The fitness ranking (or chromosome ranking) of the combination under the vth evaluation method is determined by sorting the positions from low to high. The weight of the combinations that rank higher under one or more evaluation methods is amplified by accumulating the sum of squares.
[0135] Compare the total scores of all candidate feature combinations The system selects the combination with the highest total score as the target feature. The core design of this calculation rule is to highlight the feature combination that performs best under one or more evaluation criteria. If a combination is only at a medium level in all evaluation methods and does not rank among the top, its total score will not be too high. However, combinations that rank high in the key evaluation dimensions (evaluation methods that adapt to the core needs of the scenario) will receive higher weight due to the squaring operation, ultimately achieving the goal of accurately selecting the optimal feature combination for a specific scenario.
[0136] For example, suppose there are three sets of candidate feature combinations to be evaluated: set A, set B, and set C. Each set contains multiple combination features, and the chromosome ranking corresponding to each combination feature has been obtained through a preset evaluation method; the score of a single combination feature is equal to the square of its corresponding chromosome ranking; the total score of the candidate set is the sum of the scores of all combination features within the set; finally, the combination feature from the candidate set with the highest total score is selected as the target feature. Specifically, set A includes... , , The corresponding chromosome rankings are 1, 2, and 3, respectively, and the individual combination feature scores are 1, 4, and 9, respectively. Therefore, the total score of set A is 1 + 4 + 9 = 14. Set B includes... , The corresponding chromosome rankings are 1 and 1 respectively, and the individual combination feature scores are 1 and 1 respectively. Therefore, the total score of set B is 1 + 1 = 2. Set C includes... , , , The corresponding chromosome rankings are 2, 3, 4, and 1, respectively, and the individual combination feature scores are 4, 9, 16, and 1, respectively. Therefore, the total score of set C is 4 + 9 + 16 + 1 = 30. The candidate feature combination sets are ranked by fitness based on their total scores: set C (30 points) > set A (14 points) > set B (2 points). The set C with the highest ranking is selected as the optimal candidate set, and the combination features it contains are the final target features.
[0137] It should be noted that if multiple sets have the same total score, additional ranking rules can be added, such as prioritizing the set with fewer combined features or the set with a higher average score. However, the score calculation logic still follows the rule of chromosome ranking sum of squares.
[0138] In one specific embodiment, a specific case scenario is analyzed here. Assume that in a loan monitoring scenario for micro-loan risk control, an internet consumer finance institution wants to build a credit scoring model to predict the default risk of borrowers. The data sample includes records of 8,000 users who applied for microloans in the past two years, of which 200 are blacklisted (having defaulted). Each record in the sample package contains hundreds of features, covering personal information statistics, social media data, various income and consumption records, etc. The model chosen is the classic logistic regression scoring card, with the KS value as the main evaluation metric, requiring the model to maintain high recognition accuracy while possessing good robustness. The feature selection and optimization process using this application is as follows:
[0139] Step 1, Data Preparation and Segmentation: Initialize the historical loan dataset, including:
[0140] (1) Label string and boolean data and convert them into one-hot vectors;
[0141] (2) Fill in the blank values in some columns appropriately;
[0142] (3) Define the upper and lower limits of some rows and columns, and handle some unusable data as null values;
[0143] (4) Discard some row and column data based on indicators such as missing rate.
[0144] Subsequently, while ensuring the proportion of black samples, the model was randomly divided into a training set and a test set. The training set was used for model learning, and the test set was used to evaluate the model's generalization performance, so that the evaluation metrics were comparable.
[0145] Step 2, Genetic Algorithm Initialization: Based on the statistical values of the samples, set the relevant parameters of the genetic algorithm, including population size, number of iterations, crossover and mutation probabilities, etc. Feature subsets are represented using binary encoding: each chromosome consists of a string of 0 / 1 bits, the length of which is equal to the total number of features. Each bit represents whether the corresponding feature is selected (1 for selected, 0 for not selected). The initial population can randomly generate several different feature combinations, or combine some features selected manually as part of the initial solution to improve efficiency.
[0146] Step 3, Fitness Calculation: For each chromosome individual in the population (corresponding to a candidate feature subset k), perform the following steps to evaluate fitness:
[0147] (1) In the training set, train a logistic regression model with added regularization using the features of that subset;
[0148] (2) Calculate the performance metrics of the model on the training and test sets, such as the KS value;
[0149] (3. Calculate the fitness function, assuming the default scaling ratio, and obtain:) .
[0150] Step 4, Genetic Evolution Iteration: Based on fitness, iteratively operate on the individuals in the population, continuously generating a new generation of candidate feature subsets, until the required number of iterations is met or multiple consecutive iterations fail to yield a higher fitness result.
[0151] Selection: Chromosomes with high fitness are preferentially selected for the next generation. As the number of iterations increases, the selection will become less strict.
[0152] Crossover: Randomly select a portion of chromosome pairs and swap some of their gene loci according to the uniform exchange rule to generate new feature combinations, thereby producing diverse combinations in the solution space.
[0153] Mutation: Random flipping is performed on individual gene loci in the new generation of chromosomes, that is, introducing new features or removing existing features, to prevent the algorithm from getting trapped in local optima.
[0154] Step 5: Obtain the optimal feature subset: When the algorithm converges or the iteration terminates, select the feature subset corresponding to the chromosome with the highest fitness as the final optimal feature combination. Retrain the logistic regression model using this feature set and verify its performance on the test set. Assuming the initial model uses all features and has a KS value of 0.20 and an accuracy of 60% on the test set, after genetic algorithm selection of approximately 50 key features, the new model's test set KS value improves to 0.25, the accuracy increases to 65%, and the number of features is significantly reduced, improving the model's interpretability and computational efficiency.
[0155] Step 6, Model Deployment and Application: Apply the model trained by the above algorithm to actual business operations to score and decide on new loan applications. In actual operation, because the model constructed by this method has stronger discriminative power and has undergone anti-overfitting screening, the model can more stably identify high-risk borrowers. For example, for the same batch of new applicants, the optimized model can more accurately identify potential defaulters and reduce the proportion of misjudgments compared to the original model, thereby helping risk control personnel to formulate credit granting and risk control strategies more accurately at a lower cost.
[0156] This application proposes a more generalizable fitness evaluation method. When the genetic algorithm evaluates the performance of each feature subset, a scaling comparison mechanism using both training and test set metrics is introduced, along with a penalty term for the number of features. In other words, for each candidate feature subset, this method not only examines the model's performance metrics on the training set (such as KS value, AUC, and accuracy) but also focuses on its performance metrics on the independent test set, using appropriate scaling to make the two comparable and calculating their differences. If a feature combination has high metrics on the training set but significantly decreases on the test set, this method lowers its fitness score to suppress overfitting. Simultaneously, a feature quantity penalty is explicitly added to the fitness function, assigning a negative weight to the size of the feature subset and encouraging the genetic algorithm to select a more concise feature set. This improved fitness evaluation method ensures that the selected features improve model recognition accuracy while maintaining good generalization performance and controlling model complexity.
[0157] This application proposes a method for efficiently selecting the optimal combination. During iterative execution, in addition to the genetic method selecting the most suitable equal-crossover method for feature selection, this method improves existing selection and mutation methods using a function based on fitness and iteration count. For the selection method, this method discards low-value feature combinations while reducing the probability of high-value feature combinations being affected, allowing the overall population to concentrate resources on storing and computing the dominant population in each iteration. For the mutation method, considering that risk control tasks are often based on multiple sources of data, resulting in complex and chaotic information, this method proposes a larger transformation probability to accelerate the traversal of more feature combinations. Later, after obtaining feature combinations with some predictive ability, the transformation probability is restricted to find better feature combinations similar to the current optimal feature. This allows the genetic algorithm to more effectively retain high-fitness head samples and relatively accelerate the iterative changes of low-fitness samples, enabling them to quickly evolve into individuals that can compete with high-fitness samples.
[0158] This application proposes a multi-strategy fitness evaluation integration and scenario-adaptive processing method. During feature selection, this application designs multiple fitness evaluation strategies and provides a unified integration mechanism, allowing flexible switching of the optimal strategy based on different model types or business scenarios, making the feature selection method universally applicable. In microcredit risk control, different models may focus on different evaluation metrics: for example, in credit default prediction models, metrics such as KS value or AUC, which distinguish between good and bad users, are more important; while in anti-fraud models, due to the scarcity of fraud samples, the focus is on improving recall (capturing as many fraudulent cases as possible) while maintaining a certain level of precision. To address this, this method predefines and implements multiple fitness calculation strategies and integrates them through modular configuration. During runtime, the genetic algorithm can apply the corresponding fitness evaluation function to the candidate feature subset according to the selected strategy, thereby adapting to different underlying models and business needs. This multi-strategy fusion design enables this method to work effectively in different risk control scenarios: whether applied to logistic regression scoring card models, decision tree models, or tasks such as overdue prediction and anti-fraud identification, the algorithm can adaptively find the optimal feature subset simply by selecting or adjusting the fitness evaluation strategy. This greatly enhances the versatility and practical value of the method in the field of risk control.
[0159] In summary, by combining the above steps and adding a new PCA-related fitness calculation method, this application can efficiently evaluate the prediction performance of models trained with different numbers of features and multiple feature combinations.
[0160] This application combines multiple screening methods to evaluate feature prediction performance from multiple perspectives, making it adaptable to various models and datasets. It allows for flexible switching of the optimal evaluation method for different risk types and model algorithms, and even integrates multiple metrics in a single scenario, ensuring the usability of training results.
[0161] The improved selection, heredity, and mutation in the genetic algorithm of this application have a certain perturbation capability, which prevents feature combinations from getting trapped in local optima, helps to discover more feature combinations, greatly improves the ability to quickly find suitable features for modeling in complex and ever-changing modeling scenarios, and makes fitness evaluation more comprehensive and reasonable.
[0162] Traditional genetic algorithms use a fitness function that only considers a single metric of the training set. This application addresses the possibility of overfitting, thus limiting the potential for excessive differences in prediction performance between the training and test sets and the selection of too many samples. By utilizing a penalty term, the application effectively improves the model's performance on the test set, reduces the amount of features used, and significantly increases the model's prediction reliability and interpretability.
[0163] The various methods of the embodiments of this application have been described above. Apparatus for implementing the above methods will now be provided.
[0164] Please refer to Figure 2 This application embodiment also provides a modeling feature screening device, including:
[0165] The first processing module 21 is used to receive sample data input by the user;
[0166] The second processing module 22 is used to evaluate the sample data using V different evaluation methods, and to determine a set of candidate feature combinations associated with the evaluation method and the chromosome based on the first U chromosome obtained by each evaluation method.
[0167] The third processing module 23 is used to rank each set of candidate feature combinations and select the combined feature from the set of candidate feature combinations with the highest ranking as the target feature.
[0168] Optionally, the second processing module 22 includes:
[0169] The first processing unit is used to determine the evaluation result corresponding to each evaluation method using the sample data; the evaluation result is used to represent the fitness calculation rule based on the corresponding evaluation method.
[0170] The first determining unit is used to determine, during the evaluation process of each evaluation method, the chromosome with the highest fitness ranking in the evaluation method based on the evaluation results and a preset genetic algorithm;
[0171] The second processing unit is used to remove duplicates from the pre-U chromosomes corresponding to each evaluation method, thereby obtaining a set of candidate feature combinations associated with the evaluation method and chromosome.
[0172] Optionally, the first processing unit is specifically used for:
[0173] The sample data is preprocessed to determine the training set and the test set;
[0174] The training set and the test set are modeled and predicted according to the preset prediction model, and the prediction results of the training set and the test set are output respectively.
[0175] Select at least one classification or regression performance index, and convert the minimum value index in the prediction results of the training set and the test set into the maximum value form respectively, and determine the corresponding training set evaluation index and test set evaluation index.
[0176] The evaluation result is determined based on the training set evaluation metric, the test set evaluation metric, and the ratio of the total number of features to the currently selected number of features.
[0177] Optionally, the first processing unit is further specifically used for:
[0178] Based on the sample data, determine the total number of categories, the total number of samples, the number of samples in a single category, the overall mean vector, the mean vector of a single category, and the individual vector in a single category.
[0179] The overall intra-class scatter matrix is determined based on the total number of categories, the total number of samples, the number of samples in a single category, the mean vector of a single category, and the individual vectors in a single category.
[0180] The overall inter-class scatter matrix is determined based on the total number of categories, the total number of samples, the number of samples in a single category, the overall mean vector, and the mean vector of a single category.
[0181] Based on the overall intra-class scatter matrix and the overall inter-class scatter matrix, the evaluation results are determined using either the intra-class and inter-class distance method or the Fisher criterion.
[0182] Optionally, the first processing unit is further specifically used for:
[0183] The sample data is standardized, and the difference between the mean of the standardized features in the target category samples and the mean of the standardized features in the non-target category samples is calculated to determine the importance matrix between the features and the categories.
[0184] Based on the importance matrix, the average feature contribution and the contribution of highly important features are calculated; the average feature contribution is used to represent the overall predictive power of the features; the contribution of highly important features is used to represent features whose contribution is higher than the average feature contribution.
[0185] The evaluation results are determined based on the average feature contribution and the high-importance feature contribution.
[0186] Optionally, the second processing unit is further specifically used for:
[0187] During the evaluation process of each evaluation method, N chromosomes are randomly generated as the initial population; the gene sequence of each chromosome is used to characterize a set of candidate feature combinations; the size of the initial population and the gene length are respectively adapted to the population size and the total number of features to be screened in the initial population.
[0188] The iteration process is executed according to the preset total number of iterations, and in each iteration, based on the evaluation results of the evaluation method, the fitness metric is calculated for all chromosomes in the current population, and selection, genetics, and mutation operations are executed in sequence; wherein, in the first iteration, the current population is the initial population;
[0189] After the preset total number of iterations, the chromosome with the highest fitness (U position) among all chromosomes in the entire iteration process is retained.
[0190] Optionally, the third processing module 23 is specifically used for:
[0191] For each candidate feature set, for any combination feature in the candidate feature combination set, the square of the chromosome ranking under the corresponding evaluation method is used as the score calculation rule for the feature combination.
[0192] According to the scoring calculation rules, the sum of the scores of all combined features in the candidate feature combination set is taken as the total score of the candidate feature combination set, and the combined feature in the candidate feature combination set with the highest ranking is selected as the target feature.
[0193] It should be noted that the device in this embodiment corresponds to the method described above, and the implementation methods in each of the above embodiments are applicable to the embodiment of this device, achieving the same technical effect. The device provided in this application embodiment can implement all the method steps implemented in the above method embodiments and achieve the same technical effect. Therefore, the parts and beneficial effects that are the same as those in the method embodiments will not be described in detail here.
[0194] This application also provides a computer-readable storage medium storing a computer program. When executed by a processor, the computer program implements the various processes of the above-described modeling feature screening method embodiments and achieves the same technical effects. To avoid repetition, it will not be described again here. The computer-readable storage medium may be a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
[0195] This application also provides a computer program product, including computer instructions. When the computer instructions are executed by a processor, they implement the various processes of the above-described modeling feature screening method embodiments and achieve the same technical effect. To avoid repetition, they will not be described again here.
[0196] It should be noted that the collection, gathering, updating, analysis, processing, use, transmission, and storage of user personal information involved in this disclosed technical solution all comply with relevant laws and regulations, are used for legitimate purposes, and do not violate public order and good morals. Necessary measures are taken to prevent unauthorized access to user personal information data and to safeguard user personal information security and network security.
[0197] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0198] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. The computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal (which may be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in the various embodiments of this application.
[0199] The embodiments of this application have been described above with reference to the accompanying drawings. However, this application is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of this application without departing from the spirit and scope of the claims, and all of these forms are within the protection scope of this application.
Claims
1. A method for modeling feature selection, characterized in that, include: Receive sample data input by the user; Using the sample data, V different evaluation methods were used for evaluation, and based on the first U chromosome obtained by each evaluation method, a set of candidate feature combinations associated with the evaluation method and the chromosome was determined. The candidate feature combination sets are ranked, and the combined feature from the highest-ranked candidate feature combination set is selected as the target feature.
2. The method according to claim 1, characterized in that, Using the sample data, V different evaluation methods were employed for evaluation. Based on the pre-U chromosome obtained from each evaluation method, a set of candidate feature combinations associated with the evaluation method and the chromosome was determined, including: Using the sample data, the evaluation result corresponding to each evaluation method is determined; the evaluation result is used to represent the fitness calculation rule based on the corresponding evaluation method. During the evaluation process of each evaluation method, the chromosome with the highest fitness ranking (U position) in the evaluation method is determined based on the evaluation results and the preset genetic algorithm. The pre-U chromosomes corresponding to each evaluation method are deduplicated to obtain a set of candidate feature combinations associated with the evaluation method and chromosome.
3. The method according to claim 2, characterized in that, When the evaluation method includes model prediction evaluation, the evaluation result corresponding to each evaluation method is determined using the sample data, including: The sample data is preprocessed to determine the training set and the test set; The training set and the test set are modeled and predicted according to the preset prediction model, and the prediction results of the training set and the test set are output respectively. Select at least one classification or regression performance index, and convert the minimum value index in the prediction results of the training set and the test set into the maximum value form respectively, and determine the corresponding training set evaluation index and test set evaluation index. The evaluation result is determined based on the training set evaluation metric, the test set evaluation metric, and the ratio of the total number of features to the currently selected number of features.
4. The method according to claim 2, characterized in that, When the evaluation method includes feature vector partitioning evaluation, the evaluation result corresponding to each evaluation method is determined using the sample data, including: Based on the sample data, determine the total number of categories, the total number of samples, the number of samples in a single category, the overall mean vector, the mean vector of a single category, and the individual vector in a single category. The overall intra-class scatter matrix is determined based on the total number of categories, the total number of samples, the number of samples in a single category, the mean vector of a single category, and the individual vectors in a single category. The overall inter-class scatter matrix is determined based on the total number of categories, the total number of samples, the number of samples in a single category, the overall mean vector, and the mean vector of a single category. Based on the overall intra-class scatter matrix and the overall inter-class scatter matrix, the evaluation results are determined using either the intra-class and inter-class distance method or the Fisher criterion.
5. The method according to claim 2, characterized in that, When the evaluation method includes feature vector partitioning evaluation, determining the evaluation result corresponding to each evaluation method using the sample data further includes: The sample data is standardized, and the difference between the mean of the standardized features in the target category samples and the mean of the standardized features in the non-target category samples is calculated to determine the importance matrix between the features and the categories. Based on the importance matrix, the average feature contribution and the contribution of highly important features are calculated; the average feature contribution is used to represent the overall predictive power of the features; the contribution of highly important features is used to represent features whose contribution is higher than the average feature contribution. The evaluation results are determined based on the average feature contribution and the high-importance feature contribution.
6. The method according to claim 2, characterized in that, In the evaluation process of each evaluation method, based on the evaluation results and a preset genetic algorithm, the chromosome with the highest fitness ranking (U position) in the evaluation method is determined, including: During the evaluation process of each evaluation method, N chromosomes are randomly generated as the initial population; the gene sequence of each chromosome is used to characterize a set of candidate feature combinations; the size of the initial population and the gene length are respectively adapted to the population size and the total number of features to be screened in the initial population. The iteration process is executed according to the preset total number of iterations, and in each iteration, based on the evaluation results of the evaluation method, the fitness metric is calculated for all chromosomes in the current population, and selection, genetics, and mutation operations are executed in sequence; wherein, in the first iteration, the current population is the initial population; After the preset total number of iterations, the chromosome with the highest fitness (U position) among all chromosomes in the entire iteration process is retained.
7. The method according to claim 1, characterized in that, The step of ranking each set of candidate feature combinations and selecting the combined feature from the highest-ranked set of candidate feature combinations as the target feature includes: For each candidate feature set, for any combination feature in the candidate feature combination set, the square of the chromosome ranking under the corresponding evaluation method is used as the score calculation rule for the feature combination; and, According to the scoring calculation rules, the sum of the scores of all combined features in the candidate feature combination set is taken as the total score of the candidate feature combination set. Select the combined features from the set of candidate feature combinations with the highest ranking as the target features.
8. A modeling feature screening device, characterized in that, include: The first processing module is used to receive sample data input by the user; The second processing module is used to evaluate the sample data using V different evaluation methods, and based on the first U chromosomes obtained by each evaluation method, to determine a set of candidate feature combinations associated with the evaluation method and the chromosome. The third processing module is used to rank each set of candidate feature combinations and select the combined feature from the set of candidate feature combinations with the highest ranking as the target feature.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the method as described in any one of claims 1 to 7.
10. A computer program product, characterized in that, It includes computer instructions that, when executed by a processor, implement the steps of the method as described in any one of claims 1 to 7.