Credit debt default prediction method and system based on time sequence dynamic focus loss function

By combining the time-series dynamic focus loss function and the XGBoost model, this study addresses the problems of feature dimension disaster, sample imbalance, and concept drift in credit bond default prediction, achieving efficient and transparent credit bond default prediction.

CN121581995APending Publication Date: 2026-02-27SHANDONG UNIV OF FINANCE & ECONOMICS
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610106597.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-01-27
Publication Date
2026-02-27

AI Technical Summary

Technical Problem

Existing methods for predicting corporate bond defaults suffer from problems such as the curse of dimensionality due to an excessive number of features, poor model generalization ability due to sample imbalance, degraded model performance due to concept drift, and difficulty in interpreting machine learning models.

Method used

We employ a time-series dynamic focus loss function combined with the XGBoost model for training. By using the expanded window method to partition the dynamic dataset, feature selection, and SHAP analysis, we alleviate imbalanced data and concept drift, thereby improving the model's interpretability.

Benefits of technology

It significantly reduces model complexity and overfitting risk, improves computational efficiency and generalization ability, enhances the ability to identify minority class samples, achieves high-precision and stable credit bond default prediction, and the model decision-making process is transparent and interpretable.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121581995A_ABST
    Figure CN121581995A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of artificial intelligence and financial risk control, and relates to a credit debt default prediction method and system based on a time sequence dynamic focus loss function, and the method comprises the following steps: S1, generating a dynamic data set; step S2, a step of feature screening; step S3, a model training step; step S4, a model explanation step; according to the technical scheme, the cross entropy loss function is improved, and the dynamic class balance weight, the focus loss adjustment factor weight and the exponential decay time sequence weight are added, so that the recognition capability of the model for default bonds can be effectively improved, and the problems of feature dimension disasters, class imbalance, concept drift and model interpretability are solved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The application belongs to the technical field of artificial intelligence and financial risk control, and particularly relates to a credit bond default prediction method and system based on a time sequence dynamic focal point loss function. BACKGROUND

[0002] With the deepening development and scale expansion of the domestic bond market, credit risk is increasingly prominent. In order to prevent risk diffusion, ensure market stability and support the real economy, it is urgent to strengthen the dynamic monitoring and accurate identification of credit risk.

[0003] In combination with the current situation of the domestic credit bond market, the existing credit bond default prediction methods at home and abroad are found to still have some technical defects: the number of features affecting credit bond default is very rich, and too many features used in the model will cause the problem of "dimension disaster"; the number of default samples and the number of non-default samples in the domestic credit bond market is extremely unbalanced, resulting in poor model generalization ability; credit bond default samples and non-default samples will change over time, and the feature distribution will also change accordingly, which will cause the prediction ability of old samples to decrease over time, thereby causing the model performance to decrease; the "black box" nature of the machine learning model makes the internal decision-making process difficult to understand intuitively, which makes it difficult to explain the prediction results in practical applications.

[0004] Therefore, the application provides a credit bond default prediction method and system based on a time sequence dynamic focal point loss function to solve the above-mentioned defects in the prior art, which is very necessary. SUMMARY

[0005] The purpose of the application is to provide a credit bond default prediction method and system based on a time sequence dynamic focal point loss function to solve the above-mentioned technical problems in view of the defects of the prior art.

[0006] To achieve the above-mentioned purpose, the application provides the following technical solution: A credit bond default prediction method based on a time sequence dynamic focal point loss function, comprising the following steps: Step S1, a dynamic data set generation step, in which: The dynamic data set is divided according to the expanding window method to realize dynamic prediction of bond default; Step S2, a feature screening step, in which: The statistical test and model performance are used to screen each data set in the dynamic data set to avoid data leakage and cause the model generalization ability to decrease; Step S3, a model training step, in which: In the model training stage, an XGBoost model combined with a time-series dynamic focal loss function is used for training. Step S4, a model interpretation step, in which: A SHAP analysis method (Shapley Additive explanations) is used to analyze the importance of each feature in credit bond default prediction and how it affects model prediction, and to interpret the model.

[0007] Preferably, the step S1 of dividing the dynamic data set according to the expanding window method comprises: Based on multiple consecutive prediction target years, an expanding window sequence is constructed; for each target year in the expanding window sequence, the corresponding test set includes the data of the target year, the validation set includes all the data of the previous year of the target year, and the training set includes all the data from the fixed initial year to the previous year of the corresponding validation set of the target year; finally, the multiple expanding window sequences obtained by division form the dynamic data set to simulate the real scenario of rolling prediction at different time points.

[0008] Preferably, the step S2 comprises: The Mann-Whitney U test method is used to perform inter-group difference significance test on the distribution of the "default" samples and the "non-default" samples of the credit bonds under the same characteristics, and all characteristics are sequentially filtered to remove characteristics that cannot distinguish whether the credit bonds default or not. At the same time, the Spearman correlation test method is used to calculate the correlation coefficients between the characteristics, and the redundant characteristics with high correlation are removed according to the correlation coefficients. The RFECV algorithm (Recursive Feature Elimination with Cross-Validation algorithm) is used to eliminate unimportant features: G-mean is used as an indicator to evaluate the performance of the model, cross-validation is used to evaluate the influence of the current feature subset on the performance of the model, and the features that reduce the performance of the model are recursively removed, and finally the feature subset that is most helpful to the performance of the model is selected.

[0009] Preferably, the time-series dynamic focal loss function in step S3 comprises: To simultaneously alleviate the problems of unbalanced data and concept drift, a dynamic class balance weight , a focal loss adjustment factor weight , and a time-series weight are added to the cross-entropy loss. The expression of the time-series dynamic focal loss function is as follows:

[0010] wherein, N denotes the total number of samples, denotes the true label, T denotes the current year, denotes the sample i corresponding to the year, denotes the probability of the model predicting a positive example (a default sample), with a value range of [0, 1], denotes the number of samples with a class of y . λ denotes a hyperparameter for adjusting the decay speed of the weight, for a given λ , the time series weight of the sample is greater when the sample belongs to a time closer to the current, i.e. is smaller, to alleviate the impact of concept drift. γ denotes a hyperparameter for controlling the degree of focus, with a value range of γ ≥ 0, γ The greater the value of β , the greater the degree of focus on difficult samples (in a classification task, samples can be divided into easy samples and difficult samples, easy samples are samples that the model can clearly identify the class, and are far from the classification boundary; difficult samples are samples that the model cannot clearly identify the class, and are at the classification boundary. In unbalanced data, the number of easy samples is usually much larger than that of difficult samples), to solve the class imbalance problem. β The greater the value of β , the greater the weight adjustment intensity; the closer the value of to 0, the smaller the weight adjustment intensity. For small sample size β minority class samples, when the value of the given hyperparameter is small, the effective sample number calculated is small, and the loss is large, which can make the XGBoost model enhance the sensitivity to minority class samples.

[0011] The training process uses the XGBoost model, and the time series dynamic focus loss function needs to meet the requirement of the XGBoost model for the second-order differentiability of the loss function. Therefore, taking the loss of a single sample as an example, the first-order derivative (gradient) and the second-order derivative (Hessian) of the time series dynamic focus loss function are calculated to prove that the loss function can be used for the XGBoost model. After derivation, the expression of the time series dynamic focus loss function is:

[0012] wherein, denotes the probability of the model predicting a positive class (the probability of predicting a default sample), which is obtained by converting the original score output by the XGBoost model through the sigmoid function to get yThe sample category is represented.

[0013] Preferably, the step S4 specifically comprises: The SHAP value of each feature is calculated by using the SHAP analysis method, and the importance of each feature to the model prediction is evaluated according to the SHAP value of the feature. The greater the SHAP value, the greater the importance of the corresponding feature to the model prediction output.

[0014] In addition, the present application also provides a credit bond default prediction system based on a time series dynamic focal point loss function, comprising: A dynamic data set generation unit, in which: The dynamic data set is divided according to the expanding window method to realize dynamic prediction of bond default; A feature screening unit, in which: Each data set in the dynamic data set is respectively screened based on statistical test and model performance to avoid the decline of model generalization ability caused by data leakage; A model training unit, in which: In the model training stage, the XGBoost model combined with the time series dynamic focal point loss function is used for training; A model explanation unit, in which: The SHAP analysis method (Shapley Additive explanations) is used to analyze the importance of each feature in credit bond default prediction and how it affects model prediction, and the model is explained.

[0015] Preferably, the dynamic data set generation unit divides the dynamic data set according to the expanding window method, comprising: Based on multiple consecutive prediction target years, an expanding window sequence is constructed. For each target year in the expanding window sequence, the corresponding test set includes the data of the target year, the validation set includes all the data of the previous year of the target year, and the training set includes all the data from the fixed initial year to the previous year of the corresponding validation set of the target year. Finally, the multiple expanding window sequences obtained by division form the dynamic data set to simulate the real scenario of rolling prediction at different time points.

[0016] Preferably, the feature screening unit comprises: The Mann-Whitney U test method is used to perform inter-group difference significance test on the distribution of the "default" sample and the "non-default" sample of the credit bond under the same feature, and all features are sequentially screened to eliminate features that cannot significantly distinguish whether the credit bond is in default. At the same time, the Spearman correlation test method is used to calculate the correlation coefficient between each two features, and the redundant features with high correlation are eliminated according to the correlation coefficient. The RFECV algorithm (Recursive Feature Elimination with Cross-Validation algorithm) is used, and the G-mean is used as an evaluation model performance index. The influence of the current feature subset on the model performance is evaluated by cross-validation, and the features that reduce the G-mean index of the model are recursively removed, and finally the feature subset that is most helpful to the model performance is selected.

[0017] Preferably, the time-series dynamic focal loss function in the model training unit comprises: To simultaneously alleviate the unbalanced data problem and the concept drift problem, a dynamic class balance weight is added to the cross-entropy loss , a focal loss adjustment factor weight , and a time-series weight . The time-series dynamic focal loss function expression is as follows:

[0018] Wherein, N represents the total number of samples, represents the true label, T represents the current year, represents the sample i corresponding to the year, represents the probability of the model predicting a positive example (default sample), and the value range is [0, 1], represents the number of samples of class y . λ represents a hyperparameter for adjusting the decay rate of the weight, for a given λ , the closer the sample belongs to the time to the current, that is, the smaller , the greater the time-series weight of the sample, so as to alleviate the influence of the concept drift. γ represents a hyperparameter for controlling the focusing degree, and the value range is γ ≥0, γ The greater the focusing degree of the difficult-to-classify sample (the sample in the classification task can be divided into easy-to-classify samples and difficult-to-classify samples. The easy-to-classify sample is a sample that the model can obviously identify the class, and is far away from the classification boundary. The difficult-to-classify sample is a sample that the model cannot obviously identify the class, and is in the classification boundary. In the unbalanced data, the number of easy-to-classify samples is usually much larger than that of difficult-to-classify samples), so as to solve the class imbalance problem. β is a hyperparameter for controlling the weight adjustment intensity, and the greater the β tends to 1, the greater the weight adjustment intensity; the smaller the β tends to 0, the smaller the weight adjustment intensity. For small sample quantity of the minority class sample, in the given hyperparameterβ When the value is , the number of effective samples calculated is small and the loss is large, which can enhance the sensitivity of the XGBoost model to minority class samples.

[0019] The training process uses the XGBoost model, and the temporal dynamic focus loss function must satisfy the XGBoost model's requirement that the loss function be twice differentiable. Therefore, taking the loss of a single sample as an example, we calculate the first derivative (gradient) and second derivative (Hessian) of the temporal dynamic focus loss function to prove that this loss function can be used in the XGBoost model. After differentiation, the expression of the temporal dynamic focus loss function is:

[0020] in, The raw score output by the XGBoost model represents the predicted positive class probability (the probability of predicting a default sample). After the sigmoid function Transformed from y Indicates the sample category.

[0021] Preferably, the model interpretation unit specifically includes: The SHAP analysis method is used to calculate the SHAP value of each feature. The importance of each feature to the model prediction is evaluated based on the SHAP value of the feature. The larger the SHAP value, the greater the importance of the corresponding feature to the model prediction output.

[0022] The beneficial effects of this invention are as follows: By employing a two-stage feature selection strategy, it solves the problem of the curse of feature dimensionality, achieving better predictive performance with fewer features, significantly reducing model complexity and overfitting risk, and improving computational efficiency and model generalization ability; In the composite loss function, through dynamic class balancing weights and focus loss adjustment factor weights, it can simultaneously focus on sample class and classification difficulty, greatly enhancing the ability to identify minority class samples, while effectively controlling misclassification of majority class through the weight balancing mechanism, achieving a high level of balance between accurate identification and misclassification control; In the loss function, through exponentially decaying time-series weights and using the extended window method to divide the dynamic dataset, the model can dynamically adapt to changes in data distribution over time, continuously maintaining high-precision predictive ability, as well as temporal stability and adaptability; The SHAP interpretability analysis framework is used to analyze the model decision-making process, breaking down the "black box" barrier of machine learning models, clearly revealing the degree and direction of the influence of each feature on the prediction results, making the model's decision-making process transparent, interpretable, and trustworthy, providing reliable decision-making basis for risk managers. Attached Figure Description

[0023] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.

[0024] Figure 1 This is a flowchart of a credit bond default prediction method based on a time-series dynamic focus loss function provided by the present invention.

[0025] Figure 2 This is a block diagram illustrating the principle of a credit bond default prediction system based on a time-series dynamic focus loss function, as provided by this invention.

[0026] Figure 3 This is a model architecture diagram of a credit bond default prediction method based on a time-series dynamic focus loss function provided by the present invention. Detailed Implementation

[0027] The present invention will now be described in detail with reference to the accompanying drawings and specific embodiments. The following embodiments are explanations of the present invention, but the present invention is not limited to the following implementation methods.

[0028] Example 1: like Figure 1 As shown in the figure, this embodiment provides a credit bond default prediction method based on a time-series dynamic focus loss function, which includes the following steps: Step S1, the step of generating the dynamic dataset, in which: The dynamic dataset is divided using the extended window method to enable dynamic prediction of bond defaults.

[0029] Step S1, which involves partitioning the dynamic dataset using the expanded window method, includes: According to the bond default data of Wind database, the credit bonds issued in the public market in China from 2018 to 2024 are selected as the research object, including enterprise bonds, corporate bonds, medium-term notes and short-term financing bills. Based on multiple consecutive prediction target years from 2018 to 2024, an extended window sequence is constructed; for each target year in the extended window sequence, the test set corresponding to the target year includes the data of the target year, the validation set includes all the data of the previous year of the target year, and the training set includes all the data from the fixed initial year to the previous year of the validation set corresponding to the target year; finally, the multiple extended window sequences obtained by division form a dynamic data set to simulate the real scene of rolling prediction at different time points. The training set data of window 0 includes the credit bond data from 2018 to 2020, the validation set data is the credit bond data in 2021, and the test set data is the credit bond data in 2022; the training set data of window 1 includes the credit bond data from 2018 to 2021, the validation set data is the credit bond data in 2022, and the test set data is the credit bond data in 2023; the training set data of window 2 includes the credit bond data from 2018 to 2022, the validation set data is the credit bond data in 2023, and the test set data is the credit bond data in 2024.

[0030] Step S2, the step of feature screening, in which: Based on statistical test and model performance, feature screening is performed on each data set in the dynamic data set to avoid data leakage and reduce the generalization ability of the model.

[0031] The step S2 includes: The Mann-Whitney U test method is used to perform inter-group difference significance test on the distribution of the “default” sample and the “non-default” sample of the credit bond under the same feature, and all features are sequentially screened to eliminate features that cannot significantly distinguish whether the credit bond is in default. At the same time, the Spearman correlation test method is used to calculate the correlation coefficient between each two features, and redundant features with high correlation are removed according to the correlation coefficient; The RFECV algorithm (Recursive Feature Elimination with Cross-Validation algorithm, Recursive Feature Elimination with Cross-Validation algorithm) is used to eliminate unimportant features: G-mean is used as an indicator to evaluate the performance of the model, and cross-validation is used to evaluate the influence of the current feature subset on the performance of the model. The features that reduce the performance of the model are recursively removed, and finally the feature subset that is most helpful to the performance of the model is selected.

[0032] Step S3, the step of model training, in which: In the model training stage, an XGBoost model combined with a time-series dynamic focal loss function is used for training, with the class label of the defaulted bond marked as 1 and the class label of the non-defaulted bond marked as 0.

[0033] The time-series dynamic focal loss function in the step S3 comprises: To simultaneously alleviate the unbalanced data problem and the concept drift problem, a dynamic class balance weight is added to the cross-entropy loss , a focal loss adjustment factor weight , and a time-series weight . The expression of the time-series dynamic focal loss function is as follows:

[0034] wherein, N represents the total number of samples, represents the true label, T represents the current year, represents the sample i corresponding to the year, represents the probability of the model predicting a positive example (a defaulted sample), with a value range of [0, 1], represents the number of samples of the class y . λ represents a hyperparameter for adjusting the decay speed of the weight, for a given λ , the time-series weight of the sample is greater when the sample belongs to a time closer to the current time, i.e., the value of is smaller, so as to alleviate the influence of the concept drift. γ represents a hyperparameter for controlling the degree of focusing, with a value range of γ ≥ 0, γ The greater the value of β is, the greater the degree of focusing on the difficult-to-classify samples (in a classification task, samples can be classified into easy-to-classify samples and difficult-to-classify samples, the former is a sample that the model can obviously identify the class of, which is far away from the classification boundary; the latter is a sample that the model cannot obviously identify the class of, which is at the classification boundary. In unbalanced data, the number of easy-to-classify samples is usually much greater than that of difficult-to-classify samples), so as to solve the class imbalance problem. β The greater the value of β is, the greater the weight adjustment intensity is; the smaller the value of is, the smaller the weight adjustment intensity is. For a small sample quantity of the minority class sample, when the value of the hyperparameter β is given, the calculated effective sample quantity is small and the loss is large, which can make the XGBoost model enhance the sensitivity to the minority class sample.

[0035] The training process adopts an XGBoost model, and the time-series dynamic focal loss function needs to meet the requirement of the XGBoost model for the second-order differentiability of the loss function. Therefore, taking the loss of a single sample as an example, the first-order derivative (gradient) and the second-order derivative (Hessian) of the time-series dynamic focal loss function are calculated to prove that the loss function can be used for the XGBoost model. After derivation, the expression of the time-series dynamic focal loss function is as follows:

[0036] wherein, represents the probability of the positive class predicted by the model (the probability of predicting the default sample), and the original score output by the XGBoost model is converted by the sigmoid function , y represents the class of the sample.

[0037] Step S4, a step of model explanation, in which: a SHAP analysis method (Shapley Additive explanations) is used to analyze the importance of each feature in the credit bond default prediction and how it affects the model prediction, and the model is explained.

[0038] The step S4 specifically includes: a SHAP analysis method is used to calculate the SHAP value of each feature, and the importance of each feature to the model prediction is evaluated according to the SHAP value of the feature. The greater the SHAP value, the greater the importance of the corresponding feature to the output of the model prediction.

[0039] Embodiment 2: As shown in Figure 2 , the credit bond default prediction system based on the time-series dynamic focal loss function provided in this embodiment includes: a dynamic data set generation unit 1, in which: the dynamic data set is divided according to the extended window method to realize dynamic prediction of bond default; the dynamic data set generation unit 1 divides the dynamic data set according to the extended window method, which includes: based on a plurality of consecutive prediction target years, an extended window sequence is constructed; for each target year in the extended window sequence, the test set corresponding to the target year includes the data of the target year, the validation set includes all the data of the previous year of the target year, and the training set includes all the data from the fixed initial year to the previous year of the validation set corresponding to the target year; finally, the plurality of extended window sequences divided form the dynamic data set to simulate the real scene of rolling prediction at different time points.

[0040] The unit 2 for feature screening, wherein: The feature screening is performed on each data set in the dynamic data set based on statistical test and model performance, so as to avoid data leakage and reduce the model generalization ability; The feature screening unit 2 comprises: The Mann-Whitney U test method is used to perform inter-group difference significance test on the distribution of the “default” sample and the “non-default” sample of the credit bond under the same feature, and all features are sequentially screened to eliminate features that cannot distinguish whether the credit bond is in default, and the Spearman correlation test method is used to calculate the correlation coefficient between each two features, and the redundant features with high correlation are eliminated according to the correlation coefficient; The RFECV algorithm (Recursive Feature Elimination with Cross-Validation algorithm, Recursive Feature Elimination with Cross-Validation algorithm) is used to eliminate unimportant features: the G-mean is used as an index for evaluating the model performance, the cross-validation is used to evaluate the influence of the current feature subset on the model performance, the features that reduce the model performance index are recursively removed, and finally the feature subset that is most helpful to the model performance is selected.

[0041] The unit 3 for model training, wherein: In the model training stage, the XGBoost model combined with the time-series dynamic focal loss function is used for training; The time-series dynamic focal loss function in the model training unit 3 comprises: In order to simultaneously alleviate the unbalanced data problem and the concept drift problem, the dynamic class balance weight , the focal loss adjustment factor weight and the time-series weight are added on the basis of the cross-entropy loss. The expression of the time-series dynamic focal loss function is as follows:

[0042] Among them, N represents the total number of samples, represents the true label, T represents the current year, represents the sample i corresponding to the year, represents the probability of the model predicting the positive example (default sample), and the value range is [0, 1], represents the number of samples with the class y . λ represents the hyperparameter for adjusting the decay speed of the weight, for a given λ , when the sample belongs to the time closer to the current, that is The smaller the sample size, the greater its temporal weight, in order to mitigate the impact of concept drift. γ The hyperparameter represents the degree of focus control, and its value ranges from 1 to 2. γ ≥0, γ The larger the value, the greater the focus on difficult-to-classify samples (samples in classification tasks can be divided into easy-to-classify samples and difficult-to-classify samples. Easy-to-classify samples are those whose class can be clearly identified by the model and are far from the classification boundary; difficult-to-classify samples are those whose class cannot be clearly identified by the model and are located on the classification boundary. In imbalanced data, the number of easy-to-classify samples is usually much greater than that of difficult-to-classify samples), thus solving the class imbalance problem. β This represents the hyperparameter used to control the magnitude of weight adjustment. β The closer it is to 1, the greater the weight adjustment; when β The closer the weight is to 0, the smaller the adjustment. For small sample sizes... Minority class samples, given hyperparameters β When the value is , the number of effective samples calculated is small and the loss is large, which can enhance the sensitivity of the XGBoost model to minority class samples.

[0043] The training process uses the XGBoost model, and the temporal dynamic focus loss function must satisfy the XGBoost model's requirement that the loss function be twice differentiable. Therefore, taking the loss of a single sample as an example, we calculate the first derivative (gradient) and second derivative (Hessian) of the temporal dynamic focus loss function to prove that this loss function can be used in the XGBoost model. After differentiation, the expression of the temporal dynamic focus loss function is:

[0044] in, The raw score output by the XGBoost model represents the predicted positive class probability (the probability of predicting a default sample). After the sigmoid function Transformed from y Indicates the sample category.

[0045] The model explains unit 4, in which: The SHAP (Shapley Additive Explanations) method is used to analyze the importance of each feature in credit bond default prediction and how it affects the model's prediction, thus explaining the model.

[0046] The model interpretation unit 4 specifically includes: The SHAP analysis method is used to calculate the SHAP value of each feature, and the importance of each feature to the model prediction is evaluated according to the SHAP value of the feature. The greater the SHAP value, the greater the importance of the corresponding feature to the model prediction output.

[0047] The embodiments in the specification are described in a progressive manner, and each embodiment focuses on the difference from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the method disclosed in the embodiments, since it corresponds to the system disclosed in the embodiments, the description is relatively simple, and the relevant part can be referred to the method part.

[0048] The skilled person can further realize that the units and algorithm steps of the examples described in combination with the embodiments disclosed herein can be realized by electronic hardware, computer software or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the components and steps of the examples have been described in the above description. Whether the functions are realized in hardware or software depends on the specific application and design constraints of the technical solution. The skilled person can use different methods to realize the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.

[0049] In several embodiments provided by the present application, it should be understood that the disclosed system, system and method can be implemented in other ways. For example, the system embodiments described above are only schematic. For example, the division of the units is only a logical function division, and there can be another division in actual implementation. For example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the units shown or discussed can be indirect coupling or communication connection through some interface, system or unit, which can be electrical, mechanical or in other forms.

[0050] The units described as separate components can or can not be physically separated, and the components shown as units can or can not be physical units, i.e. they can be located in one place or distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the embodiment.

[0051] In addition, the functional modules in each embodiment of the present application can be integrated in one processing unit, or each module can exist physically, or two or more modules can be integrated in one unit.

[0052] Similarly, each processing unit in various embodiments of the present application can be integrated in one functional module, or each processing unit can exist physically, or two or more processing units can be integrated in one functional module.

[0053] The steps of a method or algorithm described in connection with the embodiments disclosed herein can be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. A software module can reside in RAM, flash memory, ROM, electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art. The processor can be configured to execute the software module.

[0054] Finally, it should be noted that the terms "first", "second", and the like, herein do not denote any order, quantity, combination, or importance, but are used to distinguish one entity or action from another, and do not imply or require any such actual relationship or sequence. Also, the terms "include", "contain", or any other variant thereof are intended to cover a non-exclusive inclusion, so that processes, methods, articles, or devices including a series of elements not only include those elements, but also include other elements not explicitly listed, or inherent to such processes, methods, articles, or devices. Without more limitations, the element defined by the phrase "including a" does not exclude the presence of additional identical elements in the process, method, article, or device including the element.

[0055] The above disclosed are only the preferred embodiments of the present application, but the present application is not limited thereto, any non-creative changes that can be thought of by those skilled in the art, and several improvements and refinements made without departing from the principles of the present application, should fall within the protection scope of the present application.

Claims

1. A method for predicting corporate bond defaults based on a time-series dynamic focus loss function, characterized in that, Includes the following steps: Step S1, the step of generating the dynamic dataset, in which: Divide the dynamic dataset according to the expanded window method; Step S2, the feature selection step, in which: Feature selection was performed on each dataset in the dynamic dataset based on statistical tests and model performance. Step S3, the model training step, in which: During the model training phase, the XGBoost model combined with the temporal dynamic focus loss function was used for training. Step S4, the model interpretation step, in which: The SHAP analysis method is used to analyze the importance of each feature in the prediction of credit bond defaults and how it affects the model prediction, and the model is explained.

2. The credit bond default prediction method based on a time-series dynamic focus loss function according to claim 1, characterized in that, Step S1, which involves partitioning the dynamic dataset using the expanded window method, includes: An extended window sequence is constructed based on multiple consecutive target years for prediction. For each target year in the extended window sequence, the corresponding test set includes the data of the target year, the validation set includes all the data of the year preceding the target year, and the training set includes all the data from the fixed initial year to the year preceding the corresponding validation set of the target year. The resulting multiple extended window sequences form a dynamic dataset.

3. The credit bond default prediction method based on a time-series dynamic focus loss function according to claim 1, characterized in that, Step S2 includes: The Mann-Whitney U test was used to test the significance of the differences between the distribution of "defaulted" and "non-defaulted" samples of credit bonds under the same characteristics. All features were screened in turn, and features that could not distinguish whether a credit bond was in default were removed. At the same time, the Spearman correlation test was used to calculate the correlation coefficient between each pair of features, and redundant features with high correlation were removed based on the correlation coefficient. The RFECV algorithm is used to eliminate unimportant features. G-mean is used as the metric to evaluate model performance. Cross-validation is used to evaluate the impact of the current feature subset on model performance. Features that reduce model performance metrics are recursively removed, and finally the feature subset that is most helpful to model performance is selected.

4. The credit bond default prediction method based on a time-series dynamic focus loss function according to claim 1, characterized in that, The temporal dynamic focus loss function in step S3 includes: Based on cross-entropy loss, dynamic class balancing weights are added. Focus loss adjustment factor weight and time-series weights ; The expression for the time-series dynamic focus loss function is as follows: in, N Indicates the total number of samples. Indicates the true label, T Indicates the current year. Indicates sample i The corresponding year, This represents the probability that the model predicts a positive example, and its value ranges from [0,1]. Indicates category as y The number of samples; λ This represents a hyperparameter that adjusts the rate of weight decay; the closer the sample's time period is to the present, the more likely it is to decay. The smaller the sample size, the greater its temporal weight. γ The hyperparameter represents the degree of focus control, and its value ranges from 1 to 2. γ ≥0, γ The larger the value, the greater the focus on difficult-to-distinguish samples; β This represents the hyperparameter used to control the magnitude of weight adjustment. β The closer it is to 1, the greater the weight adjustment; when β The closer the value is to 0, the smaller the weight adjustment. The training process uses the XGBoost model. Taking the loss of a single sample as an example, the first and second derivatives of the temporal dynamic focus loss function are calculated. After differentiation, the expression of the temporal dynamic focus loss function is: in, The raw score output by the XGBoost model represents the predicted positive class probability. After the sigmoid function Transformed into y Indicates the sample category.

5. The credit bond default prediction method based on a time-series dynamic focus loss function according to claim 1, characterized in that, Step S4 specifically includes: The SHAP analysis method is used to calculate the SHAP value of each feature. The importance of each feature to the model prediction is evaluated based on the SHAP value of the feature. The larger the SHAP value, the greater the importance of the corresponding feature to the model prediction output.

6. A credit bond default prediction system based on a time-series dynamic focus loss function, characterized in that, include: The cell generated by the dynamic dataset contains: Divide the dynamic dataset according to the expanded window method; The feature filtering unit, in which: Feature selection was performed on each dataset in the dynamic dataset based on statistical tests and model performance. The unit for model training, in which: During the model training phase, the XGBoost model combined with the temporal dynamic focus loss function was used for training. The unit explained by the model, in which: The SHAP analysis method is used to analyze the importance of each feature in the prediction of credit bond defaults and how it affects the model prediction, and the model is explained.

7. A credit bond default prediction system based on a time-series dynamic focus loss function according to claim 6, characterized in that, The dynamic dataset generation unit divides the dynamic dataset according to the expanded window method, including: An extended window sequence is constructed based on multiple consecutive target years for prediction. For each target year in the extended window sequence, the corresponding test set includes the data of the target year, the validation set includes all the data of the year preceding the target year, and the training set includes all the data from the fixed initial year to the year preceding the corresponding validation set of the target year. The resulting multiple extended window sequences form a dynamic dataset.

8. A credit bond default prediction system based on a time-series dynamic focus loss function according to claim 6, characterized in that, The feature filtering unit includes: The Mann-Whitney U test was used to test the significance of the differences between the distribution of "defaulted" and "non-defaulted" samples of credit bonds under the same characteristics. All features were screened in turn, and features that could not distinguish whether a credit bond was in default were removed. At the same time, the Spearman correlation test was used to calculate the correlation coefficient between each pair of features, and redundant features with high correlation were removed based on the correlation coefficient. The RFECV algorithm is adopted and G-mean is used as the metric to evaluate model performance. Cross-validation is used to evaluate the impact of the current feature subset on model performance. Features that reduce the model's G-mean are recursively removed, and finally the feature subset that is most helpful to model performance is selected.

9. A credit bond default prediction system based on a time-series dynamic focus loss function according to claim 6, characterized in that, The temporal dynamic focus loss function in the model training unit includes: Based on cross-entropy loss, dynamic class balancing weights are added. Focus loss adjustment factor weight and time-series weights ; The expression for the time-series dynamic focus loss function is as follows: in, N Indicates the total number of samples. Indicates the true label, T Indicates the current year. Indicates sample i The corresponding year, This represents the probability that the model predicts a positive example, and its value ranges from [0,1]. Indicates category as y The number of samples; λ This represents a hyperparameter that adjusts the rate of weight decay; the closer the sample's time period is to the present, the more likely it is to decay. The smaller the sample size, the greater its temporal weight. γ The hyperparameter represents the degree of focus control, and its value ranges from 1 to 2. γ ≥0, γ The larger the value, the greater the focus on difficult-to-distinguish samples; β This represents the hyperparameter used to control the magnitude of weight adjustment. β The closer it is to 1, the greater the weight adjustment; when β The closer the value is to 0, the smaller the weight adjustment. The training process uses the XGBoost model. Taking the loss of a single sample as an example, the first and second derivatives of the temporal dynamic focus loss function are calculated. After differentiation, the expression of the temporal dynamic focus loss function is: in, The raw score output by the XGBoost model represents the predicted positive class probability. After the sigmoid function Transformed from y Indicates the sample category.

10. A credit bond default prediction system based on a time-series dynamic focus loss function according to claim 6, characterized in that, The model interpretation unit specifically includes: The SHAP analysis method is used to calculate the SHAP value of each feature. The importance of each feature to the model prediction is evaluated based on the SHAP value of the feature. The larger the SHAP value, the greater the importance of the corresponding feature to the model prediction output.