Enterprise scoring method and device based on random forest algorithm, equipment and medium
By constructing a multi-dimensional data ensemble learning model using the random forest algorithm, and combining financial indicators and non-quantitative factors, the model addresses the subjectivity and difficulty in dynamic adjustment of existing enterprise classification methods. This enables dynamic, objective, and transparent assessment of enterprise credit ratings, thereby improving the scientific nature and efficiency of investment decisions.
Patent Information
- Application Number
- CN202511713275.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-20
- Publication Date
- 2026-02-27
AI Technical Summary
Existing enterprise classification methods rely on expert experience or fixed scoring models, which have problems such as strong subjectivity, difficulty in dynamic adjustment, and neglect of non-quantitative factors, making them difficult to meet the complex and ever-changing market environment.
A corporate rating method based on the random forest algorithm is adopted. By constructing a multi-dimensional data ensemble learning model, combining financial indicators and non-quantitative factors, and utilizing feature importance analysis and decision tree ensemble mechanism of machine learning, an automated and dynamic credit rating assessment is carried out.
It enables dynamic and objective assessment of corporate credit ratings, improves the scientific nature and efficiency of investment decisions, enhances the transparency and interpretability of the model, and solves the problems of subjectivity and difficulty in dynamic adjustment of traditional methods.
Smart Images

Figure CN121581698A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of artificial intelligence, and in particular to a method, apparatus, device and medium for enterprise scoring based on the random forest algorithm. Background Technology
[0002] Equity investment refers to investors acquiring a portion of ownership in a company by purchasing equity shares, with the expectation of returns through the company's growth and profitability. In the equity investment process, scientifically and systematically classifying target companies is a crucial step in assessing their investment potential and risks.
[0003] Currently, enterprise classification methods typically rely on expert experience or fixed scoring models. These models are usually based on a linear summation approach, selecting key indicators that significantly impact enterprise credit rating, such as revenue growth rate, net profit margin, and debt-to-equity ratio, and assigning fixed weights to each indicator to arrive at a total score. While these methods are simple and easy to use, they suffer from problems such as strong subjectivity, difficulty in dynamic adjustment, and neglect of non-quantitative factors. Summary of the Invention
[0004] This application provides an enterprise rating method, apparatus, device, and medium based on the random forest algorithm to achieve automatic, dynamic, and highly reliable classification results.
[0005] In a first aspect, embodiments of this application provide a business rating method based on a random forest algorithm, including:
[0006] Based on multi-dimensional data from multiple reference companies, we determine multiple target features for each reference company. The multi-dimensional data includes financial indicators and non-quantitative factors, and the target features are those related to credit rating.
[0007] Based on multiple target features corresponding to multiple reference enterprises and classification labels of multiple reference enterprises, a random forest model is trained to obtain a trained random forest model, which includes multiple decision trees.
[0008] Based on the multi-dimensional data of the target company, determine multiple target characteristics corresponding to the target company;
[0009] Multiple target features are input into a trained random forest model to obtain the classification results of each decision tree;
[0010] The credit rating of the target company is determined based on the classification results of multiple decision trees.
[0011] In one possible implementation, based on multi-dimensional data from multiple reference companies, several target features corresponding to each reference company are determined, including:
[0012] For any reference company, calculate the correlation between each reference feature and the credit rating based on the multi-dimensional data of the reference company.
[0013] Based on the preset level, multiple target features that meet the preset level are selected from multiple reference features.
[0014] In one possible implementation, the random forest model is trained based on multiple target features corresponding to multiple reference companies and the classification labels of multiple reference companies, including:
[0015] Based on multiple target features corresponding to multiple reference enterprises and classification labels of multiple reference enterprises, the training subset of each decision tree is determined. The training subsets of any two decision trees are not completely the same.
[0016] Multiple decision trees are trained using a training subset of each decision tree.
[0017] In one possible implementation, multiple decision trees are trained based on a training subset of each decision tree, including:
[0018] Based on the training subset of each decision tree, a feature subset is randomly selected when splitting at the node of each decision tree;
[0019] Calculate the information entropy difference before and after splitting each feature, and determine the best feature and the best splitting point from the feature subset based on the information entropy difference;
[0020] Multiple decision trees are trained based on the best features, best split points, and classification labels of each reference enterprise for each decision tree.
[0021] In one possible implementation, the credit rating of the target enterprise is determined based on the classification results of multiple decision trees, including:
[0022] Based on a voting mechanism, the credit rating of the target company is determined according to the classification results of multiple decision trees.
[0023] In one possible implementation, based on multi-dimensional data from multiple reference companies, several target features corresponding to each reference company are determined, including:
[0024] Preprocessing of multi-dimensional data includes at least one of data integration, data deduplication, data vectorization encoding, and data standardization.
[0025] Based on the processed multi-dimensional data, multiple target features corresponding to each reference enterprise are determined.
[0026] Secondly, embodiments of this application provide an enterprise rating device based on a random forest algorithm, the device comprising:
[0027] The feature selection module is used to determine multiple target features for each reference company based on multi-dimensional data from multiple reference companies. The multi-dimensional data includes financial indicators and non-quantitative factors, and the target features are features related to credit rating.
[0028] The model training module is used to train the random forest model based on multiple target features corresponding to multiple reference companies and the classification labels of multiple reference companies, so as to obtain a trained random forest model, which includes multiple decision trees.
[0029] The feature extraction module is used to determine multiple target features corresponding to the target company based on the multi-dimensional data of the target company.
[0030] The classification and prediction module is used to input multiple target features into the trained random forest model to obtain the classification result of each decision tree;
[0031] The rating determination module is used to determine the credit rating of a target company based on the classification results of multiple decision trees.
[0032] Thirdly, embodiments of this application provide a computer device, including: a memory and a processor; the memory stores computer execution instructions; the processor executes the computer execution instructions stored in the memory, causing the processor to perform the first aspect and / or various possible implementations of the first aspect as described above.
[0033] 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 first aspect and / or various possible implementations of the first aspect.
[0034] Fifthly, embodiments of this application provide a computer program product, including a computer program that, when executed by a processor, implements the first aspect and / or various possible implementations of the first aspect.
[0035] This application provides a method, apparatus, device, and medium for enterprise rating based on the random forest algorithm. The method includes: determining multiple target features for each reference enterprise based on multi-dimensional data of multiple reference enterprises, where the multi-dimensional data includes financial indicators and non-quantitative factors, and the target features are features related to credit rating; training a random forest model based on the multiple target features and classification labels of the multiple reference enterprises to obtain a trained random forest model, which includes multiple decision trees; determining multiple target features for the target enterprise based on the multi-dimensional data of the target enterprise; inputting the multiple target features into the trained random forest model to obtain the classification result of each decision tree; and determining the credit rating of the target enterprise based on the classification results of the multiple decision trees. By constructing an ensemble learning model based on the random forest algorithm, combined with multi-dimensional enterprise data such as financial indicators, equity structure, and public opinion information, automated classification is performed to replace the traditional fixed-weight rating model. By leveraging feature importance analysis and decision tree ensemble mechanisms from machine learning, a dynamic and objective assessment of corporate credit ratings can be achieved. At the same time, interpretability techniques are used to ensure model transparency, such as feature importance ranking and decision path visualization, thus addressing the shortcomings of traditional methods, such as strong subjectivity, difficulty in dynamic adjustment, and neglect of non-quantitative factors. Attached Figure Description
[0036] 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.
[0037] Figure 1 A flowchart illustrating the enterprise rating method based on the random forest algorithm provided in this application. Figure 1 ;
[0038] Figure 2 A flowchart illustrating the enterprise rating method based on the random forest algorithm provided in this application. Figure 2 ;
[0039] Figure 3 A flowchart illustrating the enterprise rating method based on the random forest algorithm provided in this application. Figure 3 ;
[0040] Figure 4 A schematic diagram of the enterprise scoring device based on the random forest algorithm provided in this application;
[0041] Figure 5 A schematic diagram of the structure of the computer device provided in this application.
[0042] 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
[0043] 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 as detailed in the appended claims.
[0044] In the description of this application, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this application, "multiple" means two or more, unless otherwise explicitly specified.
[0045] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, storage, use, processing, transmission, provision, disclosure, and application of the relevant data all comply with relevant laws, regulations, and standards, necessary confidentiality measures have been taken, they do not violate public order and good morals, and corresponding operation portals are provided for users to choose to authorize or refuse.
[0046] Furthermore, the technical solution involved in this application, which involves big data analysis of user information (including but not limited to personal biometrics, identity data, consumption data, asset data, electronic terminal operation data, etc.) and the use of artificial intelligence technology for automated decision-making, and makes decisions that have a significant impact on personal rights based on the results of automated decision-making, provides users with corresponding operation entry points for users to choose to agree to or reject the results of automated decision-making; if the user chooses to reject, the process will proceed to the expert decision-making process.
[0047] Equity investment refers to investors acquiring a portion of a company's ownership by purchasing equity (such as stocks or shares), with the expectation of returns through the company's growth and profitability. In the field of equity investment, company classification is a core element of investment decision-making. As a comprehensive investment management platform, an equity investment system needs to scientifically rate target companies throughout the entire process, from project initiation and investment decision-making to signing agreements, to help assess their investment value and risks.
[0048] Currently, enterprise classification relies on fixed scoring models, but their subjectivity, difficulty in dynamic adjustment, and neglect of non-quantitative factors make them unsuitable for complex and ever-changing market environments. For example, existing models cannot accurately assess the potential of emerging industry enterprises due to a lack of historical financial data; simultaneously, soft power factors such as management capabilities and corporate culture are not considered, leading to a disconnect between rating results and actual investment needs. Furthermore, with the growth of data volume and rapid changes in the market environment, the inefficiency of manually adjusting model weights further restricts the timeliness and accuracy of decision-making. Therefore, there is an urgent need for an automated classification method based on machine learning, which integrates multi-dimensional data, such as financial indicators, equity structure, and public opinion information, to achieve dynamic and objective assessment of enterprise credit ratings, thereby improving the scientific nature and efficiency of investment decisions.
[0049] To address the aforementioned technical issues, this application provides a company rating method based on the random forest algorithm, applied to the project evaluation process of an equity investment system. The core scenario is as follows: In an equity investment system, investment decision-makers need to conduct credit ratings on target companies to assist in project approval decisions. The system needs to integrate multi-source heterogeneous data such as company financial data, equity structure data, public opinion, and negative information, and generate rating results through an automated processing flow, including but not limited to data cleaning, feature extraction, model training, and result output. In some embodiments, this scenario involves a distributed data processing architecture, which may include a data acquisition module (acquiring data from internal systems and external APIs), a feature engineering module (standardization and encoding), a model training module (implementation of the random forest algorithm), and a visualization module (feature importance and decision path analysis).
[0050] In one embodiment, such as Figure 1 As shown, enterprise rating methods based on the random forest algorithm include:
[0051] Step 101: Based on the multi-dimensional data of multiple reference companies, determine multiple target features corresponding to each reference company. The multi-dimensional data includes financial indicators and non-quantitative factors, and the target features are features related to credit rating.
[0052] Step 102: Based on the multiple target features corresponding to multiple reference enterprises and the classification labels of multiple reference enterprises, train the random forest model to obtain a trained random forest model, which includes multiple decision trees.
[0053] Step 103: Based on the multi-dimensional data of the target company, determine multiple target characteristics corresponding to the target company;
[0054] Step 104: Input multiple target features into the trained random forest model to obtain the classification results of each decision tree;
[0055] Step 105: Determine the credit rating of the target company based on the classification results of multiple decision trees.
[0056] Multi-dimensional data refers to basic information data about enterprises, encompassing a comprehensive dataset of financial indicators and non-quantitative factors. Financial indicators include debt-to-asset ratio and net profit margin; non-quantitative factors include public opinion information and equity structure. Multi-dimensional data also refers to the raw data collected, such as hundreds of basic information items about target companies gathered from equity investment systems. This data covers multiple dimensions, including: financial statement data (e.g., operating revenue, net profit, debt-to-asset ratio, cash flow); equity structure data (e.g., major shareholder shareholding ratio, equity concentration); research and development level data (e.g., R&D investment, number of patents, proportion of R&D personnel); market performance data (e.g., stock price, market capitalization, trading volume); and public opinion and negative information data (e.g., media reports, negative news, litigation records).
[0057] Multidimensional data is raw, unprocessed information that may contain duplicates, missing data, or noise. It requires data cleaning and processing before it can be used for model training. Therefore, in one embodiment, based on multidimensional data from multiple reference companies, several target features are determined for each reference company, including:
[0058] Preprocessing of multi-dimensional data includes at least one of data integration, data deduplication, data vectorization encoding, and data standardization.
[0059] Based on the processed multi-dimensional data, multiple target features corresponding to each reference enterprise are determined.
[0060] Data integration, considering the limited number of companies in the current equity investment system, requires integrating data from different external market sources to form a complete dataset, based on actual validation results. Data deduplication involves removing duplicate or invalid data to ensure its validity and avoid wasting training resources and generating erroneous samples. Data vectorization encoding uses one-hot encoding to create a vocabulary vector for categorical feature data; the vector's dimension is determined by the required number of features. Data standardization involves assigning multiple features (e.g., financial indicators, market performance, industry position) and a classification label (credit rating, such as A, B, C, D, E) to each company. After collecting and preprocessing multi-dimensional data, the data is divided: 80% is used as the training dataset, and 20% as the validation dataset.
[0061] Target features refer to features extracted from raw multidimensional data that are highly correlated with the target variable (credit rating, such as A, B, C, D, E). These features are a subset selected from the multidimensional data, typically including p numerical or categorical variables (after vectorization encoding). For example, operating revenue, equity concentration, and R&D investment might be chosen as p features because they have a strong statistical correlation with the rating category.
[0062] The p target features are subsets of multi-dimensional data, selected from hundreds of original data points to identify the most predictive features. In the data processing workflow, the multi-dimensional data is first integrated and cleaned, then vectorized and standardized, and finally, correlation analysis is used to extract the p target features. This ensures the quality and effectiveness of the p target features.
[0063] In one embodiment, the correlation between the feature and the target variable is analyzed using either the Pearson correlation coefficient or the Spearman correlation coefficient.
[0064] ;
[0065] in Representing the One characteristic, The target variable representing the rating category. Representation of features With target variable The correlation between features is calculated. After calculating the correlation between each feature and the target variable, all features are sorted from highest to lowest based on the absolute value of their correlation coefficients. The p features with the highest correlation are selected as the target features. The value of p is usually determined based on business needs, model performance, or rules of thumb. For example, cross-validation can be used to test the model accuracy at different p values and select the optimal p.
[0066] Specifically, the determination of the p-value is mainly based on the following three aspects: business-driven, selecting the number of features most relevant to credit rating based on domain knowledge. For example, if financial indicators are considered most important, p may focus on financial features. Model performance-driven, dividing the data into training and validation sets (e.g., 80% training, 20% validation), training the model on the training set using different p-values, evaluating performance (e.g., accuracy, F1 score) on the validation set, and selecting the p-value that optimizes performance. Statistical methods use thresholding, such as selecting only features with correlation coefficients higher than 0.3 or 0.5, or using feature importance ranking, such as based on random forests or LASSO regression.
[0067] Based on this, in one embodiment, such as Figure 2 As shown, based on multi-dimensional data from multiple reference companies, several target features corresponding to each reference company are determined, including:
[0068] Step 201: For any reference enterprise, calculate the correlation between each reference feature in the multi-dimensional data and the credit rating based on the multi-dimensional data of the reference enterprise.
[0069] Step 202: Based on the preset degree, select multiple target features that meet the preset degree from multiple reference features.
[0070] The pre-defined degree is determined based on the value of p. Based on the correlation degree corresponding to the p value, and the correlation degree corresponding to each feature, p target features are selected.
[0071] It's important to note that each company possesses p target features, which may or may not be the same across different companies. By selecting p highly relevant target features from a company's multiple features, the curse of dimensionality can be effectively reduced. Original data contains hundreds of features; using all of them for model training would lead to excessively high feature dimensionality, increasing computational complexity and storage requirements, and potentially causing overfitting. Selecting p target features reduces dimensionality and improves model generalization ability. It also improves model accuracy by eliminating irrelevant or redundant features, reducing noise interference, and allowing the model to focus more on key factors, thus improving prediction accuracy. Furthermore, it reduces wasted training resources; using all features consumes significant computational resources and time, while p target features represent the most effective information, avoiding the influence of erroneous samples and invalid data, and improving training efficiency. Finally, it enhances interpretability; p target features are typically key indicators closely related to business logic, making it easier for analysts to understand the model's decision-making process and supporting investment decisions.
[0072] Random Forest algorithm: A machine learning method based on ensemble learning that achieves classification or regression by constructing multiple decision trees and integrating their predictions. For example, each decision tree is generated through bootstrap sampling and random feature selection, and the final prediction is output through majority voting. Random Forest models not only have high prediction accuracy but also provide analysis of feature importance, helping to understand the impact of each feature on the rating results. This is particularly important in the field of financial investment, as investors need to understand the model's decision-making logic to make more informed decisions in actual investments.
[0073] For the collected multi-dimensional data from multiple reference companies, preprocessing and target feature determination are performed based on the multi-dimensional data of each reference company to construct a training dataset for training the random forest model. The multi-dimensional data, multiple target features, and classification labels of each reference company are used as a sample to train the random forest model.
[0074] Each decision tree generates a training subset through bootstrap sampling, and randomly selects a feature subset when splitting nodes, determining the split point based on maximizing information gain. Finally, the predictions from all decision trees are integrated through a majority voting mechanism to generate the credit rating of the reference company. This credit rating is then combined with the classification labels of the reference company to adjust the random forest model.
[0075] For the target company, multi-dimensional data is collected, and after data preprocessing and target feature extraction, a trained random forest model is used for prediction to obtain the classification results of each decision tree for the target company. Finally, the credit rating of the target company is determined through a voting mechanism, and the credit rating represents the evaluation score.
[0076] The method provided in the above embodiments determines multiple target features for each reference enterprise based on multi-dimensional data from multiple reference enterprises. The multi-dimensional data includes financial indicators and non-quantitative factors, while the target features are those related to credit rating. A random forest model is trained based on these target features and the classification labels of the reference enterprises, resulting in a trained random forest model comprising multiple decision trees. Multiple target features for the target enterprise are determined based on its multi-dimensional data. These target features are then input into the trained random forest model to obtain the classification results for each decision tree. Finally, the credit rating of the target enterprise is determined based on the classification results of the multiple decision trees. By constructing an ensemble learning model based on the random forest algorithm, combined with multi-dimensional enterprise data such as financial indicators, equity structure, and public opinion information, automated classification is performed to replace the traditional fixed-weight scoring model. Utilizing feature importance analysis and decision tree ensemble mechanisms from machine learning, dynamic and objective assessment of enterprise credit ratings is achieved. Simultaneously, interpretability techniques ensure model transparency, such as feature importance ranking and decision path visualization, addressing the shortcomings of traditional methods, such as strong subjectivity, difficulty in dynamic adjustment, and neglect of non-quantitative factors.
[0077] In one embodiment, a random forest model is trained based on multiple target features corresponding to multiple reference enterprises and the classification labels of multiple reference enterprises, including:
[0078] Based on multiple target features corresponding to multiple reference enterprises and classification labels of multiple reference enterprises, the training subset of each decision tree is determined. The training subsets of any two decision trees are not completely the same.
[0079] Multiple decision trees are trained using a training subset of each decision tree.
[0080] Specifically, such as Figure 3 As shown, multiple decision trees are trained based on a training subset of each decision tree, including:
[0081] Step 301: Based on the training subset of each decision tree, randomly select a feature subset when splitting the node of each decision tree;
[0082] Step 302: Calculate the information entropy difference before and after splitting each feature, and determine the best feature and the best splitting point from the feature subset based on the information entropy difference;
[0083] Step 303: Train multiple decision trees based on the best features, best split points, and classification labels of each reference enterprise for each decision tree.
[0084] For the random forest model, the hyperparameters of the model are first set, including: the number of decision trees T in the random forest, the maximum depth d of each tree, the minimum number of samples n_min for each node, and the minimum number of samples required to control the leaf nodes.
[0085] Then perform Bootstrap random sampling:
[0086] ;
[0087] in, It is the original dataset that covers all reference companies. It is the first The training subset of the trees Indicates from The sample index is randomly drawn with replacement. In this way, the enterprise samples in each decision tree are differentiated, and the scoring focus considered after training will also be different.
[0088] Feature selection:
[0089] ;
[0090] It is the first The set of feature indices selected by a tree when splitting at a node. It is the total number of target features. It is the number of randomly selected target features.
[0091] To quickly find the features selected during the split of the decision tree, thus improving decision-making efficiency, the information entropy of a single node needs to be considered.
[0092] ;
[0093] Indicates the first The probability of a category in the current node, for example, the probability of a company having a rating of B in the current node.
[0094] The purpose of using different decision conditions is to assign different samples to different decision nodes to achieve more efficient differentiation. Therefore, it is essential to ensure the consistency of information within a single node, that is, to minimize entropy.
[0095] This introduces the concept of entropy gain, or information entropy difference, which is calculated by subtracting the sum of the entropies of the current layer from the entropy of the previous layer. If feature selection results in a larger entropy gain at the current node, representing a greater amount of information, then the decision condition is more effective.
[0096] The specific node feature selection strategy is as follows:
[0097] Feature subset selection: at each node, from A subset F is randomly selected from the features. The size of the subset is usually 1. .
[0098] Root node: Starting from the root node, select the best features and split points to split the node.
[0099] Feature selection: At each node, select the best feature f and split point t from the feature subset F.
[0100] Splitting point selection: For a selected feature f, calculate the splitting quality (e.g., Gini impurity, information gain, mean square error, etc.) of each possible splitting point l.
[0101] Split Node: Select the feature and split point with the highest split quality, and split the node into two child nodes.
[0102] Recursive construction: Repeat the above steps for each child node until a stopping condition is met (e.g., the number of samples in the node is less than a certain threshold, or the maximum tree depth is reached).
[0103] Building a decision tree:
[0104] ;
[0105] Yes and Then the final decision tree can be constructed. It is the first The prediction function for each tree. Indicates use and The decision tree is trained. Its function is not a traditional mathematical formula, but can be understood as a combination of a series of if-else statements.
[0106] Ensemble prediction: The prediction results of all decision trees are aggregated and the final prediction result is obtained through majority voting (classification task).
[0107] ;
[0108] in, It is the final predicted category of the random forest. It is an indicator function, when the first... The predicted category for each tree is When the value is 1, its value is 1; otherwise, it is 0.
[0109] Model Evaluation
[0110] Accuracy: The classification accuracy of the model, which is the proportion of correctly classified samples out of the total number of samples.
[0111] ;
[0112] in, This refers to the sample size of the test set. Assuming the equity investment system contains 6000 companies, then... It is 6000. It is the prediction category of the model. This is the true category. 20% of the total dataset is used as the validation dataset. The number of cases successfully predicted by the model is summed, and then divided by the total number of cases to obtain the accuracy.
[0113] Hyperparameter tuning:
[0114] Use methods such as grid search or random search to adjust the model's hyperparameters and improve its performance.
[0115] ;
[0116] in, These are the model's hyperparameters, such as the number of decision trees and the depth of the trees. Hyperparameters The cross-validation score is used. Grid search or random search attempts to find the hyperparameter combination that achieves the highest model accuracy within a certain range of hyperparameter combinations.
[0117] Classification Results: Outputs the credit rating results for each company to help investors make investment decisions.
[0118] Feature Importance: Outputs the importance score for each feature, helping investors understand the impact of each feature on the rating results.
[0119] The decision tree splitting mechanism refers to the process by which a decision tree progressively divides a dataset by selecting the best features and the best split points (such as maximizing information gain). For example, a decision tree might use "whether the debt-to-equity ratio is greater than 0.5" as the split point to divide companies into high-risk and low-risk categories.
[0120] Bootstrap random sampling refers to randomly drawing samples with replacement from the original dataset to generate a training subset. For example, the training data for a decision tree may contain duplicate samples.
[0121] A feature subset refers to a subset of features randomly selected by each decision tree when splitting a node. For example, 10 features may be randomly selected from the total features for splitting.
[0122] Maximizing information entropy difference involves calculating the reduction in information entropy before and after feature splitting, and selecting the feature with the greatest information gain as the splitting point. For example, a feature whose information entropy decreases the most after splitting is selected.
[0123] Each decision tree generates a training subset through Bootstrap sampling, and randomly selects a feature subset when splitting nodes, determining the split point based on maximizing the difference in information entropy. Finally, the predictions from all decision trees are integrated through a majority voting mechanism to generate the company's credit rating. Feature importance ranking quantifies the contribution of each feature to the model by the decrease in the Gini coefficient; for example, the debt-to-equity ratio shows the largest decrease in the Gini coefficient, indicating its greatest impact on credit rating. In the output stage, the model generates the final rating result based on the feature importance ranking, the decision tree splitting path, and the company's actual data.
[0124] Independent training data is generated for each decision tree through Bootstrap random sampling, ensuring model diversity. Each decision tree randomly selects a subset from the total features when splitting at a node, and determines the split point based on the principle of maximizing information gain. For example, a decision tree might use "whether the debt-to-equity ratio is greater than 0.5" as the split point to classify companies into high-risk and low-risk categories. This process, through collaborative decision-making across multiple decision trees, reduces the bias of individual trees and improves the overall classification robustness of the model.
[0125] Building upon the above embodiments that address the subjectivity issue, the model's dynamic adaptability is further enhanced through Bootstrap sampling and random feature selection. For example, when the economic environment changes, some decision trees may emphasize different features (such as cash flow or debt-to-equity ratio) due to differences in training data, enabling the model as a whole to respond quickly to external changes. The principle of maximizing information gain ensures that each decision tree prioritizes the features most effective for classification, thereby improving the model's ability to handle complex data. Ultimately, the rating results maintain objectivity while possessing greater flexibility and robustness.
[0126] The enterprise scoring method based on the random forest algorithm provided in the above embodiments also includes:
[0127] A dynamic feature weight adjustment strategy is introduced into the random forest model to automatically adjust the contribution of each feature to credit rating based on real-time market conditions or changes in enterprise data. For example, when the macroeconomy is in a downturn, the model will increase the weight of financial indicators such as "cash flow" and "debt-to-equity ratio" while weakening the impact of volatility indicators such as "short-term revenue growth".
[0128] If a real-time data monitoring module is used, macroeconomic indicators (such as GDP growth rate and industry prosperity index) and enterprise dynamic data (such as stock price fluctuations and public opinion hotspots) can be continuously collected through external APIs or sensors.
[0129] Weighting Algorithm: Based on a Bayesian optimization framework, this algorithm dynamically adjusts the ranking of feature importance by combining real-time data with historical model performance. For example, when an increased correlation is found between "frequency of negative news" and a decline in credit rating, the weight of that feature is automatically increased.
[0130] Model retraining trigger mechanism: When external data changes exceed a preset threshold (such as a 50% drop in industry growth rate), incremental training of some model parameters is triggered, rather than full retraining.
[0131] The method provided in the above embodiments, through dynamic weight adjustment, enables the model to quickly respond to changes in the market environment, avoiding the lag problem of traditional fixed-weight models. During special economic cycles, the model can prioritize key risk indicators (such as liquidity indicators) to reduce misjudgments caused by fluctuations in secondary features. The incremental training strategy reduces the frequency of full retraining, saving computational resources while maintaining the model's sensitivity to new data.
[0132] In one embodiment, the method further includes:
[0133] In the feature processing stage, a multi-granularity feature fusion strategy is introduced to divide enterprise data into three levels: macro (such as overall industry performance), meso (such as the specific sub-sector to which the enterprise belongs), and micro (such as individual enterprise financial indicators). Composite indicators are generated through feature cross-referencing. For example, the "enterprise R&D investment ratio" is cross-referencing with the "industry average R&D investment" to generate the "relative R&D investment intensity" indicator.
[0134] Feature extraction is performed in a hierarchical manner: At the macro level, data such as average industry profit margins and policy support levels are obtained from industry databases. At the meso level, NLP techniques are used to extract specific keywords (such as "new energy batteries" and "AI algorithms") from company reports. At the micro level, core indicators (such as ROE and cash flow) are extracted from company financial statements.
[0135] Feature crossing technology is used to combine features of different granularities into higher-order features. For example, the difference between "corporate net profit margin" and "industry average net profit margin" is calculated to generate an "industry relative profitability" index. SHAP value analysis is used to screen out the cross-features that have the greatest impact on credit rating, avoiding redundant calculations.
[0136] In the methods provided in the above embodiments, multi-granularity feature fusion enables the model to simultaneously capture individual enterprise characteristics and industry trends, reducing the bias of single-granularity data. Through industry relative indicators (such as "relative R&D intensity"), the model can identify promising enterprises in emerging industries, even if their absolute data is insufficient. Feature cross-referencing strategies reduce reliance on manually designed complex features and improve automation.
[0137] In one embodiment, the method further includes:
[0138] By constructing a knowledge graph of enterprise relationships, implicit information such as equity relationships, supply chain relationships, and overlapping executives among enterprises is incorporated into the model training. Graph neural networks (GNNs) are then used to uncover potential risk transmission paths between enterprises. For example, if an enterprise has equity ties with multiple high-risk enterprises, the model will automatically lower its credit rating.
[0139] Specifically, the data sources for knowledge graph construction can include business registration data, supply chain contracts, and executive resumes. Entity Recognition (NER) and Relationship Extraction (RE) techniques are used to extract relationships such as equity, investment, and cooperation among enterprises. GraphSAGE or GAT (Graph Attention Network) algorithms are used to embed enterprise nodes into a low-dimensional vector space and calculate their risk propagation probabilities. The graph embedding results are then fused with traditional financial features as input to a random forest. A random walk algorithm is used to simulate the diffusion path of risk in the enterprise network, identifying high-risk associated enterprises.
[0140] In the methods provided in the above embodiments, through correlation analysis, the model can identify cascading risks caused by supply chain disruptions or equity linkages, avoiding the limitations of traditional models that only focus on individual enterprise data. This enhances the ability to identify hidden risks: for example, even if a company has good financial indicators, but its core supplier has experienced a major default, the model can provide early warnings of potential risks through correlation graphs. The nonlinear modeling capabilities of graph neural networks make the model more robust to noisy data (such as single-dimensional outliers).
[0141] In one embodiment, the method further includes:
[0142] The design incorporates an incremental model update mechanism, allowing the random forest model to update only the affected subset of decision trees upon receiving new data, rather than retraining the entire model. For example, when a new batch of data on technology companies is added, the model only needs to adjust the decision trees related to "R&D investment" and "number of patents," while the trees related to other features remain unchanged.
[0143] Specifically, feature sensitivity analysis identifies which features have the greatest impact on the model output by ranking feature importance (such as "debt-to-equity ratio" and "cash flow"). Decision trees are then grouped according to feature sensitivity; for example, trees related to financial indicators are grouped together, and trees related to public opinion indicators are grouped into another group. When new data only affects a certain group of features, only that group of decision trees is locally updated, and online learning algorithms are used to adjust the split nodes.
[0144] The method provided in the above embodiments reduces the computational overhead of full retraining through incremental updates, especially when the data volume reaches tens of millions, resulting in a significant efficiency improvement. Unaffected decision trees do not require adjustment, avoiding fluctuations in the overall model performance due to local data updates. In real-time data stream scenarios (such as public opinion monitoring), the model can quickly respond to new data, maintaining the timeliness of rating results.
[0145] In one embodiment, the method further includes:
[0146] A multi-model collaborative validation framework is constructed to cross-validate the prediction results of random forest with models such as XGBoost and LightGBM, and a weighted voting mechanism is used to generate the final rating result. For example, when the random forest predicts class A and XGBoost predicts class B, the final rating is determined by feature importance consistency analysis.
[0147] Models with significantly different algorithmic principles (such as tree models and neural networks) are selected to reduce the homogeneity of prediction results. Voting weights are dynamically allocated based on each model's performance on the validation set (such as accuracy and feature interpretation consistency). For example, if XGBoost outperforms Random Forest in a specific industry (such as manufacturing), it is given higher weight in the rating of manufacturing companies. When the prediction results of multiple models differ significantly, a manual review process is triggered, and a final decision is made based on expert experience.
[0148] The methods provided in the above embodiments reduce errors caused by overfitting or feature selection bias in a single model through multi-model collaboration. They also improve robustness in complex scenarios: for example, when data distribution changes abruptly, the multi-model framework can provide more robust rating conclusions through differential prediction results. The combination of weighted voting and manual review mechanisms ensures that the rating results combine algorithmic efficiency with human experience, reducing the controversy inherent in "black box" models.
[0149] 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.
[0150] Based on the same inventive concept, this application also provides an enterprise rating device based on the random forest algorithm. The solution provided by this device is similar to the solution described in the above method. Therefore, the specific limitations of one or more enterprise rating device embodiments based on the random forest algorithm provided below can be found in the limitations of the enterprise rating method based on the random forest algorithm above, and will not be repeated here.
[0151] In one embodiment, such as Figure 4 As shown, the enterprise rating device based on the random forest algorithm includes a feature selection module 401, a model training module 402, a feature extraction module 403, a classification prediction module 404, and a rating determination module 405, wherein:
[0152] The feature selection module 401 is used to determine multiple target features for each reference company based on multi-dimensional data of multiple reference companies. The multi-dimensional data includes financial indicators and non-quantitative factors, and the target features are features related to credit rating.
[0153] The model training module 402 is used to train the random forest model based on multiple target features corresponding to multiple reference enterprises and the classification labels of multiple reference enterprises, so as to obtain a trained random forest model, which includes multiple decision trees.
[0154] The feature extraction module 403 is used to determine multiple target features corresponding to the target enterprise based on the multi-dimensional data of the target enterprise;
[0155] The classification prediction module 404 is used to input multiple target features into the trained random forest model to obtain the classification result of each decision tree;
[0156] The rating determination module 405 is used to determine the credit rating of the target enterprise based on the classification results of multiple decision trees.
[0157] In one possible implementation, the feature selection module 401 is specifically used for:
[0158] For any reference company, calculate the correlation between each reference feature and the credit rating based on the multi-dimensional data of the reference company.
[0159] Based on the preset level, multiple target features that meet the preset level are selected from multiple reference features.
[0160] In one possible implementation, the model training module 402 is specifically used for:
[0161] Based on multiple target features corresponding to multiple reference enterprises and classification labels of multiple reference enterprises, the training subset of each decision tree is determined. The training subsets of any two decision trees are not completely the same.
[0162] Multiple decision trees are trained using a training subset of each decision tree.
[0163] In one possible implementation, the model training module 402 is specifically used for:
[0164] Based on the training subset of each decision tree, a feature subset is randomly selected when splitting at the node of each decision tree;
[0165] Calculate the information entropy difference before and after splitting each feature, and determine the best feature and the best splitting point from the feature subset based on the information entropy difference;
[0166] Multiple decision trees are trained based on the best features, best split points, and classification labels of each reference enterprise for each decision tree.
[0167] In one possible implementation, the level determination module 405 is specifically used for:
[0168] Based on a voting mechanism, the credit rating of the target company is determined according to the classification results of multiple decision trees.
[0169] In one possible implementation, the feature selection module 401 is specifically used for:
[0170] Preprocessing of multi-dimensional data includes at least one of data integration, data deduplication, data vectorization encoding, and data standardization.
[0171] Based on the processed multi-dimensional data, multiple target features corresponding to each reference enterprise are determined.
[0172] The modules in the aforementioned enterprise scoring device based on the random forest algorithm can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can call and execute the corresponding operations of each module.
[0173] Figure 5 A schematic diagram of the structure of the computer device provided in this application. Figure 5 As shown, the computer device 50 provided in this embodiment includes at least one processor 501 and a memory 502. Optionally, the device 50 further includes a communication component 503. The processor 501, memory 502, and communication component 503 are connected via a bus 504.
[0174] In a specific implementation, at least one processor 501 executes computer execution instructions stored in memory 502, causing at least one processor 501 to perform the above-described method.
[0175] The specific implementation process of processor 501 can be found in the above method embodiments, and its implementation principle and technical effect are similar. It will not be repeated here.
[0176] 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.
[0177] The memory may include random access memory (RAM) and may also include non-volatile memory (NVM), such as at least one disk storage device.
[0178] 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.
[0179] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the above-described method.
[0180] This application also provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the above-described method.
[0181] 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.
[0182] 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.
[0183] 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.
[0184] 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.
[0185] 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.
[0186] 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.
[0187] 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.
[0188] 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. The scope of the invention is limited only by the appended claims.
Claims
1. A business rating method based on the random forest algorithm, characterized in that, include: Based on multi-dimensional data from multiple reference companies, multiple target features are determined for each reference company. The multi-dimensional data includes financial indicators and non-quantitative factors, and the target features are features related to credit rating. Based on the multiple target features corresponding to the multiple reference enterprises and the classification labels of the multiple reference enterprises, a random forest model is trained to obtain a trained random forest model, which includes multiple decision trees. Based on the multi-dimensional data of the target company, multiple target features corresponding to the target company are determined; The multiple target features are input into the trained random forest model to obtain the classification result of each decision tree; The credit rating of the target enterprise is determined based on the classification results of the multiple decision trees.
2. The method according to claim 1, characterized in that, The process involves determining multiple target features for each reference company based on multi-dimensional data from multiple reference companies, including: For any reference company, the correlation between each reference feature in the multi-dimensional data and the credit rating is calculated based on the multi-dimensional data of the reference company. Based on a preset level, multiple target features that meet the preset level are selected from multiple reference features.
3. The method according to claim 1, characterized in that, The process of training a random forest model based on multiple target features corresponding to the multiple reference enterprises and the classification labels of the multiple reference enterprises includes: Based on the multiple target features corresponding to the multiple reference enterprises and the classification labels of the multiple reference enterprises, a training subset of each decision tree is determined, wherein the training subsets of any two decision trees are not completely the same. The multiple decision trees are trained based on the training subset of each decision tree.
4. The method according to claim 3, characterized in that, The training of the multiple decision trees based on the training subset of each decision tree includes: Based on the training subset of each decision tree, a feature subset is randomly selected when splitting at the node of each decision tree; Calculate the information entropy difference before and after splitting each feature, and determine the best feature and the best splitting point from the feature subset based on the information entropy difference; The multiple decision trees are trained based on the best features, best split points, and classification labels of each reference enterprise for each decision tree.
5. The method according to claim 1, characterized in that, Determining the credit rating of the target enterprise based on the classification results of the multiple decision trees includes: Based on the voting mechanism and the classification results of the multiple decision trees, the credit rating of the target enterprise is determined.
6. The method according to any one of claims 1-5, characterized in that, The process involves determining multiple target features for each reference company based on multi-dimensional data from multiple reference companies, including: The multi-dimensional data is preprocessed, and the preprocessing includes at least one of data integration, data deduplication, data vectorization encoding, and data standardization. Based on the processed multi-dimensional data, multiple target features corresponding to each reference enterprise are determined.
7. A business rating device based on a random forest algorithm, characterized in that, The device includes: The feature selection module is used to determine multiple target features for each reference company based on multi-dimensional data of multiple reference companies. The multi-dimensional data includes financial indicators and non-quantitative factors, and the target features are features related to credit rating. The model training module is used to train the random forest model based on the multiple target features corresponding to the multiple reference enterprises and the classification labels of the multiple reference enterprises, so as to obtain a trained random forest model, wherein the random forest model includes multiple decision trees; The feature extraction module is used to determine multiple target features corresponding to the target enterprise based on the multi-dimensional data of the target enterprise; The classification prediction module is used to input the multiple target features into the trained random forest model to obtain the classification result of each decision tree; The rating determination module is used to determine the credit rating of the target enterprise based on the classification results of the multiple decision trees.
8. A computer device, characterized in that, include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory to implement the method as described in any one of claims 1 to 6.
9. 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 to 6.
10. A computer program product, characterized in that, Includes a computer program that, when executed by a processor, implements the method as described in any one of claims 1 to 6.