Manufacturing industry enterprise qualification evaluation model construction method
By building an enterprise qualification assessment model, using data preprocessing, PCA risk score extraction, custom weighted loss function and LightGBM model training methods, the problems of lack of dynamic weights, disconnection of feature dimensionality reduction and risk weighting, and insufficient sensitivity optimization of high-risk samples in the existing technology are solved, and a more accurate and stable enterprise qualification assessment is achieved.
Patent Information
- Application Number
- CN202411752619.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-02
- Publication Date
- 2025-03-18
AI Technical Summary
The existing technology has a lack of dynamic weighting, a disconnection between feature dimensionality reduction and risk weighting, and insufficient sensitivity optimization to high-risk samples in the qualification assessment of manufacturing enterprises, resulting in poor performance of the model on high-risk samples.
Through data preprocessing, PCA risk score extraction, custom weighted loss function and LightGBM model training, the enterprise qualification evaluation model is constructed. The specific steps include standardizing the risk characteristics, generating comprehensive risk scores using PCA, customizing weighted loss functions, and training through the LightGBM model.
It improves the prediction effect of the model and significantly enhances the stability of the model in real business scenarios, especially in the identification and prediction of high-risk samples.
Smart Images

Figure CN119647961A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of enterprise qualification evaluation, and in particular to a method for constructing a manufacturing enterprise qualification evaluation model. Background Art
[0002] Disadvantages of the existing technology:
[0003] Lack of dynamic weights: Current weighted loss functions are mostly designed based on fixed historical data distribution, which makes it difficult to adaptively adjust the weights of each risk level, and thus cannot fully cope with data fluctuations and dynamic changes in high-risk samples. This results in poor performance of the model on high-risk samples.
[0004] Disconnection between feature dimensionality reduction and risk weighting: Although PCA dimensionality reduction improves data processing efficiency, the extraction of risk information is still not sophisticated enough, and it fails to organically combine with the weighting mechanism in the loss function. Therefore, the model's understanding and discrimination of multi-level risk information are still insufficient, resulting in limited ability of the model to distinguish different risk samples.
[0005] Lack of sensitivity optimization for high risks: Traditional models mainly optimize overall accuracy and do not pay enough attention to the optimization of high-risk samples. In this case, the model's prediction of high-risk samples is often not accurate enough, making it difficult to achieve excellent performance in identifying high-risk enterprises. Summary of the invention
[0006] In view of the above problems, the present invention is proposed to provide a method for constructing a manufacturing enterprise qualification evaluation model that overcomes the above problems or at least partially solves the above problems.
[0007] According to one aspect of the present invention, a method for constructing a manufacturing enterprise qualification assessment model is provided, the model construction method comprising:
[0008] Data preprocessing to standardize risk characteristics;
[0009] PCA-based risk score extraction was used to generate a comprehensive risk score;
[0010] Customize weighted loss function and set risk classification weights;
[0011] Use LightGBM model training to optimize the loss function, and customize the weighted loss function after optimization;
[0012] The model is trained according to the optimized weighted loss function to obtain an enterprise qualification evaluation model.
[0013] Optionally, the data preprocessing and standardization of risk characteristics specifically include:
[0014] Standardize the risk characteristics to ensure that each characteristic has the same dimension;
[0015] The risk characteristics include: "Number of ICP registrations for corporate websites", "Number of defendants", "Number of corporate trademarks", and "Number of people covered by the company's unemployment insurance".
[0016] Optionally, the data preprocessing, before standardizing the risk features, further includes:
[0017] Predict the target variable and define the prediction label, 1 for "yes" and 0 for "no";
[0018] Label 1 is "yes": the enterprise has a loan balance and is not overdue at the observation time, but the number of overdue days in the next 90 days is greater than or equal to 30 days; Label 0 is "no": the enterprise has a loan balance and is not overdue at the observation time, and there will be no overdue or less than 30 days in the next 90 days;
[0019] Data cleaning and processing;
[0020] Divide the data set into training set, test set and OOT set;
[0021] Use the GAN algorithm to enhance the data of the training set;
[0022] XGBoost and LightGBM algorithms are used to sort the feature importance and finally select the modeling features.
[0023] Optionally, the XGBoost and LightGBM algorithms are used to rank the feature importance, and the final selected modeling features specifically include:
[0024] XGBoost algorithm, specifically includes:
[0025] Using the Boosting framework, a series of decision trees are gradually constructed and optimized so that each tree continuously reduces the error based on the previous tree.
[0026] Feature selection: XGBoost uses a greedy algorithm to select features that maximize the objective function gain at each tree split; because it takes into account the error term and regularization term, XGBoost's feature selection process is robust and accurate;
[0027] The LightGBM algorithm specifically includes:
[0028] Distributed algorithm and efficient processing: LightGBM uses an efficient histogram-based algorithm that can quickly build and update tree models;
[0029] Feature selection: LightGBM selects features based on the gain of the split point when the tree is split, and introduces a Leaf-wise tree growth strategy;
[0030] Get multiple feature indicator explanations;
[0031] The four indicators of “number of contract disputes”, “number of court announcements”, “number of defendants” and “number of cases of defaulting on trust” are selected as the main components of the PCA risk score to generate weights.
[0032] Optionally, the PCA-based risk score extraction to generate a comprehensive risk score specifically includes:
[0033] Through principal component analysis (PCA), multi-dimensional risk features are reduced to generate a single comprehensive risk score.
[0034] The process of PCA is:
[0035] Assume the risk characteristic matrix is Where n is the number of samples and m is the number of features;
[0036] X r Perform centering and covariance matrix calculations;
[0037] Solve the eigenvalues and eigenvectors of the covariance matrix and select the principal component with the largest explained variance;
[0038] The generated principal component scores are used as risk scores and input to the model.
[0039] Optionally, the LightGBM algorithm specifically includes:
[0040] LightGBM is an improved model based on the gradient boosting framework
[10] . The core idea is to gradually reduce the model loss by building a series of decision trees.
[0041] Assume there are N samples and the input features are The goal is to minimize the given loss function
[0042] The prediction value generated by the LightGBM model in the tth round of iteration is recorded as The initial value is
[0043] Split optimization based on loss function includes: The core of LightGBM is to minimize the given loss function;
[0044] Assume that the current model predicts Add a new decision tree f t (x) to fit the current residual, so that:
[0045]
[0046] Among them, f t (x) is the decision tree of round t;
[0047] In LightGBM, the new decision tree f t (x) is obtained by minimizing the negative gradient of the loss function. The optimization problem is written as:
[0048]
[0049] Taylor expansion and the gradient and second-order derivative of the loss function include:
[0050] LightGBM approximates the loss function through Taylor second-order expansion to minimize the loss during the splitting process;
[0051] For each sample i, the loss function The predicted value at the tth iteration The Taylor expansion around is expressed as:
[0052] Where: Gradient:
[0053]
[0054] Second order derivative (Hessian):
[0055]
[0056] According to the second-order expansion, minimizing the loss function of the current round is approximately the problem of optimizing the weighted square error:
[0057]
[0058] Calculation of tree node splitting gain: When LightGBM splits each node of the tree, it selects the feature and splitting point with the largest gain; assuming that a node contains a sample set S, S is divided into left and right subsets S left and S right When , the split gain Gain is calculated as:
[0059]
[0060] Among them, λ is the regularization parameter; the larger the gain, the more effective the split is in reducing the loss;
[0061] The calculation of leaf node values includes: In the generation process of each tree of LightGBM, the calculation of leaf node values is based on the minimization of the loss function. Given that the sample set contained in leaf node j is Sj , node value w j It is obtained by minimizing the following formula:
[0062]
[0063] Represents updating the output of the model at the leaf node to reduce the value of the loss function.
[0064] Optionally, the PCA-based risk control method includes:
[0065] Given Represents p risk features of n samples and performs standardization;
[0066] For each feature X j Normalized to:
[0067]
[0068] Among them, μ j is the mean of the jth feature, σ j is the standard deviation of the jth feature. The standardized matrix Z ensures that the mean of each feature is 0 and the variance is 1;
[0069] Calculate the covariance matrix ∑ of the standardized data matrix Z:
[0070]
[0071] The covariance matrix ∑ describes the correlation between various risk characteristics;
[0072] Solving for eigenvalues and eigenvectors, including:
[0073] PCA obtains the principal components by solving the eigenvalues and eigenvectors of the covariance matrix ∑;
[0074] Let λ1,λ2,...,λ p is the eigenvalue of ∑, satisfying: ∑v i =λ i v i , i = 1, 2, ..., p;
[0075] where v i is the corresponding eigenvector, representing the direction of the i-th principal component, λ i is the variance explained by this principal component;
[0076] The selection of principal components is done by selecting the first k principal components whose cumulative explained variance reaches more than 95%:
[0077]
[0078] The first k principal components can explain most of the variance information of the data;
[0079] The principal component score is obtained by projecting the original data Z onto the eigenvector, risk score = ZW;
[0080] Where W is a matrix consisting of the first k eigenvectors.
[0081] Optionally, the custom weighted loss function and setting of risk grading weights specifically include:
[0082] Definition of adaptive weighted loss function In order to differentiate samples of different risk levels, the risk score r is introduced i As a basis for weight;
[0083] The samples are weighted according to their risk score quartiles (q1, q2, q3):
[0084]
[0085] After introducing weights, the adaptive weighted mean square error is defined as:
[0086]
[0087] Among them, w i is the weight of the i-th sample, which is dynamically adjusted based on the risk score of the sample;
[0088] The gradient and second-order derivative of the adaptive weighted loss function include: In the LightGBM model, the goal is to minimize the weighted loss function. Under the adaptive weighting strategy, a dynamically adjusted weight w is assigned to each sample. i , sample-based risk scoring;
[0089] The loss function after introducing weights is:
[0090]
[0091] The gradient and Hessian of LightGBM plus the influence of weights:
[0092] gradient:
[0093]
[0094] Second order derivative:
[0095]
[0096] The weight w of high-risk samples i The larger it is, the larger its gradient and second-order derivative are;
[0097] During the optimization process, the model pays more attention to high-risk samples, is more sensitive to errors, and enhances its predictive ability for high-risk samples.
[0098] The present invention provides a method for constructing a manufacturing enterprise qualification assessment model, which includes: data preprocessing, standardizing risk features; extracting risk scores based on PCA to generate comprehensive risk scores; customizing weighted loss functions to set risk classification weights; using LightGBM model training to optimize loss functions, customizing optimized weighted loss functions; training models according to the optimized weighted loss functions to obtain enterprise qualification assessment models. The prediction effect of the model is improved, and the stability of the model in real business scenarios is significantly enhanced.
[0099] The above description is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention, it can be implemented according to the contents of the specification. In order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0100] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative work.
[0101] Figure 1 A flowchart of a method for constructing a manufacturing enterprise qualification assessment model provided by an embodiment of the present invention;
[0102] Figure 2 A schematic diagram of dividing the observation period and the performance period provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0103] The exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided to enable a more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.
[0104] The terms "comprises" and "having" and any variations thereof in the description embodiments, claims and drawings of the present invention are intended to cover non-exclusive inclusions, for example, including a series of steps or units.
[0105] The technical solution of the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments.
[0106] like Figure 1 As shown, a method for constructing a manufacturing enterprise qualification assessment model includes:
[0107] (1) Data preprocessing:
[0108] The risk features (“number of ICP registrations for corporate websites”, “number of defendants”, “number of corporate trademarks”, “number of people covered by company unemployment insurance”) are standardized to ensure that each feature has the same dimension so that PCA can extract effective risk information.
[0109] (2) PCA risk score extraction:
[0110] The PCA (Principal Component Analysis) method is used to reduce the dimension of the standardized risk characteristics to obtain a comprehensive risk score. This score is used as a representative variable of the enterprise qualification risk in the weighting strategy of the custom loss function.
[0111] (3) Custom weighted loss function:
[0112] Based on the quartiles of risk scores, the samples were divided into four risk levels (highest risk, medium-high risk, medium risk, and low risk), and different weights were assigned to each category.
[0113] The custom loss function weights samples according to their risk level during training, making the model's prediction error on high-risk samples more impactful and better predicting samples with higher risks.
[0114] (4) LightGBM model training:
[0115] The LightGBM framework is used for training, basic parameters ("learning_rate", "num_leaves", "objective") are set, and a custom weighted loss function is introduced for optimization. The model is validated by specifying a validation set so that the effect can be evaluated in time during the training process.
[0116] (5) Model evaluation:
[0117] After training, the AUC (Area Under Curve) and KS indicators are used to evaluate the model performance.
[0118] By comparing the performance of different models on the OOT set, this research task focuses on two key evaluation indicators: AUC and KS, see Table 2:
[0119] Model AUC (augmented data) KS (enhanced data) LightGBM 0.73 0.45 LightGBM (PCA & adaptive weighting) 0.77 0.46
[0120] Table 2
[0121] The experimental results show that the LightGBM model, which combines PCA risk score weight generation and adaptive weighted loss function, achieves the best performance on both the test set and the OOT dataset, especially in terms of AUC and KS values. Compared with the traditional LightGBM model, this algorithm can more accurately assess the credit risk of different corporate qualifications.
[0122] Predicting the target variable
[0123] Prediction label definition (1 for yes and 0 for no): At the observation time, the enterprise has a loan balance and is not overdue, and the number of overdue days of the enterprise in the next 90 days is greater than or equal to 30. That is, label 1 (yes): the enterprise has a loan balance and is not overdue at the observation time, but the number of overdue days in the next 90 days is greater than or equal to 30 days; label 0 (no): the enterprise has a loan balance and is not overdue at the observation time, and there will be no overdue or less than 30 days in the next 90 days.
[0124] Data cleaning and processing, including:
[0125] (1) Remove features with null value ratio greater than 70%.
[0126] (2) Remove features with correlation greater than 0.9.
[0127] Data set division and data enhancement, including: division into training set, test set and OOT set;
[0128] (1) Pre-extraction training and test sets: There are 8197 records in total, and the good-bad ratio is 0.966:0.034.
[0129] (2) OOT set before extraction (oot_info): There are 4715 records in total, and the good-bad ratio is 0.978:0.022.
[0130] (3) Training set after extraction: 399 records, with a good-bad ratio of 211:188.
[0131] (4) Test set after extraction: 97 records, good-bad ratio is 52:45.
[0132] (5) After extraction, the training set and test set contain 496 records, and the number of real samples that meet the requirements of the project does not exceed 500.
[0133] (6) OOT set after extraction: No adjustment is made and it remains the same as before extraction.
[0134] The data time points of the training set and test set are: 202202-202310, and the data time points of the OOT set are: 202311-202406, as shown below: Figure 2shown.
[0135] In enterprise qualification modeling, the good-to-bad ratio of training data (i.e., the ratio of positive and negative samples) is extremely unbalanced, which will have many adverse effects on model performance.
[0136] Data enhancement, including: using GAN algorithm to enhance the training set. After enhancement, the training set has 4699 records, and the good-bad ratio is 2811:1888 (0.6:0.4), which meets the requirements of the project.
[0137] The OOT set (Out-of-Time sample set) is usually used to evaluate the true performance of the model without performing data augmentation and retaining its true distribution.
[0138] Feature selection, including: using XGBoost and LightGBM algorithms to sort feature importance and finally select modeling features.
[0139] Feature importance analysis, including:
[0140] XGBoost and LightGBM algorithms, including:
[0141] XGBoost (Extreme Gradient Boosting) and LightGBM (Light Gradient Boosting Machine) are both ensemble learning algorithms based on gradient boosting decision trees. They improve the stability and accuracy of the model by combining multiple decision trees, and have significant advantages in ranking feature importance.
[0142] (1) XGBoost
[0143] Boosting framework: XGBoost uses the Boosting framework to gradually build and optimize a series of decision trees so that each tree continuously reduces the error based on the previous tree, thereby improving the accuracy of the model.
[0144] Feature selection: XGBoost uses a greedy algorithm to select features that maximize the objective function gain at each tree split. Since it takes into account the error term and regularization term, the feature selection process of XGBoost is robust and accurate.
[0145] (2) LightGBM
[0146] Distributed algorithm and efficient processing: LightGBM uses an efficient histogram-based algorithm that can quickly build and update tree models, and its processing speed for large-scale data is significantly better than other GBDT algorithms.
[0147] Feature selection: LightGBM selects features based on the gain of the split point when the tree is split, and introduces a Leaf-wise tree growth strategy to further improve the effect of the model.
[0148] The feature importance of the XGBoost algorithm includes:
[0149] Gradient boosting and error optimization: XGBoost is an algorithm based on gradient boosting, which gradually builds decision trees. Each tree is trained based on the residual error, so that it is continuously optimized in multiple rounds of training. Its feature importance ranking is based on the information gain brought by the splitting of tree nodes, and the influence of features is measured by three importance metrics: Gain, Cover, and Frequency.
[0150] Comprehensive error and regularization: XGBoost takes into account both error reduction and regularization terms when selecting split nodes, making the feature selection process more robust, avoiding overfitting, and the feature importance ranking has high reliability.
[0151] The feature importance of the LightGBM algorithm includes:
[0152] Information gain-based split node selection: In LightGBM, the feature importance metric is calculated by the gain contribution at each node split. This gain value combines the role of the feature in all trees, allowing the importance ranking to measure the importance of each feature more globally.
[0153] Efficiency in processing big data: LightGBM significantly improves computational efficiency due to its histogram difference algorithm design, making it suitable for large-scale data sets while maintaining a high feature importance ranking accuracy.
[0154] XGBoost and LightGBM each have their own advantages in ranking feature importance, and the combination of the two improves the comprehensiveness and reliability of feature selection. The specific method is to rank the feature importance of the two algorithms separately, select the top 15 features of each, and take the union as the final modeling feature.
[0155] The advantages of the combination include:
[0156] Complementarity: Different algorithms may be sensitive to different features, and combining them reduces the possibility of missing key features.
[0157] Enhanced robustness: The combination of the two algorithms reduces the potential bias of a single algorithm, making feature selection more robust and reliable.
[0158] For explanation of characteristic indicators, see Table 1. The names and descriptions of characteristic indicators are as follows:
[0159] Table 1
[0160]
[0161]
[0162]
[0163]
[0164]
[0165] Feature selection for PCA risk score
[0166] The four indicators of "number of contract disputes", "number of court announcements", "number of defendants" and "number of cases of dishonesty being enforced" are selected as the main components of the PCA risk score for generating weights, mainly for the following business considerations:
[0167] Directly reflect the characteristics of legal risks: These four indicators cover the company's status in legal disputes and dishonesty. For example, "Number of contract disputes" directly indicates whether the company frequently has contract disputes with customers or suppliers; "Number of dishonest cases" indicates the company's credit in fulfilling court decisions. This type of risk directly affects whether the company may encounter an operating or qualification crisis in the future, and is a critical high-risk factor.
[0168] Risk signals of business behavior and qualifications: The number of "court announcements" and "number of defendants" represent challenges that companies may face in complying with laws, which will not only affect their reputation, but may also bring operational restrictions (such as bank credit restrictions, increased difficulty in financing, etc.). These indicators provide signals of whether a company has a good business reputation.
[0169] Adaptability of high-risk samples: The logic of adaptive weighting is to give higher weights to high-risk samples and improve the performance of the model on high-risk samples. Therefore, extracting these major risk factors related to law and credit through PCA to construct risk scores will help the model identify high-risk enterprises more accurately.
[0170] The present invention first uses GAN to generate synthetic data and enhances the original data set to improve the sample coverage and robustness of the model. Then the enhanced data set is input into LightGBM, LightGBM model combined with PCA risk score weight generation and adaptive weighted loss function for training, and finally the enterprise qualification risk assessment model with the best performance is obtained.
[0171] Model selection
[0172] In the modeling process of the invention, the performance of the model on the test data set and OOT (Out-Of-Time) data set was evaluated based on the original data and the enhanced data. By comparison, the LightGBM model using the PCA risk score weight generation and adaptive weighted loss function performed significantly better than other models on the test set and OOT set.
[0173] Test results of the enhanced data generation model based on the LightGBM algorithm:
[0174] (1) Test set, KS: 0.411, AUC: 0.705.
[0175] (2) OOT set, KS: 0.466, AUC: 0.733.
[0176] Test results of the enhanced data generation model based on the LightGBM algorithm combined with PCA risk score weight generation and adaptive weighted loss function:
[0177] (1) Test set, KS: 0.488, AUC: 0.772.
[0178] (2) OOT set, KS: 0.448, AUC: 0.770.
[0179] This paper proposes an innovative method based on the combination of PCA and adaptive weighting strategy, which significantly improves the model performance:
[0180] PCA dimensionality reduction and multi-level risk information extraction: Starting from the multi-level risk information of the enterprise such as contract disputes, court announcements, and dishonesty, the present invention uses PCA to extract the main risk factors and uses the risk score as the basis for adaptive weighting. This simplifies the feature dimensions while retaining the inherent correlation between risk features, significantly improving the efficiency of data processing and information integration.
[0181] Dynamic adaptive weighted loss function: To improve the model's sensitivity to high-risk samples, this study introduces a dynamic weighting mechanism based on risk scoring into the loss function. The weight of each sample is dynamically adjusted according to its risk score. Samples with higher weights receive more attention during model optimization, which significantly improves the model's ability to identify high-risk samples. This dynamic weight allocation goes beyond the traditional static weighting method and improves the model's ability to distinguish samples of different risk levels.
[0182] Enhance the generalization and accuracy of the model: By combining PCA with the adaptive weighting strategy, the model shows better generalization and accuracy on the test set. The adaptive weighted loss function makes the model more accurate in predicting high-risk samples, while PCA dimensionality reduction reduces the interference of invalid features, which improves the overall performance of the model. This method not only improves the prediction effect of the model, but also significantly enhances the stability of the model in real business scenarios.
[0183] Data preprocessing, including:
[0184] (1) Missing value processing: fill in or remove missing data to ensure that the input data is complete.
[0185] (2) Removal of highly correlated features: Before generating the PCA risk score, highly correlated features are removed through correlation analysis to improve the simplicity of the data.
[0186] (3) Small sample data enhancement: Perform data enhancement on training samples based on the GAN algorithm.
[0187] The weight generation of PCA risk score includes:
[0188] Through principal component analysis (PCA), the multi-dimensional risk characteristics are reduced to generate a single comprehensive risk score.
[0189] The PCA process includes:
[0190] (1) Assume that the risk characteristic matrix is Where n is the number of samples and m is the number of features.
[0191] (2) For X r Perform centering and covariance matrix calculations.
[0192] (3) Solve the eigenvalues and eigenvectors of the covariance matrix and select the principal component that explains the largest variance.
[0193] (4) The generated principal component scores are used as risk scores and input to the model.
[0194] Adaptive weighted loss function design, including:
[0195] The model needs to pay more attention to high-risk samples. To this end, an adaptive weighted loss function is defined to give a higher weight to the error on high-risk samples. This function ensures that the model's recognition ability on high-risk samples is significantly enhanced.
[0196] LightGBM is an improved model based on the gradient boosting framework
[10] . Its core idea is to gradually reduce the model loss by building a series of decision trees. Assume there are N samples and the input features are The goal is to minimize the given loss function The prediction value generated by the LightGBM model in the tth round of iteration is recorded as The initial value is
[0197] Split optimization based on loss function, including:
[0198] The core of LightGBM is to minimize a given loss function. Assume that the prediction value of the current model is Add a new decision tree f on this basis t (x) to fit the current residual, so that:
[0199]
[0200] where f t (x) is the decision tree of round t.
[0201] In LightGBM, this new decision tree f t (x) is obtained by minimizing the negative gradient of the loss function. The optimization problem is written as:
[0202]
[0203] Taylor expansion and gradient and second-order derivative of loss function
[0204] LightGBM approximates the loss function through Taylor second-order expansion to minimize the loss during the splitting process.
[0205] For each sample i, the loss function The predicted value at the tth iteration The Taylor expansion around can be expressed as:
[0206]
[0207] in:
[0208] Gradient:
[0209]
[0210] Second order derivative (Hessian):
[0211]
[0212] According to the second-order expansion, minimizing the loss function of the current round can be approximated as optimizing the following weighted square error problem:
[0213]
[0214] The calculation of tree node splitting gain includes:
[0215] LightGBM selects the feature with the largest gain and the split point when splitting each node in the tree. Specifically, assuming that a node contains a sample set S, we divide S into left and right subsets S left and S right When , the split gain Gain is calculated as:
[0216]
[0217] Where λ is the regularization parameter. The larger the gain, the more effective the split is in reducing the loss.
[0218] Leaf node value calculation, including:
[0219] In the generation process of each tree of LightGBM, the calculation of leaf node value is based on the minimization of loss function. Given that the sample set contained in leaf node j is S j , node value w j It is obtained by minimizing the following formula:
[0220]
[0221] This value represents how to update the output of the model at the leaf node to further reduce the value of the loss function.
[0222] The weight control principle of PCA risk score includes:
[0223] The multidimensional risk characteristics of an enterprise are analyzed by principal component analysis to extract the main risk scores, which can simplify the model input while maintaining the integrity of the information. PCA (Principal Component Analysis) aims to reduce the original high-dimensional data into several single principal components through linear transformation
[11] , while retaining the variance information of the data as much as possible. The specific steps are as follows:
[0224] Data standardization, including:
[0225] Given Represents p risk features of n samples, which are first standardized. j Normalized to:
[0226]
[0227] Among them, μ j is the mean of the jth feature, σj is the standard deviation of the jth feature. The standardized matrix Z ensures that the mean of each feature is 0 and the variance is 1.
[0228] Covariance matrix, including:
[0229] Calculate the covariance matrix ∑ of the standardized data matrix Z:
[0230]
[0231] The covariance matrix ∑ describes the correlation between various risk characteristics.
[0232] Solve for eigenvalues and eigenvectors. PCA obtains the principal components by solving the eigenvalues and eigenvectors of the covariance matrix ∑. Let λ1, λ2, ..., λ p is the eigenvalue of ∑, satisfying:
[0233] ∑v i =λ i v i , i = 1, 2, ..., p
[0234] where ν i is the corresponding eigenvector, representing the direction of the i-th principal component, λ i is the variance explained by this principal component.
[0235] Selection of principal components
[0236] By selecting the first k principal components (with the largest eigenvalue) with a cumulative explained variance of more than 95%, that is:
[0237]
[0238] This means that the first k principal components can explain most of the variance information of the data.
[0239] The principal component score is obtained by projecting the original data Z onto these eigenvectors, that is, risk score = ZW.
[0240] Where W is a matrix consisting of the first k eigenvectors. PCA effectively reduces the feature dimension, simplifies the model input while retaining the main information, and reduces the risk of overfitting.
[0241] Proof of the optimization effect of the adaptive weighted loss function, including:
[0242] The purpose of the adaptive weighted loss function is to give higher weights to high-risk samples to enhance the model's sensitivity to high-risk samples. The loss function has a greater penalty on high-risk samples, prompting the model to pay more attention to the samples. The higher the weight, the more the model tends to reduce the error of high-risk samples during the optimization process.
[0243] Adaptive Weighted Mean Square Error (WMSE)
[0244] Definition of adaptive weighted loss function, in order to differentiate samples of different risk levels, introduce risk score r i as a basis for weighting.
[0245] The samples are weighted according to their risk score quartiles (q1, q2, q3):
[0246]
[0247] After introducing weights, the adaptive weighted mean square error is defined as:
[0248]
[0249] Among them, w i is the weight of the i-th sample, which is dynamically adjusted based on the risk score of the sample.
[0250] Gradient and second-order derivative of the adaptive weighted loss function:
[0251] In the LightGBM model, the goal is to minimize the weighted loss function. Under the adaptive weighting strategy, a dynamically adjusted weight w is assigned to each sample. i , based on the risk score of the sample. The loss function after introducing the weight is:
[0252]
[0253] The gradient and Hessian of LightGBM need to be affected by weights:
[0254] Gradient:
[0255]
[0256] Second order derivative (Hessian):
[0257]
[0258] From the above formula, we can see that the weight w of high-risk samples is i The larger it is, the larger its gradient and second-order derivative are. During the optimization process, the model will pay more attention to high-risk samples, be more sensitive to errors, and enhance the predictive ability of high-risk samples.
[0259] Compare the effects of single LightGBM and combined PCA and adaptive weighting strategy, including:
[0260] Compared with directly using LightGBM, the model combining PCA and adaptive weighted loss function obtains the main components of the risk score through PCA, reduces the redundant information of the features, and makes the weight w i More focused on risk-related information. The optimization process of LightGBM combined with adaptive weighting is as follows:
[0261] Feature dimensionality reduction: Reduce the dimension of the risk feature vector extracted by PCA to ensure the weight w i Reflect risk information based on risk principal components.
[0262] Weighted loss optimization: The gradient and Hessian of the loss function contain the weight w i , giving priority to high-weight samples (high-risk samples) when splitting and updating leaf nodes.
[0263] Improve generalization ability: Through dynamic adjustment of adaptive weights, the model's prediction effect on high-risk samples in the test set is improved, and it has better generalization ability.
[0264] In summary, by combining PCA's risk score and adaptive weighting strategy, the LightGBM model has been improved in splitting gain, leaf node update and model generalization ability. The model has a stronger ability to distinguish samples at different risk levels. The adaptive weighted loss function dynamically adjusts the weights to enable the model to optimize samples with different risks in a targeted manner, thereby improving the overall prediction performance and generalization ability.
[0265] Beneficial effects: The present invention belongs to integrated innovation, combining PCA dimensionality reduction and adaptive weighting strategy, optimizing the qualification risk assessment model for small and medium-sized enterprises in the domestic manufacturing industry, solving the shortcomings of existing methods in high-risk identification, and providing a more accurate and sensitive solution for enterprise qualification evaluation.
[0266] The above specific implementation methods further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above are only specific implementation methods of the present invention and are not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. A method for constructing a manufacturing enterprise qualification assessment model, characterized in that: The model building method comprises: Data preprocessing to standardize risk characteristics; PCA-based risk score extraction was used to generate a comprehensive risk score; Customize weighted loss function and set risk classification weights; Use LightGBM model training to optimize the loss function, and customize the weighted loss function after optimization; The model is trained according to the optimized weighted loss function to obtain an enterprise qualification evaluation model.
2. A method for constructing a manufacturing enterprise qualification assessment model according to claim 1, characterized in that: The data preprocessing, standardization of risk characteristics, specifically includes: Standardize the risk characteristics to ensure that each characteristic has the same dimension; The risk characteristics include: "number of ICP registrations for corporate websites", "number of defendants", "number of corporate trademarks", and "number of people covered by the company's unemployment insurance".
3. A method for constructing a manufacturing enterprise qualification assessment model according to claim 2, characterized in that: The data preprocessing, before standardizing the risk characteristics, also includes: Predict the target variable and define the prediction label, 1 for "yes" and 0 for "no"; Label 1 is "yes": the enterprise has a loan balance and is not overdue at the observation time, but the number of overdue days in the next 90 days is greater than or equal to 30 days; Label 0 is "no": the enterprise has a loan balance and is not overdue at the observation time, and there will be no overdue or less than 30 days in the next 90 days; Data cleaning and processing; Divide the data set into training set, test set and OOT set; Use the GAN algorithm to enhance the data of the training set; XGBoost and LightGBM algorithms are used to sort the feature importance and finally select the modeling features.
4. A method for constructing a manufacturing enterprise qualification assessment model according to claim 3, characterized in that: The XGBoost and LightGBM algorithms are used to sort the feature importance, and the final selected modeling features include: XGBoost algorithm, specifically includes: Using the Boosting framework, a series of decision trees are gradually constructed and optimized so that each tree continuously reduces the error based on the previous tree. Feature selection: XGBoost uses a greedy algorithm to select features that maximize the objective function gain at each tree split; because it takes into account the error term and regularization term, XGBoost's feature selection process is robust and accurate; LightGBM algorithm, specifically includes: Distributed algorithm and efficient processing: LightGBM uses an efficient histogram-based algorithm that can quickly build and update tree models; Feature selection: LightGBM selects features based on the gain of the split point when the tree is split, and introduces a Leaf-wise tree growth strategy; Get multiple feature indicator explanations; The four indicators of "number of contract disputes", "number of court announcements", "number of defendants" and "number of cases of defaulting on trust" are selected as the main components of the PCA risk score to generate weights.
5. A method for constructing a manufacturing enterprise qualification assessment model according to claim 4, characterized in that: The PCA-based risk score extraction and generation of a comprehensive risk score specifically include: Through principal component analysis (PCA), multi-dimensional risk features are reduced to generate a single comprehensive risk score. The process of PCA is: Assume the risk characteristic matrix is Where n is the number of samples and m is the number of features; X r Perform centering and covariance matrix calculations; Solve the eigenvalues and eigenvectors of the covariance matrix and select the principal component with the largest explained variance; The generated principal component scores are used as risk scores and input to the model.
6. A method for constructing a manufacturing enterprise qualification assessment model according to claim 4, characterized in that: The LightGBM algorithm specifically includes: LightGBM is an improved model based on the gradient boosting framework[10]. The core idea is to gradually reduce the model loss by building a series of decision trees. Assume there are N samples and the input features are The goal is to minimize the given loss function The prediction value generated by the LightGBM model in the tth round of iteration is recorded as The initial value is Split optimization based on loss function includes: The core of LightGBM is to minimize the given loss function; Assume that the current model's prediction is Add a new decision tree f t (x) to fit the current residual, so that: Among them, f t (x) is the decision tree of round t; In LightGBM, the new decision tree f t (x) is obtained by minimizing the negative gradient of the loss function. The optimization problem is written as: Taylor expansion and the gradient and second-order derivative of the loss function include: LightGBM approximates the loss function through Taylor second-order expansion to minimize the loss during the splitting process; For each sample i, the loss function The predicted value at the tth iteration The Taylor expansion around is expressed as: Where: Gradient: Second order derivative (Hessian): According to the second-order expansion, minimizing the loss function of the current round is approximately the problem of optimizing the weighted square error: Calculation of tree node splitting gain: When LightGBM splits each node of the tree, it selects the feature and splitting point with the largest gain; assuming that a node contains a sample set S, S is divided into left and right subsets S left and S right When , the split gain Gain is calculated as: Among them, λ is the regularization parameter; the larger the gain, the more effective the split is in reducing the loss; The calculation of leaf node values includes: In the generation process of each tree of LightGBM, the calculation of leaf node values is based on the minimization of the loss function. Given that the sample set contained in leaf node j is S j , node value w j It is obtained by minimizing the following formula: Represents updating the output of the model at the leaf node to reduce the value of the loss function.
7. The method for constructing a manufacturing enterprise qualification evaluation model according to claim 1, characterized in that: The PCA-based risk control method includes: Given Represents p risk features of n samples and performs standardization; For each feature X j Normalized to: Among them, μ j is the mean of the jth feature, σ j is the standard deviation of the jth feature. The standardized matrix Z ensures that the mean of each feature is 0 and the variance is 1; Calculate the covariance matrix Z of the standardized data matrix Z: The covariance matrix Z describes the correlation between various risk characteristics; Solving for eigenvalues and eigenvectors, including: PCA obtains the principal components by solving the eigenvalues and eigenvectors of the covariance matrix Z; Let λ1,λ2,...,λ p is the eigenvalue of ∑, satisfying: ∑v i =λ i v i , i = 1, 2, ..., p; where v i is the corresponding eigenvector, representing the direction of the i-th principal component, λ i is the variance explained by this principal component; The selection of principal components is done by selecting the first k principal components whose cumulative explained variance reaches more than 95%: The first k principal components can explain most of the variance information of the data; The principal component score is obtained by projecting the original data Z onto the eigenvector, risk score = ZW; Where W is a matrix consisting of the first k eigenvectors.
8. The method for constructing a manufacturing enterprise qualification assessment model according to claim 1, characterized in that: The custom weighted loss function and setting of risk classification weights specifically include: Definition of adaptive weighted loss function In order to differentiate samples of different risk levels, the risk score r is introduced i As a basis for weight; The samples are weighted according to their risk score quartiles (q1, q2, q3): After introducing weights, the adaptive weighted mean square error is defined as: Among them, w i is the weight of the i-th sample, which is dynamically adjusted based on the risk score of the sample; The gradient and second-order derivative of the adaptive weighted loss function include: In the LightGBM model, the goal is to minimize the weighted loss function. Under the adaptive weighting strategy, a dynamically adjusted weight w is assigned to each sample. i , sample-based risk scoring; The loss function after introducing weights is: The gradient and Hessian of LightGBM plus the influence of weights: gradient: Second order derivative: The weight w of high-risk samples i The larger it is, the larger its gradient and second-order derivative are; During the optimization process, the model pays more attention to high-risk samples, is more sensitive to errors, and enhances its predictive ability for high-risk samples.
Citation Information
Cited By
Intelligent expense reimbursement auditing system and method for financial sharing center
CN120355503A
Enterprise digital transformation maturity evaluation method and system
CN121526437A