Credit rating assessment method and device, computer device and storage medium
Patent Information
- Application Number
- CN202610929559.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-25
- Publication Date
- 2026-10-13
AI Technical Summary
[0003]然而,现有方法在高维、动态且类别不平衡的数据场景下,往往存在超参数调整依赖经验或穷举搜索、计算开销较大且效率不足的问题;同时,对冗余特征和复杂非线性关系的处理能力有限,易使模型泛化能力和风险识别准确性下降
[0039]本申请实施例提供的信用等级评估方法、装置、计算机设备及存储介质,通过将目标信用特征数据集划分为训练集和测试集,并利用差分进化算法执行包含全局搜索策略和局部搜索策略的混合搜索策略,对随机森林模型的超参数进行优化,得到配置后的随机森林模型,再根据训练集完成模型训练,并基于测试集进行性能评估且在满足预设条件时输出待评估用户的信用等级评估结果,能够提高随机森林模型超参数寻优的效率与针对性,增强模型对高维复杂信用数据及非线性关系的适应能力,进而提升信用等级评估的预测精度、泛化能力和鲁棒性。
Smart Images

Figure CN122905770A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the fields of internet finance risk control and machine learning data processing, and in particular to a credit rating assessment method, apparatus, computer equipment, and storage medium. Background Technology
[0002] In internet finance personal credit risk control, credit risk assessment is usually conducted based on multi-dimensional credit data of customers, using models such as Naive Bayes, Support Vector Machine, or Random Forest.
[0003] However, existing methods often suffer from problems such as relying on experience or exhaustive search for hyperparameter tuning in high-dimensional, dynamic, and class-imbalanced data scenarios, resulting in high computational costs and insufficient efficiency. At the same time, they have limited ability to handle redundant features and complex nonlinear relationships, which can easily lead to a decrease in the model's generalization ability and risk identification accuracy.
[0004] Therefore, how to improve the optimization efficiency, prediction accuracy, and model robustness of credit risk assessment under high-dimensional and complex credit data conditions has become an urgent technical problem to be solved. Summary of the Invention
[0005] This application provides a credit rating assessment method, apparatus, computer device, and storage medium to address the aforementioned technical problems. This method is designed for high-dimensional, dynamic, and class-imbalanced credit feature data scenarios. It collaboratively designs the construction, optimization, training, evaluation, and application processes of the credit rating assessment model, improving the model's ability to characterize complex credit feature relationships while maintaining modeling efficiency, thereby achieving a more accurate assessment of the credit rating of the user being evaluated.
[0006] In a first aspect, embodiments of this application provide a credit rating assessment method, the method comprising:
[0007] The target credit feature dataset is divided into a training set and a test set;
[0008] The hyperparameters of the random forest model are optimized by executing a hybrid search strategy through differential evolution algorithm, resulting in a configured random forest model. The hybrid search strategy includes a global search strategy and a local search strategy. The global search adjusts the population size based on the population diversity judgment mechanism, while the local search optimizes the current optimal solution based on gradient information and multi-path search strategy.
[0009] The configured random forest model is trained using the training set to obtain a trained credit rating assessment model.
[0010] The performance of the credit rating assessment model is evaluated based on the test set. If the performance evaluation results meet the preset conditions, the credit rating assessment result of the user to be evaluated is determined based on the credit rating assessment model.
[0011] In one possible embodiment, the method further includes:
[0012] Update the target credit feature dataset based on the credit rating assessment results of the users to be evaluated;
[0013] Analyze the changes in the data distribution of the updated target credit feature dataset. If the degree of change in the data distribution exceeds the preset degree of change, return to the step of dividing the target credit feature dataset into training and test sets.
[0014] In one possible embodiment, the method further includes:
[0015] Obtain the original credit feature dataset;
[0016] Analyze the correlation between credit features in the original credit feature dataset. If the correlation between the target credit feature and other credit features is greater than a preset level, the target credit feature is identified as a redundant feature and removed.
[0017] The remaining credit features in the original credit feature dataset are normalized to obtain the target credit feature dataset.
[0018] In one possible embodiment, a hybrid search strategy is executed using a differential evolution algorithm to optimize the hyperparameters of the random forest model, including:
[0019] An initial population consisting of several individuals is randomly initialized using a normal distribution. Each individual population represents a set of hyperparameter combinations, including the number of trees and the maximum number of features.
[0020] For each individual in the initial population, its fitness value is calculated based on the training set. The fitness value is the average root mean square error obtained by training the random forest model using K-fold cross-validation.
[0021] Based on the fitness value of each individual, the individual with the smallest fitness value in the initial population is taken as the initial solution, and the target hyperparameter combination is determined by successively adopting local search strategy and global search strategy.
[0022] In one possible embodiment, based on the fitness value of each individual, the individual with the smallest fitness value in the initial population is selected as the initial solution. Local search and global search strategies are then sequentially employed to determine the target hyperparameter combination, including:
[0023] Based on the fitness value of each individual, the individual with the smallest fitness value in the initial population is taken as the initial solution. The first local search sub-strategy and the second search sub-strategy are used for local search optimization in turn, and the contribution of the two sub-strategies is calculated respectively. The contribution is the ratio of the fitness improvement value to the number of evaluations consumed. The first local search sub-strategy includes the finite memory BFGS algorithm with boundary constraints, and the second sub-strategy includes the multi-path search algorithm.
[0024] Determine whether both sub-strategies meet the stopping condition. If both do, the local search is considered to have stalled. Then, a global search strategy is used to regenerate the population. The differential evolution algorithm is used to perform mutation, crossover, and selection operations to update the current optimal solution. Otherwise, the sub-strategy with the greater contribution is selected to continue optimization.
[0025] Determine whether the convergence conditions are met. The convergence conditions include: the current evolutionary generation reaches the preset evolutionary generation, or the population stagnation generation reaches the preset stagnation generation. If met, determine the individual with the smallest fitness value as the target hyperparameter combination. Otherwise, recalculate the fitness value of each individual and determine the target hyperparameter combination based on the new fitness value of each individual.
[0026] In one possible embodiment, the stopping condition for the local search strategy includes: the standard deviation of the improvement rate in the current optimization step is less than the standard deviation of the improvement rate in the previous step.
[0027] In one possible implementation, the population is regenerated using a global search strategy, including:
[0028] When the population diversity of the initial population is lower than a preset threshold, the population is regenerated using a normal distribution.
[0029] The global search is terminated when the stagnation algebra in any dimension exceeds a preset threshold.
[0030] Secondly, embodiments of this application provide a credit rating assessment device, the device comprising:
[0031] The data acquisition module is used to divide the target credit feature dataset into training and test sets;
[0032] The hyperparameter optimization module is used to execute a hybrid search strategy through differential evolution algorithm to optimize the hyperparameters of the random forest model and obtain the configured random forest model. The hybrid search strategy includes a global search strategy and a local search strategy. The global search adjusts the population size based on the population diversity judgment mechanism, while the local search optimizes the current optimal solution based on gradient information and multi-path search strategy.
[0033] The training module is used to train the configured random forest model based on the training set to obtain a trained credit rating assessment model.
[0034] The evaluation and prediction module is used to evaluate the performance of the credit rating evaluation model based on the test set. If the performance evaluation results meet the preset conditions, the credit rating evaluation result of the user to be evaluated is determined based on the credit rating evaluation model.
[0035] Thirdly, embodiments of this application provide a computer device, including: a memory and a processor;
[0036] The memory stores instructions that the computer executes;
[0037] The processor executes computer execution instructions stored in memory, causing the processor to perform the methods provided above.
[0038] Fourthly, embodiments of this application provide a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement the methods provided above.
[0039] The credit rating assessment method, apparatus, computer equipment, and storage medium provided in this application divide the target credit feature dataset into a training set and a test set, and use the differential evolution algorithm to execute a hybrid search strategy including global search and local search strategies to optimize the hyperparameters of the random forest model, thereby obtaining a configured random forest model. Then, the model is trained based on the training set, and its performance is evaluated based on the test set. When preset conditions are met, the credit rating assessment results of the user to be evaluated are output. This can improve the efficiency and relevance of hyperparameter optimization of the random forest model, enhance the model's adaptability to high-dimensional complex credit data and nonlinear relationships, and thus improve the prediction accuracy, generalization ability, and robustness of credit rating assessment. Attached Figure Description
[0040] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0041] Figure 1 Flowchart of the credit rating assessment method provided for this application Figure 1 ;
[0042] Figure 2 Flowchart of the credit rating assessment method provided for this application Figure 2 ;
[0043] Figure 3 A flowchart illustrating the differential improvement algorithm provided in this application;
[0044] Figure 4 Flowchart of the credit rating assessment method provided for this application Figure 3 ;
[0045] Figure 5 A schematic diagram of the credit rating assessment device provided for this application;
[0046] Figure 6 A structural diagram of the computer device subject provided in this application.
[0047] The accompanying drawings illustrate specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to particular embodiments. Detailed Implementation
[0048] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application.
[0049] Internet finance personal credit risk control falls under the field of financial data processing and machine learning assessment technology, and is typically applied in business scenarios such as consumer loan approval, credit card granting, and online lending risk screening. Financial institutions generally rely on credit business platforms, customer information collection modules, and risk assessment modules to process users' income, debt, credit history, and behavioral data to output credit rating results.
[0050] In existing technologies, models such as Naive Bayes, Support Vector Machines, or Random Forests are often built based on multidimensional credit feature data of customers to predict whether a user has the risk of default, and to complete credit approval, credit limit control, or interest rate stratification accordingly. The basic idea is usually to first obtain historical sample data, then train a classification model, and finally input the data of the user to be evaluated into the model to obtain a credit risk judgment.
[0051] However, under conditions of high-dimensional, dynamic, and class-imbalanced credit data, the above-mentioned solutions generally suffer from the problem of relying on human experience or exhaustive search for hyperparameter settings, resulting in a long optimization process and difficulty in adapting to changes in business data distribution in a timely manner. At the same time, when there are many redundant features and complex nonlinear relationships between features, traditional methods are prone to low search efficiency, insufficient model generalization ability, and inaccurate identification of high-risk users.
[0052] The aforementioned defects will further lead to a decrease in the stability of credit rating assessment results. In scenarios with a large number of applications or significant market fluctuations, problems such as assessment lag, increased misjudgment rate, and excessive consumption of computing resources are likely to occur, making it difficult to balance assessment accuracy, response efficiency, and model robustness.
[0053] In light of this, improving the optimization efficiency, prediction accuracy, and model robustness of credit rating assessment under high-dimensional and complex credit data conditions has become an urgent technical problem. To address this issue, a credit rating assessment method is proposed. First, the target credit feature dataset is divided into training and test sets. Then, a hybrid search strategy, including global and local search strategies, is executed using a differential evolution algorithm to optimize the hyperparameters of the random forest model and obtain a configured random forest model. Subsequently, model training is completed based on the training set, and performance evaluation is performed based on the test set. When the performance evaluation results meet preset conditions, the credit rating assessment result for the user to be evaluated is output, thereby improving the efficiency and accuracy of the credit assessment process.
[0054] In one embodiment, such as Figure 1 As shown, credit rating assessment methods include:
[0055] Step 101: Divide the target credit feature dataset into a training set and a test set.
[0056] In this embodiment, the target credit feature dataset serves as the input dataset for subsequent training, testing, and hyperparameter optimization, carrying feature data related to credit rating assessment. This dataset includes multiple credit features, such as applicant identity attributes, income level, job stability, debt ratio, historical delinquency records, credit usage, consumption behavior, device behavior, and application time-series features, combined with corresponding credit rating labels or default markers to form a sample set.
[0057] Based on this target credit feature dataset, it can be divided into training and test sets according to a preset ratio. When the credit rating labels are unevenly distributed, appropriate methods can be used to ensure the representativeness of the sample distribution in both the training and test sets. The training set is used to train the configured random forest model and for fitness evaluation during hyperparameter optimization, while the test set is used for independent performance evaluation after model training. By dividing the target credit feature dataset into training and test sets, the data sources used for subsequent hyperparameter optimization, model training, and generalization validation are consistent and clearly defined, thus providing a repeatable training foundation for the credit rating assessment model.
[0058] Step 102: Execute a hybrid search strategy using the differential evolution algorithm to optimize the hyperparameters of the random forest model and obtain the configured random forest model. The hybrid search strategy includes a global search strategy and a local search strategy. The global search adjusts the population size based on the population diversity judgment mechanism, while the local search optimizes the current optimal solution based on gradient information and a multi-path search strategy.
[0059] In this embodiment of the application, the random forest model is used as the core model for credit rating assessment. Its hyperparameters to be optimized include at least one or more of the following: number of decision trees, maximum tree depth, minimum number of leaf node samples, minimum number of split samples, maximum number of features, and class weight coefficient.
[0060] Differential evolution algorithm is used to search for parameter combinations that fit the target credit feature dataset in the aforementioned hyperparameter space, and to balance global exploration capability and local convergence capability through a hybrid search strategy. In specific implementation, the search space can be constructed based on the value boundaries of each hyperparameter, and an initial population can be initialized, with each individual corresponding to a set of random forest hyperparameter codes. For each individual, a fitness value can be calculated based on the training set and according to a preset evaluation index, so that the identification results of high-risk users are reflected in the optimization process.
[0061] During the iterative optimization process, the global search strategy and the local search strategy in the hybrid search strategy work alternately. In the global search phase, the population size is adjusted based on a population diversity judgment mechanism. Population diversity can be calculated by the distribution of individuals across various hyperparameter dimensions. When high population diversity is detected, the current population size is maintained and the search range is expanded through differential evolution. When a decrease in population diversity is detected, the population size is adjusted to improve the search space coverage. In the local search phase, fine-tuning is performed around the current optimal solution. Since the hyperparameters of a random forest can contain both integer and discrete variables, in this embodiment, the fitness function can be considered an evaluable objective function. Gradient information is formed by estimating the impact of changes in each dimension on fitness near the current optimal solution. The gradient information is used to provide an improvement direction for the current optimal solution, and the multi-track search strategy is used to generate multiple candidate search trajectories in that direction and its perturbation directions, updating the current optimal solution based on fitness changes. After a preset stopping condition is met, the local search ends, and the system returns to the global search phase to continue participating in population evolution until the preset stopping condition is met. The final output of the target hyperparameter combination serves as the configured random forest model.
[0062] Based on the above analysis, this step combines the differential evolution algorithm with global search and local search, and introduces a population size adjustment mechanism based on population diversity in the global search, and introduces gradient information and multi-path search strategy in the local search. This makes the hyperparameter optimization process independent of manual exhaustive setting, and can expand the coverage in the early stage of the search and refine the high-quality solution region in the later stage of the search. It is more suitable for high-dimensional, dynamic and class-imbalanced credit data.
[0063] Step 103: Train the configured random forest model based on the training set to obtain the trained credit rating assessment model.
[0064] In this embodiment of the application, after completing the hyperparameter optimization, the target hyperparameter combination is written into the configuration file or model initialization parameters of the random forest model to obtain the configured random forest model, and formal training is performed based on the training set.
[0065] The training set, as a subset of data used for model parameter learning and fitting, contains not only credit feature vectors but also credit rating labels corresponding to each sample. During training, a feature matrix is first constructed from the sample records in the training set to generate input vectors of uniform dimension. Then, the credit rating labels are converted into classification targets that the model can recognize. If the business adopts a multi-level credit system, the credit rating labels can be encoded as multi-class labels corresponding to levels A, B, C, and D; if the business adopts a binary classification system of risk approval and rejection, they are converted into default risk category labels.
[0066] The random forest model performs bootstrap sampling and multi-tree parallel modeling according to the configured hyperparameters. This involves repeatedly sampling the training set with replacement to generate multiple sub-training sets, and randomly selecting some features for node splitting during the construction of each decision tree. Node splitting can be based on the Gini index, information gain, or information gain ratio; in this embodiment, the Gini index is used to measure splitting purity until the constraints of maximum tree depth, minimum number of split samples, or minimum number of leaf node samples are met. For imbalanced credit data, the optimized class weight parameters are incorporated into the splitting criteria or sample sampling probability during the training phase to increase the influence weight of high-risk samples in the tree construction process. After training, the decision trees in the random forest collectively form a trained credit rating assessment model. The model output can be the predicted probability distribution for each credit rating or the default risk probability value.
[0067] In one possible embodiment, the training phase also records the out-of-bag error, the importance scores of each feature, and the prediction consistency index between different trees to check whether the model is overfitting or has excessive feature dependence. For example, after training is complete, the model parameters, training time, input feature version number, and data timestamp are written to the model management module for subsequent deployment and version rollback. Through the above training process, the configured random forest model completes the transformation from the optimal hyperparameter state to the executable credit prediction state, forming a trained credit rating assessment model that can output a credit rating determination result after inputting user credit features.
[0068] Step 104: Perform a performance evaluation on the credit rating assessment model based on the test set. If the performance evaluation results meet the preset conditions, determine the credit rating assessment result of the user to be evaluated based on the credit rating assessment model.
[0069] In this embodiment, the test set, as a subset of data independent of the training process, is used to test the generalization ability of the trained credit rating assessment model on data not used in the training process. Specifically, the sample features from the test set are input into the trained credit rating assessment model to obtain the predicted credit rating or probability value for each rating corresponding to each test sample. The prediction results are then compared with the true labels in the test set to calculate the model performance evaluation result.
[0070] Performance evaluation metrics include at least one of precision, recall, and F1-score, and may also include AUC (Area Under the Curve), KS (Kolmogorov-Smirnov) value, accuracy, confusion matrix results, and high-risk sample identification rate. Considering the high cost of misjudging high-risk samples in personal credit risk control scenarios, this embodiment uses recall and F1-score as core judgment metrics, combined with AUC to reflect overall ranking ability.
[0071] The preset conditions can be set to at least one or more joint conditions. When the performance evaluation result meets the preset conditions, the credit characteristics of the user to be evaluated are converted into a model input vector according to the same field mapping and encoding rules as in the training phase. This vector is then input into the credit rating evaluation model for inference, and the credit rating evaluation result of the user to be evaluated is output. This result can be a discrete credit rating label or a rating result mapped from a default risk probability interval.
[0072] When the performance evaluation results do not meet the preset conditions, this embodiment does not directly output the credit rating evaluation results for the user to be evaluated. Instead, it feeds back the unmet evaluation indicators and corresponding model configurations to the hyperparameter optimization process, re-executes the hybrid search strategy of the differential evolution algorithm, or backtracks to the data processing stage to re-examine the division of the training and test sets, category distribution, and handling of outliers. Therefore, only after the credit rating evaluation model has been verified on the test set and meets the preset usage standards is it used for actual user evaluation, thus ensuring that the credit rating evaluation results for the user to be evaluated are based on a validated model.
[0073] Based on the above analysis, this application provides a credit rating assessment method, including: dividing the target credit feature dataset into a training set and a test set; optimizing the hyperparameters of a random forest model using a hybrid search strategy via differential evolution algorithm to obtain a configured random forest model. The hybrid search strategy includes a global search strategy and a local search strategy. The global search adjusts the population size based on a population diversity judgment mechanism, while the local search optimizes the current optimal solution based on gradient information and a multi-path search strategy; training the configured random forest model using the training set to obtain a trained credit rating assessment model; evaluating the performance of the credit rating assessment model based on the test set; and determining the credit rating assessment result for the user to be assessed based on the credit rating assessment model if the performance assessment result meets preset conditions. In this embodiment, by separating the training and testing of the target credit feature dataset, using a hybrid search involving global exploration and local refinement to optimize the hyperparameters of the random forest using a differential evolution algorithm, and performing user assessment only after verification on the test set, a closed-loop process of hyperparameter optimization, model training, and result output can be completed under high-dimensional and complex credit data conditions, enabling the credit rating assessment process to have high optimization efficiency, prediction accuracy, and model robustness.
[0074] Based on the foregoing embodiments, the method further includes:
[0075] Update the target credit feature dataset based on the credit rating assessment results of the users to be evaluated;
[0076] Analyze the changes in the data distribution of the updated target credit feature dataset. If the degree of change in the data distribution exceeds the preset degree of change, return to the step of dividing the target credit feature dataset into training and test sets.
[0077] Among them, the dataset that remains the basis for subsequent training and evaluation after the data update is used to accommodate the dynamic changes in credit feature data; the credit judgment results output by a single user participate in the update of the target credit feature dataset so that the dataset contains the latest evaluation feedback; the change in data distribution is used to characterize the degree of difference in the feature value distribution of the target credit feature dataset before and after the update, and the preset degree of change is used as the threshold for determining whether to trigger a re-division.
[0078] In its implementation, after obtaining the credit rating assessment result for the user to be evaluated, the system updates the credit features corresponding to the assessment result by associating them with the existing samples in the target credit feature dataset. The update methods include writing the user's credit features into the dataset, replacing, supplementing, or correcting credit features related to the user, and synchronously recording changes in the assessment results within a predetermined time period, ensuring that the updated target credit feature dataset reflects the current credit status. Subsequently, the system performs statistical analysis on the updated feature value range, sample central tendency, and dispersion, and compares the obtained degree of change with a preset degree of change. When the degree of change exceeds the preset degree of change, the system returns to the process of dividing the target credit feature dataset into training and test sets, regenerating training and test subsets based on the updated data.
[0079] This processing method enables the target credit feature dataset to be continuously updated upon receiving new credit rating assessment results, and triggers re-split when the data distribution changes significantly. This ensures that subsequent training and test sets correspond to the latest data state, guaranteeing that model training and performance evaluation are based on a consistent data distribution. Consequently, the credit rating assessment model maintains good adaptability in data drift scenarios, and the retraining and re-evaluation results are more consistent with the current business data characteristics.
[0080] Based on the foregoing embodiments, the method further includes:
[0081] Obtain the original credit feature dataset;
[0082] Analyze the correlation between credit features in the original credit feature dataset. If the correlation between the target credit feature and other credit features is greater than a preset level, the target credit feature is identified as a redundant feature and removed.
[0083] The remaining credit features in the original credit feature dataset are normalized to obtain the target credit feature dataset.
[0084] The original credit feature dataset provides the initial source of credit features for analysis. It is a directly obtained dataset, and the original credit features may include data items related to credit risk such as customer income, debt ratio, historical credit records, consumption behavior, and transaction frequency. The target credit feature refers to the credit feature used as the object of judgment in the correlation analysis, while other credit features refer to the remaining features that participate in the correlation judgment together with the target credit feature.
[0085] Normalization is used to map the remaining credit features with different dimensions and value ranges to a unified scale, thereby forming the target credit feature dataset.
[0086] After obtaining the original credit feature dataset, correlation analysis is performed on each credit feature. This analysis can be achieved using methods such as Pearson correlation coefficient, Spearman rank correlation coefficient, or cosine similarity. The analysis focuses on the degree of association between any target credit feature and the remaining credit features. When the correlation between a target credit feature and at least one other credit feature is greater than a preset threshold, it indicates that the target credit feature contains information with high overlap with other features. This feature is then identified as redundant and removed from the original credit feature dataset. Features with more stable information representation or lower missing rates can be retained during removal, and the remaining features continue to be processed. Subsequently, normalization is performed on the remaining credit features after removing redundant features. Normalization can be performed using max-min normalization or standardization methods to compress each feature value to a preset range or a uniform distribution scale, resulting in the target credit feature dataset, which is used for subsequent training and test set partitioning and model optimization.
[0087] This processing method identifies and removes duplicate information through correlation analysis, and then unifies the scale of the remaining features, making the input data more suitable for subsequent modeling in terms of information density and numerical distribution. Because redundant features are eliminated, the proportion of effective information in the target credit feature dataset increases, and the normalized features have a consistent numerical scale during calculation. This makes the training input for the subsequent credit rating assessment model more stable, facilitating improved model training efficiency and consistency with evaluation results.
[0088] In one possible implementation, such as Figure 2 As shown, a hybrid search strategy is implemented using the differential evolution algorithm to optimize the hyperparameters of the random forest model, including:
[0089] Step 201: Initialize an initial population consisting of several individuals using a normal distribution. Each individual population represents a set of hyperparameter combinations, including the number of trees and the maximum number of features.
[0090] Step 202: For each individual in the initial population, calculate its fitness value based on the training set. The fitness value is the average root mean square error obtained by training the random forest model using K-fold cross-validation.
[0091] Step 203: Based on the fitness value of each individual, the individual with the smallest fitness value in the initial population is taken as the initial solution, and the target hyperparameter combination is determined by sequentially using local search strategy and global search strategy.
[0092] The initial population is used to carry multiple sets of candidate hyperparameter combinations. Each individual corresponds to a specific set of hyperparameter configurations. The fitness value is used to characterize the model error level corresponding to the configuration. The initial solution is used as the starting optimization point for subsequent hybrid search. The target hyperparameter combination is the optimal parameter configuration of the final output.
[0093] In practical implementation, when randomly initializing the initial population using a normal distribution, the mean and variance can be set based on the common value range of hyperparameters in historical training samples. Then, several individuals are generated under this distribution. Each individual contains two parameters: the number of trees and the maximum number of features. The number of trees controls the number of base learners in the random forest, and the maximum number of features controls the size of the candidate features for each node split. After inputting the random forest model corresponding to each individual into the training set, K-fold cross-validation is used to train and validate the model. The root mean square error obtained from each fold is averaged to form the fitness value of that individual. The smaller the fitness value, the lower the prediction error of the model corresponding to that hyperparameter combination.
[0094] After obtaining the fitness values of each individual, the individual with the smallest fitness value is selected from the initial population as the initial solution. Based on this initial solution, a local search strategy is first executed, followed by a global search strategy. The local search strategy is used to fine-tune the number of trees and the maximum number of features around the current solution, while the global search strategy is used to re-explore candidate combinations in a larger parameter space. The two strategies work together to form a hybrid search process until the target hyperparameter combination that meets the convergence condition is obtained. In practical applications, the specific parameter configurations of the local and global search strategies can be adjusted according to different data scales, and this embodiment does not limit this.
[0095] This implementation initializes a broad and well-distributed candidate population using a normal distribution, and combines this with K-fold cross-validation to obtain stable error evaluation results. Then, using the optimal individual as a starting point, a joint local and global search is performed, enabling the random forest hyperparameters to achieve a more reasonable configuration in a shorter time. This results in more stable error performance after model training and stronger adaptability to complex credit feature data.
[0096] Building upon the aforementioned embodiments, further, based on the fitness value of each individual, the individual with the smallest fitness value in the initial population is selected as the initial solution. Local search and global search strategies are then sequentially employed to determine the target hyperparameter combination, including:
[0097] Based on the fitness value of each individual, the individual with the smallest fitness value in the initial population is taken as the initial solution. The first local search sub-strategy and the second search sub-strategy are used for local search optimization in turn, and the contribution of the two sub-strategies is calculated respectively. The contribution is the ratio of the fitness improvement value to the number of evaluations consumed. The first local search sub-strategy includes the finite memory BFGS (Broyden-Fletcher-Goldfarb-Shanno) algorithm with boundary constraints, and the second sub-strategy includes the multi-path search algorithm.
[0098] Determine whether both sub-strategies meet the stopping condition. If both do, the local search is considered to have stalled. Then, a global search strategy is used to regenerate the population. The differential evolution algorithm is used to perform mutation, crossover, and selection operations to update the current optimal solution. Otherwise, the sub-strategy with the greater contribution is selected to continue optimization.
[0099] Determine whether the convergence conditions are met. The convergence conditions include: the current evolutionary generation reaches the preset evolutionary generation, or the population stagnation generation reaches the preset stagnation generation. If met, determine the individual with the smallest fitness value as the target hyperparameter combination. Otherwise, recalculate the fitness value of each individual and determine the target hyperparameter combination based on the new fitness value of each individual.
[0100] The contribution is used to measure the improvement in fitness brought about by different local search sub-strategies under the unit evaluation resource consumption. The fitness improvement value is the difference between the fitness values before and after the local search. The number of evaluation consumption is the number of fitness evaluations performed during the execution of the sub-strategy.
[0101] In its implementation, the system first selects the smallest fitness value for each individual as the initial solution. Then, it calls both the bounded-memory BFGS algorithm and the multi-path search algorithm around this initial solution to perform local optimization. The bounded-memory BFGS algorithm maintains a finite-length historical gradient and displacement information during the solution process and truncates the search direction and step size based on the upper and lower bounds of the hyperparameter values, ensuring that the updated individual always remains within the feasible region. The multi-path search algorithm generates candidate solutions in parallel with multiple perturbation directions, recalculates the fitness value for each candidate solution, and selects the better solution for further iteration. After each local update, the difference in fitness before and after optimization, along with the corresponding number of evaluations, is statistically analyzed. Based on this, the contribution of the two sub-strategies is calculated, allowing the selection of the sub-strategy with the larger contribution for further optimization in subsequent iterations.
[0102] When both sub-strategies reach their preset stopping conditions, the system determines that the local search has stalled and switches to the global search strategy to regenerate the population. The global search strategy performs mutation, crossover, and selection operations in differential evolution based on the current population. In the mutation phase, candidate individuals are constructed using the difference vector; in the crossover phase, mutated individuals are combined with original individuals according to the crossover probability to generate trial individuals; and in the selection phase, better individuals are retained based on fitness comparison, while the current optimal solution is updated. If neither sub-strategy simultaneously meets its stopping condition, the sub-strategy with the greater contribution is retained as the subsequent optimization path, concentrating local search resources on higher-yield search directions.
[0103] After each round of local or global search, the system determines whether the current evolutionary generation has reached the preset evolutionary generation or the population stagnation generation has reached the preset stagnation generation. If either condition is met, the individual with the smallest current fitness value is directly identified as the target hyperparameter combination; if neither condition is met, the new fitness value of each individual is recalculated, and the target hyperparameter combination is continued to be selected and updated based on the new fitness value. In this way, the search process can switch between local fine-tuning and global exploration, and output the final hyperparameter combination when the convergence condition is met.
[0104] This approach enables the local search phase to adaptively select search sub-strategies based on contribution and promptly switch to global search when stagnation occurs. Meanwhile, by controlling the termination of iterations through convergence conditions and continuously updating new fitness values, the hyperparameter combination can achieve more stable optimization results within limited computing resources.
[0105] In one possible implementation, the stopping condition for the local search strategy includes: the standard deviation of the improvement rate in the current optimization step is less than the standard deviation of the improvement rate in the previous step.
[0106] The stopping condition is a criterion used to determine whether a local search should end. The standard deviation of the improvement rate in the current optimization step characterizes the dispersion of the improvement magnitude compared to the previous step, while the standard deviation of the improvement rate in the previous step serves as a historical indicator for comparison. The standard deviation of the improvement rate can be obtained by statistically analyzing the changes in fitness values over several consecutive local optimizations, reflecting the fluctuations in the current search return.
[0107] In practical implementation, after each round of optimization in the local search, based on the fitness improvement values corresponding to multiple candidate hyperparameter combinations obtained in that round, the standard deviation of the improvement rate for the current optimization step can be calculated, while simultaneously retaining the standard deviation from the previous round as a control. When the standard deviation of the improvement rate for the current optimization step is less than that of the previous step, it indicates that the dispersion in the optimization magnitude of the current round has decreased, and the local search has shown a weakening or stabilizing state. At this point, the local search strategy is deemed to have met the stopping condition, and the current optimal solution is output to the subsequent global search or model training stage.
[0108] This stopping condition identifies stagnation trends in the local search by comparing the changes in standard deviation between adjacent optimization steps. This allows the local search to terminate promptly when returns decrease, freeing up computational resources for subsequent, more efficient search or training processes. Consequently, the termination criteria for the hyperparameter optimization process better align with the convergence characteristics of the local search, improving the overall efficiency and stability of the credit rating assessment model optimization process.
[0109] In one embodiment, taking the Adaptive Global Search (AGS) algorithm as the global search strategy, the Adaptive Mahalanobis-Taguchi System (AMTS) algorithm as the local search strategy, and the Boundary Constrained Finite Memory BFGS algorithm (AL-BFGS-B algorithm) as an example, the flowchart of the above-mentioned differential improvement algorithm is as follows: Figure 3 As shown. Specifically, in the local search phase, the AL-BFGS-B algorithm is first used for optimization, followed by the AMTS algorithm. The contribution of each adaptive local search algorithm is calculated, and it is determined whether the maximum number of evaluations has been reached. If the maximum number of evaluations has not been reached, it is determined whether the stopping condition is met, and then the AGS algorithm is used for optimization.
[0110] In one possible implementation, such as Figure 4 As shown, a global search strategy is used to regenerate the population, including:
[0111] Step 401: When the population diversity of the initial population is lower than a preset threshold, the population is regenerated using a normal distribution method.
[0112] Step 402: When the stagnant algebra of any dimension exceeds a preset threshold, terminate the global search.
[0113] Among them, population diversity is used to characterize the degree of dispersion of each individual in the initial population in the hyperparameter space, stagnation generation is used to characterize the cumulative number of generations in which a certain dimension has not achieved effective improvement in continuous iteration, and preset threshold is used to limit the degree of population convergence and the search termination condition.
[0114] In the specific implementation, the global search phase first calculates the diversity index for the current initial population. The diversity index can be represented by the average Euclidean distance or standard deviation between the hyperparameter vectors of each individual, and is compared with a preset threshold. When the calculated result is lower than the threshold, it indicates that the population distribution tends to be concentrated. Then, using the current optimal solution or the population center as the mean and the preset scale parameter as the variance, several candidate individuals are regenerated on each hyperparameter dimension using a normal distribution, and the generated results are mapped to the effective value range of the random forest hyperparameters. For discrete hyperparameters such as the number of trees and the maximum number of features, rounding and boundary truncation can be performed after sampling to ensure that the new individuals satisfy the search domain constraints.
[0115] During the continuous iterative global search, the system counts the number of times the optimal value is updated for each dimension. When a dimension has not shown a change exceeding a preset improvement range for several consecutive generations, the stagnation generation for that dimension is increased. When the stagnation generation for any dimension exceeds a preset threshold, it indicates that the dimension has been in an ineffective exploration state for a long time, and the global search is terminated directly. The currently recorded combination of target hyperparameters is then output as the subsequent optimization result. This approach allows the population to regain coverage when its distribution is too concentrated and to end ineffective iterations in a timely manner when the search stagnates for a long time, thereby reducing computational resource consumption and maintaining the effectiveness of hyperparameter optimization.
[0116] It should be understood that although the steps in the flowcharts of the above embodiments are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the above embodiments may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.
[0117] Based on the same inventive concept, this application also provides a credit rating assessment device. The solution provided by this device is similar to the solution described in the above method. Therefore, the specific limitations of one or more credit rating assessment device embodiments provided below can be found in the limitations of the credit rating assessment method above, and will not be repeated here.
[0118] Figure 5 A schematic diagram of the credit rating assessment device provided in this application is shown below. Figure 5 As shown, the credit rating assessment device provided in this embodiment includes:
[0119] Data acquisition module 501 is used to divide the target credit feature dataset into training set and test set;
[0120] The hyperparameter optimization module 502 is used to execute a hybrid search strategy through differential evolution algorithm to optimize the hyperparameters of the random forest model and obtain the configured random forest model. The hybrid search strategy includes a global search strategy and a local search strategy. The global search adjusts the population size based on the population diversity judgment mechanism, and the local search optimizes the current optimal solution based on gradient information and multi-track search strategy.
[0121] Training module 503 is used to train the configured random forest model based on the training set to obtain a trained credit rating assessment model.
[0122] The evaluation and prediction module 504 is used to evaluate the performance of the credit rating evaluation model based on the test set. If the performance evaluation results meet the preset conditions, the credit rating evaluation result of the user to be evaluated is determined based on the credit rating evaluation model.
[0123] In one possible implementation, the data acquisition module 501 is further used for:
[0124] Update the target credit feature dataset based on the credit rating assessment results of the users to be evaluated;
[0125] Analyze the changes in the data distribution of the updated target credit feature dataset. If the degree of change in the data distribution exceeds the preset degree of change, return to the step of dividing the target credit feature dataset into training and test sets.
[0126] In one possible implementation, the data acquisition module 501 is further used for:
[0127] Obtain the original credit feature dataset;
[0128] Analyze the correlation between credit features in the original credit feature dataset. If the correlation between the target credit feature and other credit features is greater than a preset level, the target credit feature is identified as a redundant feature and removed.
[0129] The remaining credit features in the original credit feature dataset are normalized to obtain the target credit feature dataset.
[0130] In one possible implementation, the hyperparameter optimization module 502 is specifically used for:
[0131] An initial population consisting of several individuals is randomly initialized using a normal distribution. Each individual population represents a set of hyperparameter combinations, including the number of trees and the maximum number of features.
[0132] For each individual in the initial population, its fitness value is calculated based on the training set. The fitness value is the average root mean square error obtained by training the random forest model using K-fold cross-validation.
[0133] Based on the fitness value of each individual, the individual with the smallest fitness value in the initial population is taken as the initial solution, and the target hyperparameter combination is determined by successively adopting local search strategy and global search strategy.
[0134] In one possible implementation, the hyperparameter optimization module 502 is specifically used for:
[0135] Based on the fitness value of each individual, the individual with the smallest fitness value in the initial population is taken as the initial solution. The first local search sub-strategy and the second search sub-strategy are used for local search optimization in turn, and the contribution of the two sub-strategies is calculated respectively. The contribution is the ratio of the fitness improvement value to the number of evaluations consumed. The first local search sub-strategy includes the finite memory BFGS algorithm with boundary constraints, and the second sub-strategy includes the multi-path search algorithm.
[0136] Determine whether both sub-strategies meet the stopping condition. If both do, the local search is considered to have stalled. Then, a global search strategy is used to regenerate the population. The differential evolution algorithm is used to perform mutation, crossover, and selection operations to update the current optimal solution. Otherwise, the sub-strategy with the greater contribution is selected to continue optimization.
[0137] Determine whether the convergence conditions are met. The convergence conditions include: the current evolutionary generation reaches the preset evolutionary generation, or the population stagnation generation reaches the preset stagnation generation. If met, determine the individual with the smallest fitness value as the target hyperparameter combination. Otherwise, recalculate the fitness value of each individual and determine the target hyperparameter combination based on the new fitness value of each individual.
[0138] In one possible implementation, the hyperparameter optimization module 502 is specifically used to determine the stopping conditions of the local search strategy, including: the standard deviation of the improvement rate in the current optimization step is less than the standard deviation of the improvement rate in the previous step.
[0139] In one possible implementation, the hyperparameter optimization module 502 is specifically used for:
[0140] When the population diversity of the initial population is lower than a preset threshold, the population is regenerated using a normal distribution.
[0141] The global search is terminated when the stagnation algebra in any dimension exceeds a preset threshold.
[0142] The credit rating assessment device provided in this embodiment can execute the method provided in the above method embodiment. Its implementation principle and technical effect are similar, and will not be described in detail here.
[0143] Figure 6 A schematic diagram of the structure of the computer device provided in this application. Figure 6 As shown, the computer device 60 provided in this embodiment includes at least one processor 601 and a memory 602. Optionally, the computer device 60 further includes a communication component 603. The processor 601, memory 602, and communication component 603 are connected via a bus 604.
[0144] In the specific implementation process, at least one processor 601 executes computer execution instructions stored in memory 602, causing at least one processor 601 to execute the above-mentioned credit rating assessment method.
[0145] The specific implementation process of processor 601 can be found in the above method embodiments, and its implementation principle and technical effect are similar. It will not be repeated here.
[0146] In the above embodiments, it should be understood that the processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), etc. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in this invention can be directly implemented by a hardware processor, or implemented by a combination of hardware and software modules within the processor.
[0147] The memory may include random access memory (RAM) and may also include non-volatile memory (NVM), such as at least one disk storage device.
[0148] The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc. For ease of illustration, the buses shown in the accompanying drawings are not limited to a single bus or a single type of bus.
[0149] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the credit rating assessment method described above.
[0150] This application also provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the aforementioned credit rating assessment method.
[0151] The aforementioned readable storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk. The readable storage medium can be any available medium accessible to a general-purpose or special-purpose computer.
[0152] An exemplary readable storage medium is coupled to a processor, enabling the processor to read information from and write information to the readable storage medium. Of course, the readable storage medium can also be a component of the processor. The processor and the readable storage medium can reside in an Application Specific Integrated Circuit (ASIC). Alternatively, the processor and the readable storage medium can exist as discrete components in the device.
[0153] The division of units is merely a logical functional division; in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be indirect coupling or communication connection through some interfaces, devices, or units, and may be electrical, mechanical, or other forms.
[0154] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0155] In addition, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0156] If a function is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0157] Those skilled in the art will understand that all or part of the steps of the above-described method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When executed, the program performs the steps of the above-described method embodiments; and the aforementioned storage medium includes various media capable of storing program code, such as ROM, RAM, magnetic disks, or optical disks.
[0158] Finally, it should be noted that other embodiments of the invention will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This invention is intended to cover any variations, uses, or adaptations of the invention that follow the general principles of the invention and include common knowledge or customary techniques in the art not disclosed herein, and is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope.
Claims
1. A credit rating assessment method, characterized in that, The method includes: The target credit feature dataset is divided into a training set and a test set; The hyperparameters of the random forest model are optimized by executing a hybrid search strategy through differential evolution algorithm to obtain the configured random forest model. The hybrid search strategy includes a global search strategy and a local search strategy. The global search adjusts the population size based on the population diversity judgment mechanism, and the local search optimizes the current optimal solution based on gradient information and multi-track search strategy. The configured random forest model is trained based on the training set to obtain a trained credit rating assessment model. The credit rating assessment model is evaluated based on the test set. If the performance evaluation results meet the preset conditions, the credit rating assessment result of the user to be evaluated is determined based on the credit rating assessment model.
2. The method according to claim 1, characterized in that, The method further includes: Update the target credit feature dataset based on the credit rating assessment results of the user to be evaluated; Analyze the changes in the data distribution of the updated target credit feature dataset. If the degree of change in the data distribution exceeds a preset degree of change, return to the step of dividing the target credit feature dataset into a training set and a test set.
3. The method according to claim 1, characterized in that, The method further includes: Obtain the original credit feature dataset; Analyze the correlation between credit features in the original credit feature dataset. If the correlation between the target credit feature and other credit features is greater than a preset level, the target credit feature is determined to be a redundant feature and is removed. The remaining credit features in the original credit feature dataset are normalized to obtain the target credit feature dataset.
4. The method according to claim 1, characterized in that, The process of optimizing the hyperparameters of the random forest model by executing a hybrid search strategy using a differential evolution algorithm includes: An initial population consisting of several individuals is randomly initialized using a normal distribution. Each individual population represents a set of hyperparameter combinations, which include the number of trees and the maximum number of features. For each individual in the initial population, its fitness value is calculated based on the training set. The fitness value is the average root mean square error obtained by training the random forest model using K-fold cross-validation. Based on the fitness value of each individual, the individual with the smallest fitness value in the initial population is taken as the initial solution, and the target hyperparameter combination is determined by sequentially employing local search strategy and global search strategy.
5. The method according to claim 4, characterized in that, Based on the fitness value of each individual, the individual with the smallest fitness value in the initial population is selected as the initial solution. Local search and global search strategies are then used sequentially to determine the target hyperparameter combination, including: Based on the fitness value of each individual, the individual with the smallest fitness value in the initial population is taken as the initial solution. The first local search sub-strategy and the second search sub-strategy are used for local search optimization in sequence, and the contribution of the two sub-strategies is calculated respectively. The contribution is the ratio of fitness improvement value to the number of evaluations consumed. The first local search sub-strategy includes the finite memory BFGS algorithm with boundary constraints, and the second sub-strategy includes the multi-path search algorithm. Determine whether both sub-strategies meet the stopping condition. If both do, the local search is considered to have stalled. Then, a global search strategy is used to regenerate the population. The differential evolution algorithm is used to perform mutation, crossover, and selection operations to update the current optimal solution. Otherwise, the sub-strategy with the greater contribution is selected to continue optimization. Determine whether the convergence condition is met. The convergence condition includes: the current evolutionary generation reaches the preset evolutionary generation, or the population stagnation generation reaches the preset stagnation generation. If the condition is met, determine the individual with the smallest fitness value as the target hyperparameter combination. Otherwise, recalculate the fitness value of each individual and determine the target hyperparameter combination based on the new fitness value of each individual.
6. The method according to claim 5, characterized in that, The stopping condition for the local search strategy includes: the standard deviation of the improvement rate in the current optimization step is less than the standard deviation of the improvement rate in the previous step.
7. The method according to claim 5, characterized in that, The process of regenerating the population using a global search strategy includes: When the population diversity of the initial population is lower than a preset threshold, the population is regenerated using a normal distribution. The global search is terminated when the stagnation algebra in any dimension exceeds a preset threshold.
8. A credit rating assessment device, characterized in that, The device includes: The data acquisition module is used to divide the target credit feature dataset into training and test sets; The hyperparameter optimization module is used to execute a hybrid search strategy through differential evolution algorithm to optimize the hyperparameters of the random forest model and obtain the configured random forest model. The hybrid search strategy includes a global search strategy and a local search strategy. The global search adjusts the population size based on the population diversity judgment mechanism, and the local search optimizes the current optimal solution based on gradient information and multi-track search strategy. The training module is used to train the configured random forest model based on the training set to obtain a trained credit rating assessment model. The evaluation and prediction module is used to evaluate the performance of the credit rating evaluation model based on the test set, and determine the credit rating evaluation result of the user to be evaluated based on the credit rating evaluation model if the performance evaluation result meets the preset conditions.
9. A computer device, characterized in that, include: Memory, processor; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory, causing the processor to perform the method as described in any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the method as described in any one of claims 1-7.