Project overdue prediction method, system and storage medium based on CatBoost and LightGBM algorithms
Patent Information
- Application Number
- CN202211463774.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-21
- Publication Date
- 2026-10-09
- Estimated Expiration
- 2042-11-21
AI Technical Summary
然而,科技项目的数据样式复杂且缺失值多,机器学习或深度学习算法难以学习数据中的有效知识,因此直接进行超期预测很难达到预期效果
[0048]实施本申请的基于CatBoost和LightGBM算法的项目超期预测方法、系统和计算机可读存储介质,具有以下有益效果:根据本申请实施例的项目超期预测方法通过对项目数据进行CatBoost编码,再使用LightGBM算法进行预测,最终得到项目是否超期的预测结果。CatBoost算法可以高效且合理地处理类别特征,在丰富特征维度及克服梯度偏差方面具有一定优越性。LightGBM算法内存占用更少,且泛化性能好。CatBoost算法编码后的数据具有平滑、低噪的优点,更有利于LightGBM算法的模型寻优,提升了执行期项目超期预测的准确性,从而提高了项目干预的准确性,有效降低项目超期风险。
Smart Images

Figure CN116108957B_ABST
Abstract
Description
Technical Field
[0001] This application relates to overdue risk prediction technology, and more specifically, to a method, system, and computer-readable storage medium for predicting project overdue risks based on CatBoost and LightGBM algorithms. Background Technology
[0002] Science and technology programs are a key policy for incentivizing technological innovation in enterprises, providing opportunities for innovation within businesses. On the one hand, these programs provide funding and enhance enterprises' social influence; on the other hand, they promote enterprise research and innovation, as well as industry-academia-research collaboration, reducing the risk of innovation failure. Therefore, whether science and technology program-funded projects can be completed on schedule reflects the level of an enterprise's technological capabilities, and the risk of projects exceeding their deadlines is a concern shared by both policymakers and enterprises.
[0003] Currently, research on science and technology projects focuses more on the analysis and prediction of scientific and technological outcomes. Analysis includes causal effect analysis and input-output efficiency analysis, while prediction includes forecasting the number of patents, papers, software publications, and talent pool. Less attention is paid to identifying whether science and technology projects are overdue. Therefore, identifying the risk of overdue projects during their implementation phase is essential. This lays the foundation for the actual transformation of subsequent project results and provides positive feedback for the continued implementation of relevant intervention measures.
[0004] Data feature analysis is crucial for predicting project delays. However, the data in science and technology projects is complex and contains many missing values, making it difficult for machine learning or deep learning algorithms to learn effective knowledge from the data. Therefore, directly predicting project delays rarely achieves the desired results. Existing machine learning or deep learning methods cannot directly learn high-performance models from data containing missing values and complex patterns, resulting in unreliable predictions of project delays. Summary of the Invention
[0005] The technical problem to be solved by this application is to provide a project overdue prediction method, system and computer-readable storage medium based on CatBoost and LightGBM algorithms that can improve the accuracy of overdue prediction, in order to address the above-mentioned deficiencies of the prior art.
[0006] To address its technical problem, this application proposes a project overdue prediction method based on CatBoost and LightGBM algorithms in its first aspect, the method comprising the following steps:
[0007] S1. After cleaning and integrating the historical project data, merge it into two data tables, the first data table and the second data table, and store them. The first data table stores the data of accepted projects, and the second data table stores the data of projects in the execution period.
[0008] S2. Use the CatBoost algorithm to encode the accepted project data in the first data table and the execution project data in the second data table. First, use the accepted project data as the training dataset to fit the CatBoost encoder, and then input the execution project data into the CatBoost encoder for encoding.
[0009] S3. Standardize the coded data of accepted projects and the data of projects in the execution phase;
[0010] S4. Using the LightGBM algorithm, input the standardized accepted project data into the LightGBM model, adjust the adjustable parameters of the model until the optimal prediction model for the "whether it is overdue" output variable is obtained.
[0011] S5. Input the standardized execution period project data into the optimal prediction model for prediction to obtain the prediction result of whether the execution period project has exceeded its time limit.
[0012] According to one embodiment of the first aspect of this application, step S1 further includes:
[0013] S11. Filter out project data from historical project data where the "contract signing date" is less than the "contract end date";
[0014] S12. Delete columns in the filtered project data where the proportion of empty values exceeds a preset threshold;
[0015] S13. Add a "whether it is overdue" label to the filtered project data, set the project with "acceptance date" not exceeding a predetermined time from "contract end date" as the first label, and set the project with "acceptance date" exceeding a predetermined time from "contract end date" as the second label;
[0016] S14. Determine whether the "acceptance date" of the filtered project data is empty. Save the project data with a non-empty "acceptance date" to the first data table and save the project data with an empty "acceptance date" to the second data table.
[0017] According to one embodiment of the first aspect of this application, step S2, which first uses accepted project data as a training dataset to fit the CatBoost encoder, and then inputs the execution-stage project data into the CatBoost encoder for encoding, further includes:
[0018] S21. Randomly sort the accepted project data input into the CatBoost encoder;
[0019] S22. Convert the floating-point values of the accepted project data to integers;
[0020] S23. Convert the characteristics of the accepted project data into numerical elements according to the following calculation formula:
[0021]
[0022] Among them, Ctr ij x is the encoded value of the j-th item for the i-th feature in the accepted project data. ij For the value of the j-th item object with the i-th feature, x ik For the values of other item objects with the i-th feature, when x ij =x ik When, then [x] ij =x ik If 1 is true, then 0 is false; pri is a constant value, representing the label value Y in the dataset. ij The ratio of the sum of all items to the total number of accepted items;
[0023] S24. Establish the mapping relationship between the feature values and the encoded values of the accepted project data to form a supervised Catboost encoder;
[0024] S25. Input the execution period project data into the supervised Catboost encoder to obtain the execution period project data encoding value.
[0025] According to one embodiment of the first aspect of this application, step S3 uses the RobustScaler standardization method to standardize the coded accepted project data and the project data in the execution phase.
[0026] According to one embodiment of the first aspect of this application, in step S4, the cv function of the LightGBM algorithm is used to adjust the adjustable parameters, and finally the optimal prediction model is determined by the highest AUC value.
[0027] To address its technical problem, this application proposes a project overdue prediction system based on CatBoost and LightGBM algorithms in a second aspect, the system comprising:
[0028] The data preprocessing module is used to clean and integrate historical project data and then merge it into two data tables, the first data table and the second data table, for storage. The first data table stores data of accepted projects, and the second data table stores data of projects in the execution phase.
[0029] The CatBoost encoding module is used to encode the accepted project data in the first data table and the execution project data in the second data table using the CatBoost algorithm. The accepted project data is first used as the training dataset to fit the CatBoost encoder, and then the execution project data is input into the CatBoost encoder for encoding.
[0030] The standardization processing module is used to standardize the coded accepted project data and the project data in the execution phase.
[0031] The LightGBM model training module is used to input standardized accepted project data into the LightGBM model using the LightGBM algorithm, and adjust the adjustable parameters of the model until the optimal prediction model for the "whether it is overdue" output variable is obtained.
[0032] The prediction module is used to input the standardized execution-period project data into the optimal prediction model for prediction, and obtain the prediction result of whether the execution-period project has exceeded its time limit.
[0033] According to one embodiment of the second aspect of this application, the preprocessing module further includes:
[0034] The filtering unit is used to filter project data from historical project data to find projects whose "contract signing date" is less than the "contract end date";
[0035] The column deletion unit is used to delete columns in the filtered project data where the proportion of empty values exceeds a preset threshold.
[0036] The column addition unit is used to add a column of "whether it is overdue" flag values to the filtered project data. Projects whose "acceptance date" does not exceed a predetermined period of time from the "contract end date" are set as the first flag value, and projects whose "acceptance date" exceeds a predetermined period of time from the "contract end date" are set as the second flag value.
[0037] The classification unit is used to determine whether the "acceptance date" of the filtered project data is empty, save the project data with a non-empty "acceptance date" to the first data table, and save the project data with an empty "acceptance date" to the second data table.
[0038] According to one embodiment of the second aspect of this application, the CatBoost encoding module further includes:
[0039] The random sorting unit is used to randomly arrange the accepted project data input to the CatBoost encoder to generate multiple random sequences;
[0040] The tag value conversion unit is used to convert the floating-point tag values of accepted project data into integers;
[0041] The first coding unit is used to convert the characteristics of the accepted project data into numerical elements according to the following calculation formula:
[0042]
[0043] Among them, Ctr ij x is the encoded value of the j-th item for the i-th feature in the accepted project data. ij For the value of the j-th item object with the i-th feature, x ik For the values of other item objects with the i-th feature, when x ij =x ik When, then [x] ij =x ik If 1 is true, then 0 is false; pri is a constant value, representing the label value Y in the dataset. ij The ratio of the sum of all items to the total number of accepted items;
[0044] The fitting unit is used to establish the mapping relationship between the feature values and the encoded values of the accepted project data, forming a supervised Catboost encoder.
[0045] The second encoding unit is used to input the execution-period project data into the supervised Catboost encoder to obtain the execution-period project data encoding value.
[0046] To address its technical problem, this application proposes a project overdue prediction system based on CatBoost and LightGBM algorithms in a third aspect, comprising a processor and a memory. The memory stores a computer program, which, when executed by the processor, implements the steps of the project overdue prediction method based on CatBoost and LightGBM algorithms as described above.
[0047] In order to solve its technical problem, this application proposes a computer-readable storage medium in a fourth aspect, which stores a computer program that, when executed by a processor, implements the steps of the project overdue prediction method based on the CatBoost and LightGBM algorithms as described above.
[0048] The project overdue prediction method, system, and computer-readable storage medium based on the CatBoost and LightGBM algorithms of this application have the following beneficial effects: The project overdue prediction method according to the embodiments of this application encodes project data using CatBoost and then uses the LightGBM algorithm for prediction, ultimately obtaining a prediction result of whether the project is overdue. The CatBoost algorithm can efficiently and reasonably process categorical features, and has certain advantages in enriching feature dimensions and overcoming gradient bias. The LightGBM algorithm has less memory consumption and good generalization performance. The data encoded by the CatBoost algorithm has the advantages of smoothness and low noise, which is more conducive to the model optimization of the LightGBM algorithm, improving the accuracy of project overdue prediction during the execution period, thereby improving the accuracy of project intervention and effectively reducing the risk of project overdue. Attached Figure Description
[0049] The present application will be further described below with reference to the accompanying drawings and embodiments. In the accompanying drawings:
[0050] Figure 1 This is a flowchart of a project overdue prediction method based on CatBoost and LightGBM algorithms according to an embodiment of this application;
[0051] Figure 2 This is a logical structure diagram of a project overdue prediction system based on CatBoost and LightGBM algorithms according to an embodiment of this application;
[0052] Figure 3 This is a logical structure diagram of the data preprocessing module in one embodiment of this application;
[0053] Figure 4 This is a logical structure diagram of the CatBoost encoding module in one embodiment of this application;
[0054] Figure 5 This is a logical structure diagram of a project overdue prediction system based on CatBoost and LightGBM algorithms, according to another embodiment of this application. Detailed Implementation
[0055] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application. Furthermore, the embodiments and features described herein can be combined with each other unless otherwise specified.
[0056] This application addresses the problem that existing science and technology program data is large in volume, complex in format, and has many missing values, leading to unreliable results for overdue predictions using existing machine learning or deep learning methods. It proposes a method based on combining CatBoost encoding and the LightGBM model to predict and identify whether science and technology program projects have the risk of being overdue.
[0057] Figure 1 A flowchart illustrating a project overdue prediction method 100 based on CatBoost and LightGBM algorithms according to an embodiment of this application is shown. Figure 1 As shown, the project overdue prediction method 100 based on CatBoost and LightGBM algorithms includes the following steps:
[0058] In step S110, historical project data is cleaned and integrated into two data tables: a first data table and a second data table. The first data table stores data of accepted projects, and the second data table stores data of projects in the execution phase.
[0059] In a specific implementation, step S110 may further include:
[0060] Step S111: Import historical project data.
[0061] Step S112: Filter out project data from historical project data where the "contract signing date" is less than the "contract end date".
[0062] Step S113: Delete columns in the filtered project data where the proportion of empty values exceeds a preset threshold. For example, columns with more than 80% empty values can be deleted.
[0063] Step S114 adds a "Whether Overdue" column to the filtered project data. Projects whose "Acceptance Date" does not exceed a predetermined period from the "Contract End Date" are set to the first column, and projects whose "Acceptance Date" exceeds a predetermined period from the "Contract End Date" are set to the second column. For example, in step S114, it can be determined whether the "Acceptance Date" exceeds the "Contract End Date" by six months. If it does not exceed six months, the "Whether Overdue" column is set to "0"; otherwise, the "Whether Overdue" column is set to "1". That is, 0 indicates that the project is not overdue, and 1 indicates that the project is overdue.
[0064] Step S115: Retain several features with relatively complete information from the project data, including but not limited to features such as "business type", "district where the unit is located", "registered capital of the unit", "amount of municipal financial subsidies", and "cumulative number of invention patent applications".
[0065] Step S116: Determine whether the "Acceptance Date" of the filtered project data is empty. Save the project data with a non-empty "Acceptance Date" to the first data table, and save the project data with an empty "Acceptance Date" to the second data table. The first data table stores the accepted project data, which is used as the training dataset, and the second data table stores the execution-phase project data, which is used as the test dataset.
[0066] Then, in step S120, method 100 uses the CatBoost algorithm to encode the accepted project data in the first data table and the execution project data in the second data table. Specifically, the accepted project data is first used as the training dataset to fit the CatBoost encoder, and then the execution project data is input into the CatBoost encoder for encoding.
[0067] CatBoost is an existing gradient boosting decision tree (GBDT) algorithm that uses a symmetric tree as a weak learner and employs GBDT for classification. Gradient boosting essentially constructs a weak learner by performing gradient descent in the feature space, and then iteratively weights and combines these weak learners in a locally optimal manner to construct a strong learner. In this embodiment, the accepted project dataset is set as {S={(X1,Y1),(X2,Y2),…,(X…}}. i ,Y i )}, where X i =(x i1 ,x i2 ,…,x im Y is an m-dimensional vector containing both numerical and categorical features, i.e., m items. i This is the label value, specifically the label value indicating whether the project is "overdue". Step S120 uses the accepted project data as the training dataset to fit the CatBoost encoder, and then inputs the execution-period project data into the CatBoost encoder for encoding. The specific process is as follows:
[0068] Step S121: Randomly sort the accepted project data input to the CatBoost encoder.
[0069] Step S122: Convert the floating-point value of the accepted project data into an integer.
[0070] Step S123: Convert the characteristics of the accepted project data into numerical elements according to the following calculation formula:
[0071]
[0072] Among them, Ctr ij x is the encoded value of the k-th item for the i-th feature in the accepted project data.ij For the value of the j-th item object with the i-th feature, x ik For the values of other item objects with the i-th feature, when x ij =x il When, then [x] ij =x xk If 1 is true, then 0 is false; pri is a constant value, representing the label value Y in the dataset. ij The ratio of the sum of all items to the total number of accepted items, i.e.:
[0073]
[0074] Step S124: Establish the mapping relationship between the feature values of the accepted project data S and the encoded value Ctr, forming a supervised Catboost encoder.
[0075] Step S125: Input the execution-period project data into the supervised Catboost encoder to obtain the execution-period project data encoding value.
[0076] Then, in step S130, method 100 standardizes the coded accepted project data and the execution-phase project data. Step S130 performs robust standardization operations on different characteristics of the project data. When the data contains many outliers, standardization using mean and variance scaling may not be a good choice; therefore, this application preferably uses the RobustScaler standardization method, which yields more robust estimates. RobustScaler is defined as:
[0077]
[0078] In the formula, X std For the standardized results, X represents the data that needs to be standardized. median is the median of the feature, and IQR is the interquartile range of the feature.
[0079] Then, in step S140, Method 100 uses the LightGBM (Light Gradient Boosting Machine) algorithm to input the standardized accepted project data into the LightGBM model and adjust the adjustable parameters of the model until the optimal prediction model for the "whether it is overdue" output variable is obtained.
[0080] LightGBM is an existing distributed gradient boosting framework based on decision tree algorithms. Compared to the classic XGBoost model, it consumes less memory and has better generalization performance. The level-wise leaf growth strategy in the XGBoost algorithm is inefficient because it treats leaves at the same level indiscriminately, incurring unnecessary overhead. LightGBM, on the other hand, uses a depth-constrained leaf-wise leaf growth strategy, splitting the leaves of the tree in the best-fit manner, rather than by depth or level. Therefore, for forecasting large and complex science and technology project data, the LightGBM algorithm offers faster training speed, lower memory consumption, and better accuracy.
[0081] In specific implementation, step S140 inputs the standardized accepted project data into the LightGBM model, and the output variable is "whether it is overdue". In step S140, the cv function of the LightGBM algorithm can be used to adjust the adjustable parameters of the LightGBM model until the optimal prediction model is obtained. The LightGBM `cv` function is used for parameter tuning. The specific steps are as follows: 1) Determine the basic parameters, including weak learner type, boosting_type, learning objective, evaluation metric, and learning rate, which are set to `gbdt`, `binary`, `auc`, and 0.1 respectively; 2) Tune the basic parameters of the decision tree, including `max_depth`, `num_leaves`, `min_data_in_leaf`, `max_bin in`, `feature_fraction`, `bagging_fraction`, and `bagging_freq`; 3) Tune the regularization parameters, determining the values of `lambda_l1` and `lambda_l2`; 4) Gradually decrease the learning rate to improve accuracy; 5) Finally, the optimal prediction model is determined by the highest value of AUC (Area Under Curve).
[0082] Then, in step S150, method 100 inputs the standardized execution period project data into the optimal prediction model obtained in step S140 to make a prediction and obtain a prediction result of whether the execution period project has exceeded its time limit.
[0083] Through experiments, simulations, and usage, this application demonstrates that inputting project data into the optimal model can achieve an accuracy of over 0.9 and an AUC of over 0.85 for determining whether a project is overdue.
[0084] Based on the project overdue prediction method 100 based on CatBoost and LightGBM algorithms described in the above embodiments, this application also proposes a project overdue prediction system based on CatBoost and LightGBM algorithms. Figure 2 A logical structure diagram of a project overdue prediction system 200 based on CatBoost and LightGBM algorithms according to an embodiment of this application is shown. Figure 2 As shown, the system 200 includes a data preprocessing module 210, a CatBoost encoding module 220, a standardization module 230, a LightGBM model training module 240, and a prediction module 250. The data preprocessing module 210 cleans and integrates historical project data, merging it into two data tables: a first data table and a second data table. The first data table stores accepted project data, and the second data table stores project data in the execution phase. The CatBoost encoding module 220 uses the CatBoost algorithm to encode the accepted project data in the first data table and the project data in the execution phase in the second data table. The CatBoost encoding module 220 first uses the accepted project data as a training dataset to fit the CatBoost encoder, and then inputs the project data in the execution phase into the CatBoost encoder for encoding. The standardization module 230 standardizes the encoded accepted project data and the project data in the execution phase. The LightGBM model training module 240 uses the LightGBM algorithm, inputting the standardized accepted project data into the LightGBM model, adjusting the adjustable parameters of the model until the optimal prediction model for the "whether it is overdue" output variable is obtained. The prediction module 250 is used to input the standardized execution period project data into the optimal prediction model for prediction, and obtain the prediction result of whether the execution period project has exceeded the deadline.
[0085] In specific embodiments, such as Figure 3As shown, the preprocessing module 210 further includes a filtering unit 211, a column deletion unit 212, a column addition unit 213, and a classification unit 214. The filtering unit 211 is used to filter project data from historical project data where the "contract signing date" is less than the "contract end date". The column deletion unit 212 is used to delete columns in the filtered project data where the proportion of empty values exceeds a preset threshold. The column addition unit 213 is used to add a "whether overdue" flag to the filtered project data, setting projects whose "acceptance date" does not exceed a predetermined period from the "contract end date" as the first flag value, and projects whose "acceptance date" exceeds a predetermined period from the "contract end date" as the second flag value. The classification unit 214 is used to determine whether the "acceptance date" of the filtered project data is empty, saving project data with non-empty "acceptance dates" to a first data table, and saving project data with empty "acceptance dates" to a second data table. The first data table stores the accepted project data, used as a training dataset, and the second data table stores the execution-period project data, used as a test dataset.
[0086] In specific embodiments, such as Figure 4 As shown, the CatBoost encoding module 220 further includes a random sorting unit 221, a label value conversion unit 222, a first encoding unit 223, a fitting unit 224, and a second encoding unit 225. The random sorting unit 221 is used to randomly sort the accepted project data input to the CatBoost encoder. The label value conversion unit 222 is used to convert the floating-point label values of the accepted project data into integers. The first encoding unit 223 is used to convert each feature of the accepted project data into numerical elements according to the following calculation formula:
[0087]
[0088] Among them, Ctr ij x is the encoded value of the j-th item for the i-th feature in the accepted project data. ij For the value of the j-th item object with the i-th feature, x ik For the values of other item objects with the i-th feature, when x ij =x ik When, then [x] ij =x ik If 1 is true, then 0 is false; pri is a constant value, representing the label value Y in the dataset. ij The ratio of the sum of all items to the total number of accepted items, i.e.:
[0089]
[0090] Fitting unit 224 is used to establish a mapping relationship between the feature values of the accepted project data S and the encoded value Ctr, forming a supervised Catboost encoder. Second encoding unit 225 is used to input the execution-period project data into the supervised Catboost encoder to obtain the execution-period project data encoded value.
[0091] The project overdue prediction system 200 based on the CatBoost and LightGBM algorithm according to the above embodiments of this application is used to implement the aforementioned project overdue prediction method based on the CatBoost and LightGBM algorithm. For further specific implementation of the various modules of the project overdue prediction system 200 based on the CatBoost and LightGBM algorithm, please refer to the foregoing detailed description of the various steps of the project overdue prediction method 100 based on the CatBoost and LightGBM algorithm.
[0092] Based on the project overdue prediction method 100 based on CatBoost and LightGBM algorithms in the foregoing embodiments of this application, this application also proposes a project overdue prediction system 300 based on CatBoost and LightGBM algorithms. See also Figure 5 As shown, the project overdue prediction system 300 based on the CatBoost and LightGBM algorithms includes a processor 310 and a memory 320, which are communicatively connected. The memory 300 stores a computer program, which, when executed by the processor 310, causes the processor 310 to implement the steps of the project overdue prediction method 100 based on the CatBoost and LightGBM algorithms of the foregoing embodiments of this application.
[0093] Processor 310 can be a Central Processing Unit (CPU). Processor 310 can also be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or combinations of the above types of chips. The general-purpose processor can be a microprocessor or any conventional processor.
[0094] The memory 320, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs, non-transitory computer-executable programs, and modules, such as the program instructions / modules corresponding to the project overdue prediction method based on the CatBoost and LightGBM algorithms in this embodiment of the invention. The processor 310 executes various server functions and data processing by running the non-transitory software programs, instructions, and modules stored in the memory 320, thereby implementing the project overdue prediction method based on the CatBoost and LightGBM algorithms in the aforementioned embodiment.
[0095] Memory 320 may include a program storage area and a data storage area. The program storage area may store the operating system and applications required for at least one function. The data storage area may store data created using a project overdue prediction method based on CatBoost and LightGBM algorithms. Furthermore, memory 320 may include high-speed random access memory and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, memory 320 may optionally include memory remotely located relative to processor 310, which can be connected to processor 310 via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
[0096] This application also proposes a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the project overdue prediction method 100 based on the CatBoost and LightGBM algorithms described in the foregoing embodiments of this application. The computer-readable storage medium may be a magnetic disk, optical disk, read-only memory (ROM), random access memory (RAM), flash memory, hard disk drive (HDD), or solid-state drive (SSD), etc. The computer-readable storage medium may also include combinations of the above types of memory.
[0097] The above description is merely a preferred embodiment of this application and is not intended to limit this application. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this application should be included within the protection scope of this application.
Claims
1. A method for predicting project overdue dates based on CatBoost and LightGBM algorithms, characterized in that, The method includes the following steps: S1. After cleaning and integrating the historical project data, merge it into two data tables, the first data table and the second data table, and store them. The first data table stores the data of accepted projects, and the second data table stores the data of projects in the execution period. S2. Use the CatBoost algorithm to encode the accepted project data in the first data table and the execution project data in the second data table. First, use the accepted project data as the training dataset to fit the CatBoost encoder, and then input the execution project data into the CatBoost encoder for encoding. S3. Standardize the coded data of accepted projects and the data of projects in the execution phase; S4. Using the LightGBM algorithm, input the standardized accepted project data into the LightGBM model, adjust the adjustable parameters of the model until the optimal prediction model for the "whether it is overdue" output variable is obtained. S5. Input the standardized execution period project data into the optimal prediction model for prediction to obtain the prediction result of whether the execution period project has exceeded the time limit; Step S1 further includes: S11. Filter out project data from historical project data where the "contract signing date" is less than the "contract end date"; S12. Delete columns in the filtered project data where the proportion of empty values exceeds a preset threshold; S13. Add a "whether it is overdue" label to the filtered project data, set the project with "acceptance date" not exceeding a predetermined time from "contract end date" as the first label, and set the project with "acceptance date" exceeding a predetermined time from "contract end date" as the second label; S14. Determine whether the "acceptance date" of the filtered project data is empty. Save the project data with a non-empty "acceptance date" to the first data table and save the project data with an empty "acceptance date" to the second data table. Step S2, which first uses accepted project data as a training dataset to fit the CatBoost encoder, and then inputs the execution-period project data into the CatBoost encoder for encoding, further includes: S21. Randomly sort the accepted project data input into the CatBoost encoder; S22. Convert the floating-point values of the accepted project data to integers; S23. Convert the characteristics of the accepted project data into numerical elements according to the following calculation formula: in, For the first i The first feature j Each project object value, For the first i Other item object values for each feature, when At that time, then [ If the value is 1, then the value is 0; otherwise, the value is 0. These are constant values; they are the labeled values in the dataset. The sum of the total number of projects accepted The ratio; S24. Establish the mapping relationship between the feature values and the encoded values of the accepted project data to form a supervised Catboost encoder; S25. Input the execution period project data into the supervised Catboost encoder to obtain the execution period project data encoding value.
2. The method according to claim 1, characterized in that, In step S3, the RobustScaler standardization method is used to standardize the coded accepted project data and the project data in the execution phase.
3. The method according to claim 1, characterized in that, In step S4, the cv function of the LightGBM algorithm is used to adjust the adjustable parameters, and finally the optimal prediction model is determined by the highest AUC value.
4. A project overdue prediction system based on CatBoost and LightGBM algorithms, characterized in that, The system includes: The data preprocessing module is used to clean and integrate historical project data and then merge it into two data tables, the first data table and the second data table, for storage. The first data table stores data of accepted projects, and the second data table stores data of projects in the execution phase. The CatBoost encoding module is used to encode the accepted project data in the first data table and the execution project data in the second data table using the CatBoost algorithm. The accepted project data is first used as the training dataset to fit the CatBoost encoder, and then the execution project data is input into the CatBoost encoder for encoding. The standardization processing module is used to standardize the coded accepted project data and the project data in the execution phase. The LightGBM model training module is used to input standardized accepted project data into the LightGBM model using the LightGBM algorithm, and adjust the adjustable parameters of the model until the optimal prediction model for the "whether it is overdue" output variable is obtained. The prediction module is used to input the standardized execution period project data into the optimal prediction model for prediction, and obtain the prediction result of whether the execution period project has exceeded the time limit; The preprocessing module further includes: The filtering unit is used to filter project data from historical project data to find projects whose "contract signing date" is less than the "contract end date"; The column deletion unit is used to delete columns in the filtered project data where the proportion of empty values exceeds a preset threshold. The column addition unit is used to add a "whether it is overdue" flag value to the filtered project data. Projects whose "acceptance date" does not exceed a predetermined period of the "contract end date" are set as the first flag value, and projects whose "acceptance date" exceeds a predetermined period of the "contract end date" are set as the second flag value. The classification unit is used to determine whether the "acceptance date" of the filtered project data is empty, and to save the project data with a non-empty "acceptance date" to the first data table, and to save the project data with an empty "acceptance date" to the second data table; The CatBoost encoding module further includes: The random sorting unit is used to randomly sort the accepted project data input to the CatBoost encoder; The tag value conversion unit is used to convert the floating-point tag values of accepted project data into integers; The first coding unit is used to convert the characteristics of the accepted project data into numerical elements according to the following calculation formula: in, For the first i The first feature j Each project object value, For the first i Other item object values for each feature, when At that time, then [ If the value is 1, then the value is 0; otherwise, the value is 0. These are constant values; they are the labeled values in the dataset. The sum of the total number of projects accepted The ratio; The fitting unit is used to establish the mapping relationship between the feature values and the encoded values of the accepted project data, forming a supervised Catboost encoder. The second encoding unit is used to input the execution-period project data into the supervised Catboost encoder to obtain the execution-period project data encoding value.
5. A project overdue prediction system based on CatBoost and LightGBM algorithms, characterized in that, It includes a processor and a memory, the memory storing a computer program that, when executed by the processor, implements the steps of the project overdue prediction method based on the CatBoost and LightGBM algorithms as described in any one of claims 1-3.
6. A computer-readable storage medium, characterized in that, The system contains a computer program that, when executed by a processor, implements the steps of the project overdue prediction method based on the CatBoost and LightGBM algorithms as described in any one of claims 1-3.
Citation Information
Patent Citations
Method and device for predicting user fraudulent behaviors
CN113781056A