Loan risk information automatic prediction method and device, electronic equipment, storage medium and program product

By preprocessing and feature eliminating the company's historical operating data, combining the risk prediction model and the threshold determination of the ROC curve chart, the problem of inaccurate manual prediction is solved, and accurate prediction and efficient evaluation of loan risk information is achieved.

CN119622487APending Publication Date: 2025-03-14BANK OF CHINA
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411603340.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-11
Publication Date
2025-03-14

AI Technical Summary

Technical Problem

In the prior art, manual reliance on data and financial statements to predict corporate loan risk information, resulting in inaccurate predictions and a lot of manpower and time.

Method used

By retrieving the company's historical operating data from the database, pre-processing of data and eliminating recursive feature, generating optimal evaluation data, and using risk prediction models for training, drawing a ROC curve chart to determine the optimal threshold, and finally determining loan risk information.

Benefits of technology

Accurate prediction of enterprise loan risk information is achieved, prediction efficiency and accuracy are improved, and model complexity is reduced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119622487A_ABST
    Figure CN119622487A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides an automatic prediction method and device for loan risk information, electronic equipment, a storage medium and a program product. The method can be used in artificial intelligence field. The method comprises the steps of calling historical operation data of an enterprise from a database, and performing data preprocessing on the historical operation data to obtain preliminary evaluation data; performing recursive feature elimination processing on the preliminary evaluation data to obtain optimal evaluation data; generating an optimal evaluation training set and an optimal evaluation test set according to the optimal evaluation data; according to the feature data of the optimal evaluation training set, training the initial model to obtain a risk prediction model; predicting the optimal evaluation test set by using a risk prediction model to generate a prediction result, and drawing an ROC curve graph according to the prediction result to obtain an optimal threshold value; and determining loan risk information corresponding to the historical operation data according to the risk prediction model and the optimal threshold. The method is used for achieving the effect of accurately predicting loan risk information.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of artificial intelligence, and in particular to a method, device, electronic device, storage medium and program product for automatically predicting loan risk information. Background Art

[0002] With the continuous development of the economy and the advancement of globalization, the credit risks faced by banks are increasing, especially in the field of small and medium-sized enterprise loans. It is necessary to predict the risk information of corporate loans in advance and then determine whether the company will default.

[0003] In the prior art, enterprise loan risk information is manually predicted based on data, financial statements and other information.

[0004] However, the manual prediction method is not accurate and requires a lot of manpower and time costs. Therefore, there is an urgent need for a solution that can accurately and timely predict corporate loan risk information. Summary of the invention

[0005] The embodiments of the present application provide a method, device, electronic device, storage medium and program product for automatically predicting loan risk information, so as to achieve the effect of accurately predicting loan risk information.

[0006] In a first aspect, an embodiment of the present application provides a method for automatically predicting loan risk information, comprising:

[0007] Retrieving the historical operating data of the enterprise from the database, and performing data preprocessing on the historical operating data to obtain preliminary evaluation data;

[0008] Performing recursive feature elimination processing on the preliminary evaluation data to obtain optimal evaluation data; wherein the number of features in the optimal evaluation data is less than the number of features in the preliminary evaluation data;

[0009] Generate an optimal evaluation training set and an optimal evaluation test set according to the optimal evaluation data;

[0010] Training the initial model according to the characteristic data of the optimal evaluation training set to obtain a risk prediction model;

[0011] Using the risk prediction model to predict the optimal evaluation test set, generating a prediction result, and drawing a ROC curve diagram according to the prediction result to obtain an optimal threshold;

[0012] The loan risk information corresponding to the historical operating data is determined based on the risk prediction model and the optimal threshold.

[0013] In a possible implementation, recursive feature elimination processing is performed on the preliminary evaluation data to obtain optimal evaluation data, including:

[0014] According to the preliminary evaluation data, an initial feature model is trained to obtain a feature processing model;

[0015] According to the recursive feature elimination method and the feature processing model, the preliminary evaluation data is processed to obtain a ranking result of the preliminary evaluation data; wherein the ranking result represents the importance ranking of the features in the preliminary evaluation data;

[0016] The optimal evaluation data is obtained according to the preset number of target features and the sorting result.

[0017] In a possible implementation, the preliminary evaluation data is processed according to the recursive feature elimination method and the feature processing model to obtain a ranking result of the preliminary evaluation data, including:

[0018] According to the recursive feature elimination method, the features in the preliminary evaluation data are screened to obtain a screened feature subset;

[0019] Determining weight values ​​of features in the preliminary evaluation data according to the feature processing model and the filtered feature subset; wherein the weight values ​​represent the contribution of the features in the feature processing model;

[0020] According to the weight values ​​of the features in the preliminary evaluation data, the features in the preliminary evaluation data are sorted by importance to obtain a sorting result of the preliminary evaluation data.

[0021] In a possible implementation, the initial model is trained according to the characteristic data of the optimal evaluation training set to obtain a risk prediction model, including:

[0022] Perform multiple rounds of sampling with replacement on the optimal evaluation training set to obtain a training data set; wherein the training data set includes multiple training subsets; the number of features in the optimal evaluation training set is equal to the number of features in the training subsets;

[0023] The initial model is trained according to each of the training subsets; and during the training of the initial model, an integration process is performed through a voting method to obtain a risk prediction model.

[0024] In a possible implementation, a ROC curve is drawn according to the prediction result to obtain an optimal threshold, including:

[0025] According to the prediction results, the true positive rate and the false positive rate under different preset thresholds are calculated; wherein the preset threshold represents the probability of default in the prediction results; the true positive rate represents the proportion of enterprises that are correctly predicted to be in default among all enterprises that actually defaulted; and the false positive rate represents the proportion of enterprises that are incorrectly predicted to be in default among all enterprises that actually did not default;

[0026] Draw the ROC curve diagram according to the true positive rate and the false positive rate;

[0027] The optimal threshold is determined according to the ROC curve.

[0028] In a possible implementation, determining the optimal threshold according to the ROC curve graph includes:

[0029] According to the ROC curve graph, calculating the distance from a point on the ROC curve to a point where the true positive rate is zero and the false positive rate is one;

[0030] Determine the threshold corresponding to the point with the smallest distance as the optimal threshold.

[0031] In a possible implementation, determining the loan risk information corresponding to the historical operating data according to the risk prediction model and the optimal threshold includes:

[0032] Predicting the probability of enterprise default based on the risk prediction model and the optimal threshold;

[0033] Based on the enterprise default probability, determine the loan risk information corresponding to the historical operating data.

[0034] In a second aspect, an embodiment of the present application provides an automatic prediction device for loan risk information, comprising:

[0035] A processing module, used to retrieve the historical operating data of the enterprise from the database, and perform data preprocessing on the historical operating data to obtain preliminary evaluation data;

[0036] A screening module, used for performing recursive feature elimination processing on the preliminary evaluation data to obtain optimal evaluation data; wherein the number of features in the optimal evaluation data is less than the number of features in the preliminary evaluation data;

[0037] A generation module, used to generate an optimal evaluation training set and an optimal evaluation test set according to the optimal evaluation data;

[0038] A training module, used to train the initial model according to the characteristic data of the optimal evaluation training set to obtain a risk prediction model;

[0039] A prediction module is used to use the risk prediction model to predict the optimal evaluation test set, generate a prediction result, and draw a ROC curve diagram according to the prediction result to obtain an optimal threshold;

[0040] A determination module is used to determine the loan risk information corresponding to the historical operating data based on the risk prediction model and the optimal threshold.

[0041] In a possible implementation, the screening module is specifically used to:

[0042] According to the preliminary evaluation data, an initial feature model is trained to obtain a feature processing model;

[0043] According to the recursive feature elimination method and the feature processing model, the preliminary evaluation data is processed to obtain a ranking result of the preliminary evaluation data; wherein the ranking result represents the importance ranking of the features in the preliminary evaluation data;

[0044] The optimal evaluation data is obtained according to the preset number of target features and the sorting result.

[0045] In a possible implementation, the preliminary evaluation data is processed according to the recursive feature elimination method and the feature processing model to obtain a ranking result of the preliminary evaluation data, which is specifically used for:

[0046] According to the recursive feature elimination method, the features in the preliminary evaluation data are screened to obtain a screened feature subset;

[0047] Determining weight values ​​of features in the preliminary evaluation data according to the feature processing model and the filtered feature subset; wherein the weight values ​​represent the contribution of the features in the feature processing model;

[0048] According to the weight values ​​of the features in the preliminary evaluation data, the features in the preliminary evaluation data are sorted by importance to obtain a sorting result of the preliminary evaluation data.

[0049] In a possible implementation, the training module is specifically used to:

[0050] Perform multiple rounds of sampling with replacement on the optimal evaluation training set to obtain a training data set; wherein the training data set includes multiple training subsets; the number of features in the optimal evaluation training set is equal to the number of features in the training subsets;

[0051] The initial model is trained according to each of the training subsets; and during the training of the initial model, an integration process is performed through a voting method to obtain a risk prediction model.

[0052] In a possible implementation, the prediction module is specifically used to:

[0053] According to the prediction results, the true positive rate and the false positive rate under different preset thresholds are calculated; wherein the preset threshold represents the probability of default in the prediction results; the true positive rate represents the proportion of enterprises that are correctly predicted to be in default among all enterprises that actually defaulted; and the false positive rate represents the proportion of enterprises that are incorrectly predicted to be in default among all enterprises that actually did not default;

[0054] Draw the ROC curve diagram according to the true positive rate and the false positive rate;

[0055] The optimal threshold is determined according to the ROC curve.

[0056] In a possible implementation, determining the optimal threshold according to the ROC curve graph includes:

[0057] According to the ROC curve graph, calculating the distance from a point on the ROC curve to a point where the true positive rate is zero and the false positive rate is one;

[0058] Determine the threshold corresponding to the point with the smallest distance as the optimal threshold.

[0059] In a possible implementation manner, the determining module is specifically configured to:

[0060] Predicting the probability of enterprise default based on the risk prediction model and the optimal threshold;

[0061] Based on the enterprise default probability, determine the loan risk information corresponding to the historical operating data.

[0062] In a third aspect, an embodiment of the present application provides an electronic device, including: a memory, a processor;

[0063] The memory stores computer-executable instructions;

[0064] The processor executes the computer-executable instructions stored in the memory, so that the processor executes the above first aspect and / or various possible implementations of the first aspect.

[0065] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are executed by a processor, they are used to implement the first aspect above and / or various possible implementations of the first aspect.

[0066] In a fifth aspect, an embodiment of the present application provides a computer program product, including a computer program, which, when executed by a processor, implements the above first aspect and / or various possible implementation methods of the first aspect.

[0067] The present application provides an automatic prediction method, device, electronic device, storage medium and program product for loan risk information, which retrieves the historical business data of the enterprise from the database. These data are a true reflection of the business activities of the enterprise and contain rich information required for loan risk assessment. However, the original data often has problems such as different formats, many missing values, and large noise. Therefore, data preprocessing is required, including steps such as data cleaning, format conversion, and missing value filling to obtain uniform and high-quality preliminary assessment data. Although the preliminary assessment data is comprehensive, it may contain a large number of features (i.e., variables) that do not contribute much to loan risk assessment. In order to improve the prediction performance of the model, a recursive feature elimination technique is used. Through multiple iterative training, those features that have little effect on the prediction results are gradually eliminated, and finally the optimal assessment data with fewer features but stronger prediction ability is obtained. This process not only reduces the complexity of the model, but also improves the prediction efficiency and accuracy. Next, a training set and a test set are generated according to the optimal assessment data for training and verification of the model. By training the initial model, it learns to extract key information from the optimal assessment data and predict loan risks. After training, the risk prediction model is used to predict the test set, and the ROC curve is drawn based on the prediction results. The ROC curve can intuitively show the performance of the model under different thresholds and determine the optimal threshold, that is, the threshold point where the model predicts the risk most closely matches the actual risk. Finally, based on the risk prediction model and the optimal threshold, the loan risk information corresponding to the historical operating data is determined, achieving accurate prediction of loan risk information. BRIEF DESCRIPTION OF THE DRAWINGS

[0068] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0069] Figure 1 A schematic diagram of a method for automatically predicting loan risk information provided in an embodiment of the present application Figure 1 ;

[0070] Figure 2 A schematic diagram of a method for automatically predicting loan risk information provided in an embodiment of the present application Figure 2 ;

[0071] Figure 3 The present invention provides a schematic diagram of a device for automatically predicting loan risk information. Figure 1 ;

[0072] Figure 4 The present invention provides a schematic diagram of a device for automatically predicting loan risk information. Figure 2 ;

[0073] Figure 5 A schematic diagram of the structure of the electronic device provided in this application.

[0074] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION

[0075] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.

[0076] With the continuous development of the economy and the acceleration of the globalization process, the credit risks faced by the banking industry, especially in the field of small and medium-sized enterprise loans, are showing an increasing trend. As an important force in economic development, small and medium-sized enterprises have huge financing needs, but at the same time, due to their small scale, unstable operating conditions, and irregular financial management, banks face higher credit risks when providing loans to them. Therefore, it is crucial for banks to predict corporate loan risk information in advance and accurately judge whether the company will default.

[0077] In the existing technology, banks mainly rely on manual analysis of data and financial statements to predict corporate loan risks. However, this method has many shortcomings. First, the accuracy of manual prediction is often affected by factors such as personal experience and professional knowledge, and it is difficult to guarantee the objectivity and accuracy of the prediction results. Secondly, manual prediction requires a lot of manpower and time costs, especially when processing a large number of loan applications, the efficiency is extremely low. In addition, with the continuous changes in the financial market and the continuous emergence of new technologies, the manual prediction method has been difficult to adapt to the needs of the development of modern banking business.

[0078] Therefore, the automatic prediction method, device, equipment, storage medium and program product of loan risk information provided by the present application can solve the above problems.

[0079] It should be noted that the method and device for automatically predicting loan risk information of the present application can be used in the field of artificial intelligence, and can also be used in any field other than the field of artificial intelligence. The application field of the method and device for automatically predicting loan risk information of the present application is not limited.

[0080] The technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems are described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.

[0081] Figure 1 A schematic diagram of a method for automatically predicting loan risk information provided in an embodiment of the present application Figure 1 ,like Figure 1 As shown, the method includes:

[0082] S101. Retrieve the historical operating data of the enterprise from the database, and perform data preprocessing on the historical operating data to obtain preliminary evaluation data.

[0083] Exemplarily, the historical operating data of enterprises are retrieved from the database, including the operating data of enterprises that have defaulted, enterprises that have not defaulted and have outstanding debts, and enterprises that have not defaulted and have outstanding debts. Operating data include but are not limited to financial statements (balance sheet, income statement, cash flow statement), credit scores, market performance indicators, industry reports, etc., and ensure that the time span of the data is at least five years, and the types of enterprises should cover a wide range of industries, regions and enterprise sizes. The retrieved data is preprocessed to eliminate errors, duplications and outliers in the data, ensure data quality, and provide a reliable basis for subsequent analysis.

[0084] Preprocessing methods mainly include but are not limited to missing value processing, outlier processing, duplicate sample removal processing, and data format conversion and standardization. Missing value processing includes calculating the missing rate of each field. For fields with high missing rates, deletion or filling (such as using the mean, median, mode or interpolation method) is selected according to business logic. Outlier processing includes using the quartile method to identify extreme values ​​in the data. For identified outliers, deletion, replacement (such as using the mean or median of adjacent values) or smoothing is selected according to business logic. Duplicate sample removal processing includes using unique identifiers (such as enterprise ID, timestamp, etc.) to check whether there are duplicate records in the data set, delete duplicate records, and ensure the uniqueness of the data set. Data format conversion and standardization include ensuring that the formats of all fields are correct and consistent (such as date format, numerical format, etc.), and standardizing or normalizing numerical fields of different dimensions for comparison and analysis.

[0085] After preprocessing, preliminary evaluation data is obtained; preliminary evaluation data mainly includes four parts: financial basic data, financial derivative data, financial analysis data and non-financial data. Financial basic data mainly include the total assets, total liabilities, operating income and net profit of the enterprise; financial derivative data mainly include current ratio, quick ratio, debt-to-asset ratio and gross profit margin; financial analysis data is mainly processed by means of mean, variance, coefficient of variation, etc., such as the three-year average total asset growth rate, three-year standard deviation net profit margin, etc.; non-financial data mainly include industrial and commercial information, subject rating, audit opinion, legal proceedings, transaction price and local economic and financial information, etc.

[0086] S102, recursively eliminating features from the preliminary evaluation data to obtain optimal evaluation data; wherein the number of features in the optimal evaluation data is smaller than the number of features in the preliminary evaluation data.

[0087] Exemplarily, recursive feature elimination repeatedly builds a model (such as an SVM or regression model, etc.), selects the best (or worst) features, removes the worst features, and then repeats the process again until the preset number of features is reached. Recursive feature elimination can filter out features that contribute to the model's predictive ability from a large number of features, thereby improving the performance of the model. Use preliminary evaluation data to train a machine learning model; then, evaluate the importance of each feature based on certain attributes of the model (such as weights, coefficients, etc.). Different models may have different evaluation methods; for example, in a tree-based model, the importance score of the feature can be used; in a linear model, the absolute value of the coefficient can be used. According to the importance ranking of the features, eliminate the least important features (or eliminate a certain number of features according to a set threshold); use the remaining features to train the model again, and repeat the above steps until the preset number of features is reached or the performance of the model is no longer significantly improved; finally, a set of features with a small number but the best performance is obtained, that is, the optimal evaluation data, and the number of features in the optimal evaluation data is less than the number of features in the preliminary evaluation data.

[0088] S103. Generate an optimal evaluation training set and an optimal evaluation test set according to the optimal evaluation data.

[0089] Exemplarily, the optimal evaluation data is divided into a training set and a test set by random sampling. For example, 80% of the data is used for training, and the remaining 20% ​​is used for testing; the ratio can be adjusted according to the actual training needs and the size of the data set. The optimal evaluation training set is used to train the machine learning model; the optimal evaluation test set is used to evaluate the performance of the model.

[0090] S104. Train the initial model according to the characteristic data of the optimal evaluation training set to obtain a risk prediction model.

[0091] For example, a training subset is obtained by sampling with replacement in the optimal evaluation training set. When sampling 300 times, 300 training subsets are obtained. For each training subset, a machine learning algorithm (decision tree, logistic regression, support vector machine, etc.) is used for training to obtain a base classifier; since the training data is randomly extracted, even under the same algorithm, each base classifier will be different. Then, the voting method is used to integrate all base classifiers to obtain a risk prediction model.

[0092] S105. Use the risk prediction model to predict the optimal evaluation test set, generate a prediction result, and draw a ROC curve according to the prediction result to obtain the optimal threshold.

[0093] For example, a risk prediction model is used to predict each sample in the optimal evaluation test set. The prediction result is usually a probability value, which indicates the possibility that the sample belongs to the positive class. For example, in a risk prediction model, the model may output a probability value between 0 and 1, indicating the possibility of default risk of the enterprise. According to the probability value in the prediction result and different thresholds, the true positive rate and false positive rate are calculated. According to the true positive rate and false positive rate, the ROC curve is drawn to determine the optimal threshold.

[0094] S106. Determine the loan risk information corresponding to the historical operating data based on the risk prediction model and the optimal threshold.

[0095] For example, the processed and feature-screened historical operating data is input into the trained risk prediction model to obtain a prediction result, wherein the prediction result is a probability value indicating the possibility of corporate loan default. The optimal threshold is determined based on the performance evaluation results of the model and actual needs, and it can convert the predicted probability into a specific risk category. When the predicted probability is higher than or equal to the optimal threshold, the loan risk of the enterprise is considered to be high, and additional risk management measures may be required. On the contrary, if the predicted probability is lower than the optimal threshold, the loan risk of the enterprise is considered to be relatively low, and more favorable loan terms or a faster approval process can be given.

[0096] The automatic prediction method of a loan risk information provided by the embodiment of the present application, by retrieving the historical operating data of the enterprise from the database, these data are the true reflection of the business activities of the enterprise, and contain rich information required for loan risk assessment. However, the original data often has problems such as different formats, many missing values, and large noise, so it is necessary to perform data preprocessing, including steps such as data cleaning, format conversion, and missing value filling, in order to obtain uniform and high-quality preliminary assessment data. Although the preliminary assessment data is comprehensive, it may contain a large number of features (i.e., variables) that do not contribute much to the loan risk assessment. In order to improve the prediction performance of the model, the recursive feature elimination technique is adopted, and those features that have little effect on the prediction results are gradually eliminated through multiple iterative training, and finally the optimal assessment data with fewer features but stronger prediction ability is obtained. This process not only reduces the complexity of the model, but also improves the prediction efficiency and accuracy. Next, a training set and a test set are generated according to the optimal evaluation data for training and verification of the model. By training the initial model, it learns to extract key information from the optimal evaluation data and predict loan risks. After the training is completed, the test set is predicted using the risk prediction model, and the ROC curve is drawn according to the prediction results. The ROC curve can intuitively show the performance of the model under different thresholds and determine the optimal threshold, that is, the threshold point where the model predicts the risk most closely matches the actual risk. Finally, based on the risk prediction model and the optimal threshold, the loan risk information corresponding to the historical operating data is determined. This achieves accurate prediction of loan risk information, effectively solves the problems existing in traditional loan risk assessment, and provides strong support for loan approval and risk management of financial institutions.

[0097] Figure 2 A schematic diagram of a method for automatically predicting loan risk information provided in an embodiment of the present application Figure 2 ,like Figure 3 As shown, in this embodiment Figure 1 Based on the embodiment, a method for automatically predicting loan risk information is described in detail, and the method includes:

[0098] S201. Retrieve the historical operating data of the enterprise from the database, and perform data preprocessing on the historical operating data to obtain preliminary evaluation data.

[0099] Exemplarily, this step may refer to the above-mentioned step S101 and will not be described in detail.

[0100] S202. Based on the preliminary evaluation data, train an initial feature model to obtain a feature processing model; based on the recursive feature elimination method and the feature processing model, process the preliminary evaluation data to obtain a ranking result of the preliminary evaluation data; wherein the ranking result represents the importance ranking of the features in the preliminary evaluation data; based on the preset target feature number and the ranking result, obtain the optimal evaluation data.

[0101] In one example, according to a recursive feature elimination method, features in preliminary evaluation data are screened to obtain a screened feature subset; according to a feature processing model and the screened feature subset, weight values ​​of the features in the preliminary evaluation data are determined; wherein the weight value represents the degree of contribution of the feature in the feature processing model; according to the weight values ​​of the features in the preliminary evaluation data, the features in the preliminary evaluation data are sorted by importance to obtain a sorting result of the preliminary evaluation data.

[0102] Exemplarily, first, an initial model is trained using all the features in the preliminary evaluation data. Suitable machine learning algorithms such as logistic regression, random forest, support vector machine, etc. can be selected. The purpose of training the initial model is to provide a basis for subsequent feature importance evaluation. After the initial model training is completed, the feature importance score provided by the model is used to evaluate the importance of each feature. The feature importance score can be obtained by the built-in method of the model, for example, the feature importance in random forest or the coefficient value in logistic regression. According to the feature importance score, one or more features with the lowest importance are removed. The strategy for feature removal can be to remove one by one or remove in batches. After removal, the weights of the remaining features need to be dynamically adjusted according to the performance of the model to ensure that the performance of the model is not significantly affected. After removing some features, the model is retrained using the remaining features. The purpose of retraining is to optimize the model performance on the updated feature set. Repeat the process of feature removal and model retraining until the preset target number of features is reached or the model performance is no longer significantly improved. The performance can be evaluated by indicators such as AUC (Area Under Curve). When the AUC change is less than a certain threshold after multiple consecutive iterations, the iteration is stopped. Finally, after multiple iterations, an optimal set of feature indicators is obtained, which contains the features that contribute most to the model performance.

[0103] For example, the preliminary evaluation data set contains 100 features, which are used to predict corporate loan risk information. First, input 100 features into the random forest algorithm to train the initial model; calculate the importance score of each feature, assuming that the scores of features F1 to F100 are arranged from high to low; remove the 5 features with the lowest importance (F96 to F100), and adjust the weights of the remaining features; retrain the random forest model on the remaining 95 features; when the number of features is reduced to 20 and the model performance is stable, stop the iteration and obtain the optimal feature indicator set.

[0104] S203: Generate an optimal evaluation training set and an optimal evaluation test set according to the optimal evaluation data.

[0105] Exemplarily, this step may refer to the above-mentioned step S103 and will not be described in detail.

[0106] S204, performing multiple rounds of sampling with replacement on the optimal evaluation training set to obtain a training data set; wherein the training data set includes multiple training subsets; the number of features of the optimal evaluation training set is equal to the number of features in the training subsets; training an initial model based on each training subset; and in the process of training the initial model, performing integration processing through a voting method to obtain a risk prediction model.

[0107] Exemplarily, data is randomly extracted from the optimal evaluation training set, and the data is put back into the optimal evaluation training set after each extraction, allowing the same data to be repeated in multiple training subsets. The number of features in each training subset is the same as the number of features in the optimal evaluation training set (for example, the optimal evaluation training set has m samples, and each training subset also contains m samples, but may contain repeated samples). Randomly extracting data increases the diversity of the model, because different training subsets may contain different sample combinations, thereby training different base classifiers. For each training subset, a machine learning algorithm (decision tree, logistic regression, support vector machine, etc.) is used for training to obtain a base classifier. The same machine learning algorithm can be used to train each training subset, or different machine learning algorithms can be used to train each training subset. The base classifiers trained using the same machine learning algorithm are homogeneous, such as using decision trees for training. The advantage of such training is that the differences between them are relatively small, but the overfitting risk of a single classifier can be reduced through integration, thereby improving the stability of the overall model. The base classifiers trained using different machine learning algorithms are heterogeneous. For example, some use decision trees, some use neural networks, and some use support vector machines for training. The advantage of such training is that the differences between the base classifiers are large, and they can complement each other's shortcomings, thereby improving the prediction performance of the overall model. However, the integration of these base classifiers may be more complicated because their outputs may be difficult to directly compare and integrate. For classification problems, the voting method can be used to integrate the prediction results of the base classifiers. Specifically, the prediction results of each base classifier can be calculated, and the category with the most occurrences can be determined as the final prediction result. This method is simple and intuitive, but it may be affected by an imbalance in the number of base classifiers or large performance differences.

[0108] S205. Calculate the true positive rate and false positive rate under different preset thresholds based on the prediction results; wherein the preset threshold represents the probability of default in the prediction results; the true positive rate represents the proportion of all enterprises that actually defaulted that were correctly predicted to be in default; the false positive rate represents the proportion of all enterprises that actually did not default that were incorrectly predicted to be in default; draw a ROC curve based on the true positive rate and the false positive rate; and determine the optimal threshold based on the ROC curve.

[0109] In one example, according to the ROC curve graph, the distance from a point on the ROC curve to a point where the true positive rate is zero and the false positive rate is one is calculated; and the threshold corresponding to the point with the smallest distance is determined as the optimal threshold.

[0110] Exemplarily, the risk prediction model is used to predict the optimal evaluation test set and predict the probability that the enterprise belongs to the positive class (such as default). Set a series of preset thresholds (such as 0.01, 0.02, 0.99, etc., values ​​between 0-1), compare the predicted probability output by the model with the threshold, and determine whether the sample belongs to the positive class. According to the actual label and the prediction result, calculate the true positive rate and false positive rate under each threshold. The calculation formula of the true positive rate and the false positive rate is as follows:

[0111]

[0112] Among them, TPR represents the true positive rate; TP represents the number of samples that are actually positive and predicted as positive by the model; FN represents the number of samples that are actually positive but predicted as negative by the model; FPR represents the false positive rate; FP represents the number of samples that are actually negative but predicted as positive by the model; TN represents the number of samples that are actually negative and predicted as negative by the model.

[0113] The ROC curve is drawn with the false positive rate as the horizontal axis and the true positive rate as the vertical axis. It intuitively shows the performance of the model under different classification thresholds. On the ROC curve, the threshold corresponding to the point closest to the upper left corner (i.e. FPR = 0, TPR = 1) is considered the optimal warning threshold. The optimal warning threshold can maximize the model's correct identification of the positive class (high true positive rate) while minimizing the probability of mistakenly identifying the negative class as the positive class (low false positive rate).

[0114] S206. Predict the enterprise default probability based on the risk prediction model and the optimal threshold; determine the loan risk information corresponding to the historical operating data based on the enterprise default probability.

[0115] For example, first, the historical operating data of the enterprise is used, and the data is processed and screened, and then input into the risk prediction model to obtain the predicted probability of the enterprise's loan risk. The default probability output by the model is compared with the determined optimal threshold; if the default probability is higher than the threshold, the enterprise has a higher default risk; conversely, if the default probability is lower than the threshold, the enterprise's default risk is relatively low.

[0116] The automatic prediction method of loan risk information provided by the embodiment of the present application is to extract the historical operating data of the enterprise from the database, and go through strict data preprocessing steps, including data cleaning, format unification, etc., to obtain high-quality preliminary evaluation data. Subsequently, a feature processing model is trained using the preliminary evaluation data, and these data are deeply analyzed by the recursive feature elimination method to determine the importance ranking of each feature. Based on the preset number of target features, the optimal evaluation data is screened out. Next, a training data set containing multiple training subsets is constructed by performing multiple rounds of random sampling with replacement on the optimal evaluation training set. The initial models are trained respectively using these training subsets, and integrated processing is performed using the voting method, and finally a risk prediction model with strong prediction ability is obtained. In the model verification stage, the true positive rate and false positive rate under different preset thresholds are calculated according to the prediction results, and the ROC curve is drawn to accurately determine the optimal threshold. Finally, according to the risk prediction model and the optimal threshold, the loan risk information of the enterprise is predicted, and the intelligent and automated loan risk management is realized.

[0117] Figure 3 The present invention provides a schematic diagram of a device for automatically predicting loan risk information. Figure 1 ,like Figure 3 As shown, the automatic prediction device 30 of loan risk information provided by this embodiment includes:

[0118] The processing module 301 is used to retrieve the historical operating data of the enterprise from the database and perform data preprocessing on the historical operating data to obtain preliminary evaluation data;

[0119] A screening module 302 is used to perform recursive feature elimination processing on the preliminary evaluation data to obtain optimal evaluation data; wherein the number of features in the optimal evaluation data is less than the number of features in the preliminary evaluation data;

[0120] A generating module 303 is used to generate an optimal evaluation training set and an optimal evaluation test set according to the optimal evaluation data;

[0121] A training module 304 is used to train the initial model according to the characteristic data of the optimal evaluation training set to obtain a risk prediction model;

[0122] The prediction module 305 is used to predict the optimal evaluation test set using the risk prediction model, generate a prediction result, and draw a ROC curve according to the prediction result to obtain the optimal threshold;

[0123] The determination module 306 is used to determine the loan risk information corresponding to the historical operating data based on the risk prediction model and the optimal threshold.

[0124] This embodiment provides an automatic prediction device for loan risk information, which can execute the method provided in the above method embodiment. Its implementation principle and technical effect are similar, and this embodiment will not be described in detail here.

[0125] Figure 4 The present invention provides a schematic diagram of a device for automatically predicting loan risk information. Figure 2 ,like Figure 4 As shown, the automatic prediction device 40 for loan risk information provided in this embodiment includes:

[0126] Processing module 401 is used to retrieve the historical operating data of the enterprise from the database and perform data preprocessing on the historical operating data to obtain preliminary evaluation data;

[0127] A screening module 402 is used to perform recursive feature elimination processing on the preliminary evaluation data to obtain optimal evaluation data; wherein the number of features in the optimal evaluation data is less than the number of features in the preliminary evaluation data;

[0128] A generating module 403 is used to generate an optimal evaluation training set and an optimal evaluation test set according to the optimal evaluation data;

[0129] A training module 404 is used to train the initial model according to the characteristic data of the optimal evaluation training set to obtain a risk prediction model;

[0130] The prediction module 405 is used to use the risk prediction model to predict the optimal evaluation test set, generate a prediction result, and draw a ROC curve according to the prediction result to obtain the optimal threshold;

[0131] The determination module 406 is used to determine the loan risk information corresponding to the historical operating data according to the risk prediction model and the optimal threshold.

[0132] In one example, the screening module 402 is specifically configured to:

[0133] Based on the preliminary evaluation data, the initial feature model is trained to obtain the feature processing model;

[0134] According to the recursive feature elimination method and the feature processing model, the preliminary evaluation data is processed to obtain a ranking result of the preliminary evaluation data; wherein the ranking result represents the importance ranking of the features in the preliminary evaluation data;

[0135] The optimal evaluation data is obtained based on the preset number of target features and sorting results.

[0136] In one example, the preliminary evaluation data is processed according to the recursive feature elimination method and the feature processing model to obtain a ranking result of the preliminary evaluation data, which is specifically used for:

[0137] According to the recursive feature elimination method, the features in the preliminary evaluation data are screened to obtain a screened feature subset;

[0138] Determine the weight value of the feature in the preliminary evaluation data according to the feature processing model and the filtered feature subset; wherein the weight value represents the contribution degree of the feature in the feature processing model;

[0139] According to the weight values ​​of the features in the preliminary evaluation data, the features in the preliminary evaluation data are sorted by importance to obtain a sorting result of the preliminary evaluation data.

[0140] In one example, the training module 404 is specifically configured to:

[0141] The optimal evaluation training set is sampled multiple times with replacement to obtain a training data set; wherein the training data set contains multiple training subsets; the number of features in the optimal evaluation training set is equal to the number of features in the training subsets;

[0142] According to each training subset, an initial model is trained; and in the process of training the initial model, an integration process is performed through a voting method to obtain a risk prediction model.

[0143] In one example, the prediction module 405 is specifically configured to:

[0144] Based on the prediction results, the true positive rate and false positive rate are calculated under different preset thresholds; wherein the preset threshold represents the probability of default in the prediction results; the true positive rate represents the proportion of enterprises that are correctly predicted to be in default among all enterprises that actually defaulted; the false positive rate represents the proportion of enterprises that are incorrectly predicted to be in default among all enterprises that actually did not default; based on the true positive rate and the false positive rate, the ROC curve is plotted; based on the ROC curve, the optimal threshold is determined.

[0145] In one example, determining the optimal threshold according to the ROC curve graph includes:

[0146] According to the ROC curve, calculate the distance from the point on the ROC curve to the point where the true positive rate is zero and the false positive rate is one; determine the threshold corresponding to the point with the smallest distance as the optimal threshold.

[0147] In one example, the determination module 406 is specifically configured to:

[0148] Based on the risk prediction model and the optimal threshold, the probability of enterprise default is predicted; based on the enterprise default probability, the loan risk information corresponding to the historical operating data is determined.

[0149] This embodiment provides an automatic prediction device for loan risk information, which can execute the method provided in the above method embodiment. Its implementation principle and technical effect are similar, and this embodiment will not be described in detail here.

[0150] Figure 5 This is a schematic diagram of the structure of the electronic device provided in this application. Figure 5 As shown, the electronic device 50 provided in this embodiment includes: at least one processor 501 and a memory 502. Optionally, the device 50 also includes a communication component 503. The processor 501, the memory 502 and the communication component 503 are connected via a bus 504.

[0151] In a specific implementation process, at least one processor 501 executes the computer-executable instructions stored in the memory 502, so that at least one processor 501 executes the above method.

[0152] The specific implementation process of the processor 501 can be found in the above method embodiment, and its implementation principle and technical effect are similar, so this embodiment will not be repeated here.

[0153] In the above embodiments, it should be understood that the processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), etc. A general-purpose processor may be a microprocessor or any conventional processor. The steps of the method disclosed in the invention may be directly implemented as being executed by a hardware processor, or may be executed by a combination of hardware and software modules in the processor.

[0154] The memory may include a high-speed memory (Random Access Memory, RAM), and may also include a non-volatile memory (Non-volatile Memory, NVM), such as at least one disk memory.

[0155] The bus may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, the bus in the drawings of the present application is not limited to only one bus or one type of bus.

[0156] The present application also provides a computer program product, including a computer program, which implements the above method when executed by a processor.

[0157] The present application also provides a computer-readable storage medium, in which computer-executable instructions are stored. When a processor executes the computer-executable instructions, the above method is implemented.

[0158] The above-mentioned 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 memory, flash memory, magnetic disk or optical disk. The readable storage medium can be any available medium that can be accessed by a general or special-purpose computer.

[0159] An exemplary readable storage medium is coupled to a processor so that the processor can read information from the readable storage medium 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 be located in an application specific integrated circuit (Application Specific Integrated Circuits, referred to as: ASIC). Of course, the processor and the readable storage medium can also exist in the device as discrete components.

[0160] The division of units is only a logical function division, and there may be other divisions in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interface, device or unit, which can be electrical, mechanical or other forms.

[0161] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0162] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0163] If the function is implemented in the form of 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 the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods of each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.

[0164] Those skilled in the art can understand that all or part of the steps of implementing the above-mentioned method embodiments can be completed by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, the steps of the above-mentioned method embodiments are executed; and the aforementioned storage medium includes: ROM, RAM, disk or optical disk and other media that can store program codes.

[0165] Finally, it should be noted that those skilled in the art will readily conceive of other embodiments of the present invention after considering the specification and practicing the invention disclosed herein. The present invention is intended to cover any variations, uses or adaptations of the present invention, which follow the general principles of the present invention and include common knowledge or customary technical means in the art not disclosed by the present invention, are not limited to the precise structure described above and shown in the drawings, and may be modified and changed in various ways without departing from the scope thereof. The scope of the present invention is limited only by the appended claims.

Claims

1. A method for automatically predicting loan risk information, characterized in that: include: Retrieving the historical operating data of the enterprise from the database, and performing data preprocessing on the historical operating data to obtain preliminary evaluation data; Performing recursive feature elimination processing on the preliminary evaluation data to obtain optimal evaluation data; wherein the number of features in the optimal evaluation data is less than the number of features in the preliminary evaluation data; Generate an optimal evaluation training set and an optimal evaluation test set according to the optimal evaluation data; Training the initial model according to the characteristic data of the optimal evaluation training set to obtain a risk prediction model; Using the risk prediction model to predict the optimal evaluation test set, generating a prediction result, and drawing a ROC curve diagram according to the prediction result to obtain an optimal threshold; The loan risk information corresponding to the historical operating data is determined based on the risk prediction model and the optimal threshold.

2. The method according to claim 1, characterized in that The preliminary evaluation data is subjected to recursive feature elimination processing to obtain optimal evaluation data, including: According to the preliminary evaluation data, an initial feature model is trained to obtain a feature processing model; According to the recursive feature elimination method and the feature processing model, the preliminary evaluation data is processed to obtain a ranking result of the preliminary evaluation data; wherein the ranking result represents the importance ranking of the features in the preliminary evaluation data; The optimal evaluation data is obtained according to the preset number of target features and the sorting result.

3. The method according to claim 2, characterized in that According to the recursive feature elimination method and the feature processing model, the preliminary evaluation data is processed to obtain a ranking result of the preliminary evaluation data, including: According to the recursive feature elimination method, the features in the preliminary evaluation data are screened to obtain a screened feature subset; Determining weight values ​​of features in the preliminary evaluation data according to the feature processing model and the filtered feature subset; wherein the weight values ​​represent the contribution of the features in the feature processing model; According to the weight values ​​of the features in the preliminary evaluation data, the features in the preliminary evaluation data are sorted by importance to obtain a sorting result of the preliminary evaluation data.

4. The method according to claim 1, characterized in that: The initial model is trained according to the characteristic data of the optimal evaluation training set to obtain a risk prediction model, including: Perform multiple rounds of sampling with replacement on the optimal evaluation training set to obtain a training data set; wherein the training data set includes multiple training subsets; the number of features in the optimal evaluation training set is equal to the number of features in the training subsets; The initial model is trained according to each of the training subsets; and during the training of the initial model, an integration process is performed through a voting method to obtain a risk prediction model.

5. The method according to any one of claims 1 to 4, characterized in that Draw the ROC curve according to the prediction results to get the optimal threshold, including: According to the prediction results, the true positive rate and the false positive rate under different preset thresholds are calculated; wherein the preset threshold represents the probability of default in the prediction results; the true positive rate represents the proportion of enterprises that are correctly predicted to be in default among all enterprises that actually defaulted; and the false positive rate represents the proportion of enterprises that are incorrectly predicted to be in default among all enterprises that actually did not default; Draw the ROC curve diagram according to the true positive rate and the false positive rate; The optimal threshold is determined according to the ROC curve.

6. The method according to claim 5, characterized in that Determining the optimal threshold according to the ROC curve diagram includes: According to the ROC curve graph, calculating the distance from a point on the ROC curve to a point where the true positive rate is zero and the false positive rate is one; Determine the threshold corresponding to the point with the smallest distance as the optimal threshold.

7. The method according to any one of claims 1 to 4, characterized in that Determining loan risk information corresponding to the historical operating data according to the risk prediction model and the optimal threshold includes: Predicting the probability of enterprise default based on the risk prediction model and the optimal threshold; Based on the enterprise default probability, determine the loan risk information corresponding to the historical operating data.

8. An automatic prediction device for loan risk information, characterized in that: include: A processing module, used to retrieve the historical operating data of the enterprise from the database, and perform data preprocessing on the historical operating data to obtain preliminary evaluation data; A screening module, used for performing recursive feature elimination processing on the preliminary evaluation data to obtain optimal evaluation data; wherein the number of features in the optimal evaluation data is less than the number of features in the preliminary evaluation data; A generation module, used to generate an optimal evaluation training set and an optimal evaluation test set according to the optimal evaluation data; A training module, used to train the initial model according to the characteristic data of the optimal evaluation training set to obtain a risk prediction model; A prediction module is used to use the risk prediction model to predict the optimal evaluation test set, generate a prediction result, and draw a ROC curve diagram according to the prediction result to obtain an optimal threshold; A determination module is used to determine the loan risk information corresponding to the historical operating data based on the risk prediction model and the optimal threshold.

9. An electronic device, characterized in that: include: Memory, processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory, so that the processor performs the method according to any one of claims 1 to 7.

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