A method and system for predicting the degree of overtime for a municipal maintenance worker
By performing specific coding, normalization, and data balancing on municipal maintenance work order data, a gradient boosting tree model was established. This solved the problems of accuracy in predicting timeout levels and sample imbalance in the municipal maintenance management system, enabling accurate prediction of work order timeout levels and efficient resource allocation.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- COSCO SHIPPING TECH CO LTD
- Filing Date
- 2023-10-12
- Publication Date
- 2026-07-24
AI Technical Summary
The existing municipal maintenance management system cannot accurately identify the degree of timeout for a small number of overdue work orders, cannot screen out the important factors affecting work order timeouts, has low prediction accuracy, and is severely affected by sample imbalance.
A specific encoding method is used to process municipal maintenance work order data. The data is balanced by normalization and SMOTE+Tomeklinks method. A gradient boosting tree model is established, and the optimal gradient boosting tree model is finally obtained for prediction by parameter tuning and learning curve verification through Bayesian optimization algorithm.
It enables accurate prediction of timeout levels even under imbalanced sample conditions, improves work order processing efficiency, and allows for timely adjustment of resource allocation and rational planning of resource distribution.
Smart Images

Figure CN117236932B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of municipal maintenance technology, specifically to a method and system for predicting the degree of overdue municipal maintenance work orders. Background Technology
[0002] Traditional urban municipal maintenance management systems typically analyze historical work orders based on statistical indicators such as work order category and work order completion time, without delving into in-depth analysis of work order processing delays or predicting the degree of delay for different work orders. Work order data records the complete business process of identifying, dispatching, handling, and responding to maintenance issues. In-depth analysis of historical work order data is crucial for developing municipal maintenance plans, adjusting resource allocation, and rationally allocating funds. Researching work order delay prediction essentially involves classifying maintenance work orders that fail to be completed within the stipulated time due to different reasons, and machine learning theory is an effective tool for solving classification or prediction problems. Machine learning technology can effectively learn the distribution patterns of data from large-sample, multi-dimensional data, thereby achieving relatively ideal prediction results. Regarding the imbalance of categories in work order delay prediction, directly modeling the problem often leads to the model learning prior information about the proportion of different categories in the training samples, resulting in a classification bias towards the majority category and inaccurate predictions. In municipal maintenance management systems, although only a minority of work orders may exceed the time limit, the importance of accurate classification is self-evident. For maintenance work teams, predicting work order overtime is not only about judging whether it is overdue, but more importantly, about making a reasonable estimate of the degree of overtime, so as to provide decision support for the allocation of maintenance resources.
[0003] Existing municipal maintenance management systems primarily analyze historical work order data using statistical indicators such as work order type and operation duration. Very few applications delve into the deeper reasons for work order delays, making it impossible to predict the degree of delay based on different operational conditions. Furthermore, due to professional characteristics and seasonal factors, municipal maintenance work orders often exhibit sample imbalance across different rectification issues. This is particularly evident in predicting work order delays. In normal maintenance operations, overdue work orders clearly represent a very small proportion of the total number of completed work orders. Using the entire sample for analysis leads to significant deviations in the prediction model's accuracy, making the model more prone to bias towards categories with larger sample sizes, thus favoring predictions of no delays. Summary of the Invention
[0004] To address the problems of existing municipal maintenance management systems, such as the inability to accurately identify the timeout level of a small number of overdue work orders, the inability to screen out key factors affecting work order timeouts, and low prediction accuracy, this invention provides a method for predicting the timeout level of municipal maintenance work orders. Based on municipal maintenance work order data, a specific encoding method is used for encoding. Then, a normalization method, the SMOTE+Tomeklinks method, a Bayesian optimization algorithm, and learning curves are used in combination to obtain an optimal gradient boosting tree model, thereby predicting the timeout level of municipal maintenance work orders and effectively improving the efficiency of work order processing. This invention also relates to a municipal maintenance work order timeout level prediction system.
[0005] The technical solution of the present invention is as follows:
[0006] A method for predicting the timeout level of municipal maintenance work orders, characterized by the following steps:
[0007] Data acquisition steps: Acquire municipal maintenance work order data, and based on the actual characteristics of the municipal maintenance work orders, divide the discrete feature data in the municipal maintenance work order data into categorical data and ordinal data;
[0008] Data encoding steps: Encode the ordered type data with labels, and compare the number of values of the categorized type data with a preset number threshold. When the number of values of the categorized type data is less than or equal to the preset number threshold, perform one-hot encoding on the categorized type data. When the number of values of the categorized type data is greater than the preset number threshold, perform leave-one-out encoding on the categorized type data.
[0009] Feature normalization and balancing steps: Normalize the continuous feature data in the municipal maintenance work order data, and use the normalized data, as well as the encoded categorical and ordinal data, as training set samples. Then, use the SMOTE+Tomeklinks method to balance the data in the training set samples to obtain balanced training set samples.
[0010] The optimal model establishment and timeout prediction steps are as follows: a gradient boosting tree model is established by training the balanced training set samples, and the parameters of the gradient boosting tree model are tuned using the Bayesian optimization algorithm to obtain the parameter-tuned gradient boosting tree model. The generalization performance of the parameter-tuned gradient boosting tree model is then tested using the learning curve. The gradient boosting tree model that passes the generalization performance test is taken as the optimal gradient boosting tree model, and the timeout degree of municipal maintenance work orders is predicted based on the optimal gradient boosting tree model.
[0011] Preferably, in the data acquisition step, the municipal maintenance work order data includes work order ID, name of the inspected object, location, maintenance unit, inspector, category of problem to be rectified, work order generation time, work order completion time, maintenance level, on-time rectification, season, work order type, rectification type, street / township to which the object belongs, inspection unit, and work team.
[0012] Preferably, the feature normalization and equalization processing step, which involves normalizing the continuous feature data in the municipal maintenance work order data, includes:
[0013] Determine whether there are outliers in the continuous feature data of municipal maintenance work orders. If outliers exist, perform zero-mean normalization on the continuous feature data. If no outliers exist, perform linear function normalization on the continuous feature data.
[0014] Preferably, in the feature normalization and equalization processing step, the data equalization processing of the training set samples using the SMOTE+Tomeklinks method includes:
[0015] S1: Calculate the k closest samples to the minority class samples in the training set;
[0016] S2: Select n samples from the calculated k samples and perform linear interpolation to construct new samples;
[0017] S3: Add the new samples to the training set to obtain the expanded training set samples, and remove the overlapping data pairs in the expanded training set samples.
[0018] Preferably, in the optimal model establishment and timeout prediction step, after obtaining the optimal gradient boosting tree model, the evaluation index of the Macro-average method is used to evaluate the optimal gradient boosting tree model and verify that the optimal gradient boosting tree model is the optimal model.
[0019] A system for predicting the timeout level of municipal maintenance work orders, characterized in that it includes a data acquisition module, a data encoding module, a feature normalization and equalization processing module, and an optimal model establishment and timeout prediction module connected in sequence.
[0020] The data acquisition module acquires municipal maintenance work order data and, based on the actual characteristics of the municipal maintenance work orders, divides the discrete feature data in the municipal maintenance work order data into categorical data and ordinal data.
[0021] The data encoding module encodes ordered type data using labels and compares the number of values of the categorized type data with a preset number threshold. When the number of values of the categorized type data is less than or equal to the preset number threshold, the categorized type data is one-hot encoded. When the number of values of the categorized type data is greater than the preset number threshold, the categorized type data is left-one-out encoded.
[0022] The feature normalization and balancing module normalizes the continuous feature data in the municipal maintenance work order data, and uses the normalized data, as well as the encoded categorical and ordinal data, as training set samples. Then, the SMOTE+Tomeklinks method is used to balance the data in the training set samples to obtain balanced training set samples.
[0023] The optimal model establishment and timeout prediction module trains a gradient boosting tree model on the balanced training set samples, and uses a Bayesian optimization algorithm to tune the parameters of the gradient boosting tree model to obtain the tuned gradient boosting tree model. Then, the learning curve is used to test the generalization performance of the tuned gradient boosting tree model. The gradient boosting tree model that passes the generalization performance test is taken as the optimal gradient boosting tree model, and the timeout degree of municipal maintenance work orders is predicted based on the optimal gradient boosting tree model.
[0024] Preferably, the municipal maintenance work order data includes work order ID, name of the inspected object, location, maintenance unit, inspector, category of problem to be rectified, work order generation time, work order completion time, maintenance level, timely rectification, season, work order type, rectification type, street / township to which the object belongs, inspection unit, and work team.
[0025] Preferably, the feature normalization and equalization processing module performs normalization processing on the continuous feature data in the municipal maintenance work order data, including:
[0026] Determine whether there are outliers in the continuous feature data of municipal maintenance work orders. If outliers exist, perform zero-mean normalization on the continuous feature data. If no outliers exist, perform linear function normalization on the continuous feature data.
[0027] Preferably, in the feature normalization and equalization processing module, the data equalization processing of the training set samples using the SMOTE+Tomeklinks method includes:
[0028] S1: Calculate the k closest samples to the minority class samples in the training set;
[0029] S2: Select n samples from the calculated k samples and perform linear interpolation to construct new samples;
[0030] S3: Add the new samples to the training set to obtain the expanded training set samples, and remove the overlapping data pairs in the expanded training set samples.
[0031] Preferably, in the optimal model establishment and timeout prediction module, after obtaining the optimal gradient boosting tree model, the evaluation index of the Macro-average method is used to evaluate the optimal gradient boosting tree model and verify that the optimal gradient boosting tree model is the optimal model.
[0032] The beneficial effects of this invention are as follows:
[0033] This invention provides a method for predicting the timeout level of municipal maintenance work orders. Based on municipal maintenance work order data, the discrete feature data in the data is divided into categorical and ordinal data. The categorical and ordinal data are then encoded to transform the discrete features into numerical features. Ordinal data is coded using labels, and the number of values in the categorical data is compared with a preset threshold. When the number of values in the categorical data is less than or equal to the preset threshold, one-hot encoding is performed. When the number of values in the categorical data is greater than the preset threshold, leave-one-out encoding is performed. Leave-one-out encoding effectively reduces the dimensionality and sparsity of the dataset, solves the dependence on the diversity of dependent variable values, reduces the impact of outliers, and creates more diverse encoded values, thereby improving the correlation between categorical and target variables. Then, the continuous feature data in the municipal maintenance work order data is normalized, and different specifications or... Data from different distributions are transformed to the same specification or a specific distribution to improve the stability and accuracy of subsequent modeling. Normalized data, along with encoded categorical and ordinal data, are used as training set samples. The SMOTE+Tomeklinks method is then used to balance the data in the training set samples, resulting in a balanced training set sample to balance the proportion of samples from different categories. Finally, a gradient boosting tree model (also known as a multi-class model) is built by training the balanced training set samples. Bayesian optimization is used to tune the parameters of the gradient boosting tree model, effectively increasing the tuning speed and reducing dimensionality explosion. Learning curves are then used to test the generalization performance of the tuned gradient boosting tree model, ensuring that the model does not exhibit underfitting or overfitting. The gradient boosting tree model that passes the generalization performance test is then used as the optimal gradient boosting tree model, and the timeout level of municipal maintenance work orders is predicted based on the optimal gradient boosting tree model. This invention relates to urban municipal maintenance and operation data analysis, specifically a method for predicting work overtime levels under conditions of imbalanced historical work order sample distribution. It improves the original training data at the data level by employing specific methods to accurately identify the overtime levels of a small number of overdue work orders and addresses the sample imbalance problem at the data level, thereby enhancing the model's predictive ability and fundamentally improving the prediction accuracy for a minority of categories. Furthermore, this invention can rank the features output by the multi-classification model based on their importance, filtering out key factors affecting work order overtime, and enabling a tiered prediction of work order overtime levels. This allows for further classification of overdue work orders and provides appropriate pre-warnings for work orders with different overtime levels, facilitating timely adjustments to the allocation of personnel, materials, and equipment.The invention can be mainly applied to the information management system of municipal maintenance units to achieve the goal of providing advance reminders for work orders with different levels of overdue time and assisting maintenance personnel in allocating resources. It can accurately and efficiently determine the potential overdue level of work orders to be processed during the order dispatch stage, provide advance warnings for work orders with different levels of overdue time, realize the function of advance reminders, help rationally plan and allocate resources under the municipal maintenance model, and effectively improve the efficiency of work order processing.
[0034] This invention also relates to a municipal maintenance work order timeout prediction system. This system corresponds to the aforementioned municipal maintenance work order timeout prediction method and can be understood as a system that implements the aforementioned method. It includes a data acquisition module, a data encoding module, a feature normalization and equalization processing module, and an optimal model establishment and timeout prediction module connected sequentially. These modules work collaboratively, encoding municipal maintenance work order data using a specific encoding method. They then employ normalization methods, SMOTE+Tomeklinks methods, Bayesian optimization algorithms, and learning curves to collaboratively obtain an optimal gradient boosting tree model, thereby predicting the timeout level of municipal maintenance work orders. For municipal maintenance systems, this system aims to accelerate work order processing efficiency and rationally allocate resources during maintenance operations. It designs an optimal gradient boosting tree model—a work order timeout prediction model under the municipal maintenance model—to provide pre-timeout reminders for work orders before dispatching them. This helps municipal maintenance companies manage municipal maintenance operations within their region, optimize management efficiency, improve service levels, and effectively increase work order processing efficiency. Attached Figure Description
[0035] Figure 1 This is a preferred flowchart of the method for predicting the timeout level of municipal maintenance work orders according to the present invention. Detailed Implementation
[0036] The present invention will now be described with reference to the accompanying drawings.
[0037] This invention relates to a method for predicting the timeout level of municipal maintenance work orders, and a preferred flowchart of the method is shown below. Figure 1 As shown, the steps are as follows:
[0038] 1. Data Acquisition Steps: First, acquire municipal maintenance work order data. Based on the actual characteristics of these work orders, classify the discrete features into categorical and ordinal data. The main fields typically included in municipal maintenance work order data are: Work Order ID, Inspection Object Name, Location, Maintenance Unit, Inspector, Category of Issues to be Rectified, Work Order Generation Time, Work Order Completion Time, Maintenance Level, Timely Rectification, Season, Work Order Type, Rectification Type, Subdistrict / Township of the Object, Inspection Unit, and Work Team.
[0039] 2. Data encoding steps: Encode the ordered type data using labels, and compare the number of values of the categorized type data with a preset number threshold. When the number of values of the categorized type data is less than or equal to the preset number threshold, perform one-hot encoding on the categorized type data. When the number of values of the categorized type data is greater than the preset number threshold, perform leave-one-out encoding on the categorized type data.
[0040] Specifically, for most models, discrete features need to be converted into numerical features to be processed correctly by the model. However, machine learning models only accept numerical feature inputs and do not directly support categorical feature inputs. Therefore, it is necessary to perform feature encoding on the data based on the actual characteristics of the work order field before building the model. For ordinal data, labels are used for encoding. Although ordinal data also belongs to classification, it has sorting logic. Therefore, labels are chosen to encode the maintenance level, timely rectification, and overdue degree. Here, we mainly focus on the encoding of the overdue degree. The overdue degree is defined as (actual handling time - prescribed handling time limit) / prescribed handling time limit. When the overdue degree = 0, the code is 0; when 0 < overdue degree ≤ 1, the code is 1; when 1 < overdue degree ≤ 2, the code is 2; and when the overdue degree > 2, the code is 3.
[0041] For categorical data that doesn't involve sorting, since there's no logical relationship between them, fields like season and work order type are encoded using one-hot encoding. However, one-hot encoding can cause the curse of dimensionality and sparsity issues when handling high-cardinality categorical features. To address this, leave-one-out encoding is used to reduce the dimensionality and sparsity of the dataset. Leave-one-out encoding, by encoding the mean of each value in the categorical variable, not only more accurately captures the relationship between the categorical and target variables but also improves the overfitting problem that target encoding might cause. Leave-one-out encoding is a further improvement on target encoding, using other similar target values besides the target value in that row to calculate, resolving the dependence on the diversity of dependent variable values. This method can reduce the impact of outliers and create more diverse encoded values, thereby improving the correlation between the categorical and target variables. Exploratory analysis of work order data revealed that some categorical features have dozens or even hundreds of possible values; therefore, leave-one-out encoding was chosen for rectification type, the street / township to which the object belongs, the inspection unit, and the work team. In summary, for municipal maintenance work order data, categorized data is purely categorized without any sorting logic. When the number of values for a categorized data type is small (5 or fewer), one-hot encoding is used. When the number of values for a categorized data type is large (more than 5), leave-one-out encoding is used. For ordinal data, because it has sorting logic, label encoding is used.
[0042] 3. Feature normalization and balancing steps: Normalize the continuous feature data in the municipal maintenance work order data, and use the normalized data, as well as the encoded categorical and ordinal data, as training set samples. Then, use the SMOTE+Tomeklinks method to balance the data in the training set samples to obtain balanced training set samples.
[0043] Specifically, applying machine learning classification methods requires transforming data of different specifications or distributions to the same specification or a specific distribution, i.e., "dimensionless" data processing. Dimensionless processing can compensate for the influence of different variable dimensions, making the contribution weights of each variable to the objective function more equitable, thereby improving the stability and accuracy of the model. Commonly used methods include linear function normalization and zero-mean normalization.
[0044] Linear function normalization: Linear function normalization maps data to the range [0,1] through linear transformation, and is a method of dimensionless transformation. The formula for linear function normalization is as follows:
[0045]
[0046] In the above formula, x represents the original feature, max(x) is the maximum value of the original feature, and min(x) is the minimum value of the original feature. * These are the features after linear normalization.
[0047] Zero-mean normalization: Zero-mean normalization is a method that maps raw data to a distribution with zero mean and a standard deviation of 1. Normalization is performed by calculating the mean μ and standard deviation σ of the original features. Zero-mean normalization formula:
[0048]
[0049] In the above formula, x represents the original feature, μ is the mean, σ is the standard deviation, and x * These are the features after linear normalization.
[0050] Because linear function normalization is highly sensitive to outliers, zero-mean normalization is chosen when outliers are present. In other words, zero-mean normalization is more robust to outliers than linear normalization. Therefore, zero-mean normalization is used for continuous feature data in municipal maintenance work order data when outliers exist, and min-max normalization is used when no outliers are present.
[0051] Furthermore, due to the significant imbalance between the proportion of overdue and non-overdue work orders in the municipal maintenance work order data, the processing time of work orders is unbalanced, meaning that the vast majority of work orders are completed within the stipulated time. Without balancing this data, the model might learn prior information about the sample ratio differences in the training space, leading to bias towards the majority class in actual predictions. The vast majority of municipal maintenance work order data consists of work orders that are not overdue, with only a very small number exceeding the time limit, and the data for different overdue levels is also imbalanced. Under these circumstances, the model will be more inclined to predict work orders as not overdue. First, the test and training sets are divided. The training set data is then resampled using SMOTE+Tomeklinks to balance the sample ratios of different classes. For balanced datasets, there are typically three methods at the data level: undersampling, oversampling, and combined sampling. Combined sampling involves first oversampling the minority class samples, then removing some of the noise data generated by the oversampling, ultimately increasing the number of minority class samples while reducing the bias introduced by the increased sample size.
[0052] The normalized data, along with the encoded categorical and ordinal data, are divided into training and test sets. For imbalanced data in the training set, the SMOTE+Tomek links method is used for comprehensive sampling to obtain a balanced training set. This method uses minority class samples to artificially synthesize new samples, which are then added to the sample set. Noisy data in the expanded dataset is then removed. The specific steps are as follows:
[0053] S1: Calculate the k closest samples to the minority class samples in the training set;
[0054] S2: Select n samples from the calculated k samples and perform linear interpolation to construct new samples;
[0055] S3: Add the new samples to the training set to obtain the expanded training set samples, and remove the Tomek links in the expanded training set samples, that is, remove the overlapping data pairs (i.e., noisy data) in the expanded training set samples.
[0056] It should be noted that steps S1 and S2 above use oversampling (i.e., the somte method) to increase the sample size of the minority class, and step S3 deletes overlapping samples of different classes.
[0057] 4. Optimal Model Establishment and Timeout Prediction Steps: Train the balanced training set samples to establish a gradient boosting tree model (also known as a multi-classification model), and use the Bayesian optimization algorithm to tune the parameters of the gradient boosting tree model to obtain the tuned gradient boosting tree model. Then, use the learning curve to test the generalization performance of the tuned gradient boosting tree model. The gradient boosting tree model that passes the generalization performance test is taken as the optimal gradient boosting tree model, and the timeout degree of municipal maintenance work orders is predicted based on the optimal gradient boosting tree model.
[0058] Specifically, a gradient boosting tree model is first established by training the balanced training set samples, and various evaluation metrics of the model are output. Since the grid search method is slow for parameter tuning and is prone to dimensionality explosion when there are many parameters, the Bayesian optimization algorithm is used to tune the gradient boosting tree model to obtain the tuned gradient boosting tree model. The Bayesian optimization algorithm uses a Gaussian process for parameter tuning, which considers previous parameter information and continuously updates prior information. The number of iterations is small, the parameter tuning speed is fast, and it can effectively reduce the dimensionality explosion caused by a large number of parameters.
[0059] After obtaining the hyperparameter-tuned gradient boosting tree model, it is necessary to determine whether the model is overfitting. Therefore, the generalization ability of the model needs to be tested using a learning curve. The horizontal axis of the learning curve represents the number of samples, and the vertical axis represents the AUC value of the model on the training set and the test set, respectively. It can be seen that the model's score changes and differences on training and test sets of different sizes are as follows: as the sample size increases, the model gradually converges, indicating that the model has better generalization ability and that there is no underfitting or overfitting.
[0060] Finally, the gradient boosting tree model that passed the generalization performance test is selected as the optimal gradient boosting tree model, and the timeout level of municipal maintenance work orders is predicted based on this model. For example, when a new work order is generated, the timeout level of the work order is predicted according to the optimal gradient boosting tree model, and the timeout level is output and an early warning is issued. This ability to provide early warnings for work orders with different levels of timeout helps to rationally plan and allocate resources under the municipal maintenance model, thereby improving the efficiency of timely work order processing.
[0061] Furthermore, after obtaining the optimal gradient boosting tree model, the Macro-average method was used to evaluate it, verifying that the optimal gradient boosting tree model is indeed the best model. The Macro-average method directly sums the evaluation metrics (Precision / Recall / F1-score) of different categories and averages them, giving all categories the same weight. This method treats each category equally. Other existing methods, such as the Weighted-average method, determine the weights based on the true distribution ratio of each category, multiplying each category by its weight before summing. While this method considers class imbalance, its value is more susceptible to the influence of common classes. Since the problem of predicting timeout levels tends to eliminate the differences in the proportion of evaluation metrics between different categories, the Macro-average method was chosen as the evaluation metric.
[0062] The present invention provides a method for predicting the timeout level of municipal maintenance work orders. When a new work order is generated, the characteristics of the work order are first encoded according to the encoding rules of the above model. Then, a multi-classification model that has been tuned by Bayesian optimization algorithm and passed the generalization performance test is used to predict the timeout level of the work order, and finally the timeout level is output.
[0063] This invention also relates to a municipal maintenance work order overtime prediction system. This system corresponds to the aforementioned municipal maintenance work order overtime prediction method and can be understood as a system implementing the above method. It includes a data acquisition module, a data encoding module, a feature normalization and equalization processing module, and an optimal model establishment and overtime prediction module connected in sequence. Specifically,
[0064] The data acquisition module acquires municipal maintenance work order data and, based on the actual characteristics of the municipal maintenance work orders, divides the discrete feature data in the municipal maintenance work order data into categorical data and ordinal data.
[0065] The data encoding module encodes ordered type data using labels and compares the number of values of the categorized type data with a preset number threshold. When the number of values of the categorized type data is less than or equal to the preset number threshold, the categorized type data is one-hot encoded. When the number of values of the categorized type data is greater than the preset number threshold, the categorized type data is left-one-out encoded.
[0066] The feature normalization and balancing module normalizes the continuous feature data in the municipal maintenance work order data, and uses the normalized data, as well as the encoded categorical and ordinal data, as training set samples. Then, the SMOTE+Tomeklinks method is used to balance the data in the training set samples to obtain balanced training set samples.
[0067] The optimal model establishment and timeout prediction module trains a gradient boosting tree model on the balanced training set samples, and uses a Bayesian optimization algorithm to tune the parameters of the gradient boosting tree model to obtain the tuned gradient boosting tree model. Then, the learning curve is used to test the generalization performance of the tuned gradient boosting tree model. The gradient boosting tree model that passes the generalization performance test is taken as the optimal gradient boosting tree model, and the timeout degree of municipal maintenance work orders is predicted based on the optimal gradient boosting tree model.
[0068] Preferably, the municipal maintenance work order data includes the work order ID, name of the inspected object, location, maintenance unit, inspector, category of problem to be rectified, work order generation time, work order completion time, maintenance level, on-time rectification, season, work order type, rectification type, street / township to which the object belongs, inspection unit, and work team.
[0069] Preferably, in the feature normalization and equalization processing module, the normalization processing of continuous feature data in the municipal maintenance work order data includes:
[0070] Determine whether there are outliers in the continuous feature data of municipal maintenance work orders. If outliers exist, perform zero-mean normalization on the continuous feature data. If no outliers exist, perform linear function normalization on the continuous feature data.
[0071] Preferably, in the feature normalization and data balancing module, the SMOTE+Tomeklinks method is used to perform data balancing on the training set samples, including:
[0072] S1: Calculate the k closest samples to the minority class samples in the training set;
[0073] S2: Select n samples from the calculated k samples and perform linear interpolation to construct new samples;
[0074] S3: Add the new samples to the training set to obtain the expanded training set samples, and remove the overlapping data pairs in the expanded training set samples.
[0075] Preferably, in the optimal model establishment and timeout prediction module, after obtaining the optimal gradient boosting tree model, the evaluation index of the Macro-average method is used to evaluate the optimal gradient boosting tree model and verify that the optimal gradient boosting tree model is the optimal model.
[0076] This invention provides an objective and scientific method and system for predicting the timeout level of municipal maintenance work orders. Based on historical data of municipal maintenance work orders, a specific encoding method is used for encoding, and machine learning theory is introduced. Normalization method, SMOTE+Tomeklinks method, Bayesian optimization algorithm and learning curve are used in combination to obtain the optimal gradient boosting tree model, thereby predicting the timeout level of municipal maintenance work orders. Even in the case of imbalanced samples, it can predict work orders with different degrees of timeout relatively accurately, scientifically formulate municipal maintenance plans, and adjust resource allocation in a timely manner, effectively improving the efficiency of work order processing.
[0077] It should be noted that the specific embodiments described above enable those skilled in the art to more fully understand the present invention, but do not limit the present invention in any way. Therefore, although the present invention has been described in detail with reference to the accompanying drawings and embodiments, those skilled in the art should understand that modifications or equivalent substitutions can still be made to the present invention. In short, all technical solutions and improvements that do not depart from the spirit and scope of the present invention should be covered within the protection scope of the present invention patent.
Claims
1. A method for predicting the degree of overdue municipal maintenance work orders, characterized in that, Includes the following steps: Data acquisition steps: Acquire municipal maintenance work order data, and based on the actual characteristics of the municipal maintenance work orders, divide the discrete feature data in the municipal maintenance work order data into categorical data and ordinal data; Data encoding steps: Ordinal type data is coded using labels, including encoding of timeout level. The timeout level = (actual processing time - prescribed processing time limit) / prescribed processing time limit. When timeout level = 0, the code is 0; when 0 < timeout level ≤ 1, the code is 1; when 1 < timeout level ≤ 2, the code is 2; when timeout level > 2, the code is 3. The number of values for the ordinal type data is compared with a preset threshold. When the number of values for the ordinal type data is less than or equal to the preset threshold, one-hot encoding is performed. When the number of values for the ordinal type data is greater than the preset threshold, leave-one-out encoding is performed. Feature normalization and balancing steps: Normalize the continuous feature data in the municipal maintenance work order data, and use the normalized data, as well as the encoded categorical and ordinal data, as training set samples. Then, use the SMOTE+Tomeklinks method to balance the data in the training set samples to obtain balanced training set samples. The optimal model establishment and timeout prediction steps are as follows: A gradient boosting tree model is established, trained on the balanced training set samples, and the parameters of the gradient boosting tree model are tuned using the Bayesian optimization algorithm to obtain the tuned gradient boosting tree model. Then, the generalization performance of the tuned gradient boosting tree model is tested using the learning curve. The gradient boosting tree model that passes the generalization performance test is taken as the optimal gradient boosting tree model, and the timeout degree of municipal maintenance work orders is predicted based on the optimal gradient boosting tree model.
2. The method for predicting the timeout level of municipal maintenance work orders according to claim 1, characterized in that, In the data acquisition step, the municipal maintenance work order data includes work order ID, name of the inspected object, location, maintenance unit, inspector, category of problem to be rectified, work order generation time, work order completion time, maintenance level, timely rectification, season, work order type, rectification type, street / township to which the object belongs, inspection unit, and work team.
3. The method for predicting the timeout level of municipal maintenance work orders according to claim 1, characterized in that, The feature normalization and equalization processing steps include normalizing the continuous feature data in the municipal maintenance work order data, which includes: Determine whether there are outliers in the continuous feature data of municipal maintenance work orders. If outliers exist, perform zero-mean normalization on the continuous feature data. If no outliers exist, perform linear function normalization on the continuous feature data.
4. The method for predicting the timeout level of municipal maintenance work orders according to claim 3, characterized in that, In the feature normalization and equalization processing steps, the SMOTE+Tomeklinks method is used to perform data equalization processing on the data in the training set samples, including: S1: Calculate the k closest samples to the minority class samples in the training set; S2: Select n samples from the calculated k samples and perform linear interpolation to construct new samples; S3: Add the new samples to the training set to obtain the expanded training set samples, and remove the overlapping data pairs in the expanded training set samples.
5. The method for predicting the degree of overdue municipal maintenance work orders according to claim 1, characterized in that, In the optimal model establishment and timeout prediction steps, after obtaining the optimal gradient boosting tree model, the evaluation index of the Macro-average method is used to evaluate the optimal gradient boosting tree model and verify that the optimal gradient boosting tree model is the optimal model.
6. A system for predicting the degree of overdue municipal maintenance work orders, characterized in that, It includes a data acquisition module, a data encoding module, a feature normalization and equalization processing module, and an optimal model building and timeout prediction module, which are connected in sequence. The data acquisition module acquires municipal maintenance work order data and, based on the actual characteristics of the municipal maintenance work orders, divides the discrete feature data in the municipal maintenance work order data into categorical data and ordinal data. The data encoding module encodes ordered data using tags, including encoding the timeout level. The timeout level is calculated as (actual processing time - prescribed processing time limit) / prescribed processing time limit. When the timeout level is 0, the code is 0; when 0 < timeout level ≤ 1, the code is 1; when 1 < timeout level ≤ 2, the code is 2; and when the timeout level > 2, the code is 3. The module also compares the number of values for the ordered data with a preset threshold. When the number of values for the ordered data is less than or equal to the preset threshold, the ordered data is one-hot encoded; when the number of values for the ordered data is greater than the preset threshold, the ordered data is encoded using leave-one-out encoding. The feature normalization and balancing processing module normalizes the continuous feature data in the municipal maintenance work order data, and uses the normalized data, as well as the encoded categorical and ordinal data, as training set samples. Then, the SMOTE+Tomeklinks method is used to balance the data in the training set samples to obtain balanced training set samples. The optimal model establishment and timeout prediction module establishes a gradient boosting tree model, trains it on the balanced training set samples, and uses a Bayesian optimization algorithm to tune the parameters of the gradient boosting tree model to obtain the tuned gradient boosting tree model. Then, the learning curve is used to test the generalization performance of the tuned gradient boosting tree model. The gradient boosting tree model that passes the generalization performance test is taken as the optimal gradient boosting tree model, and the timeout degree of municipal maintenance work orders is predicted based on the optimal gradient boosting tree model.
7. The municipal maintenance work order overtime prediction system according to claim 6, characterized in that, The municipal maintenance work order data includes work order ID, name of the inspected object, location, maintenance unit, inspector, category of problem to be rectified, work order generation time, work order completion time, maintenance level, on-time rectification, season, work order type, rectification type, street / township to which the object belongs, inspection unit, and work team.
8. The municipal maintenance work order overtime prediction system according to claim 6, characterized in that, The feature normalization and equalization processing module performs normalization processing on continuous feature data in municipal maintenance work order data, including: Determine whether there are outliers in the continuous feature data of municipal maintenance work orders. If outliers exist, perform zero-mean normalization on the continuous feature data. If no outliers exist, perform linear function normalization on the continuous feature data.
9. The municipal maintenance work order overtime prediction system according to claim 8, characterized in that, The feature normalization and data balancing module uses the SMOTE+Tomeklinks method to perform data balancing on the training set samples, including: S1: Calculate the k closest samples to the minority class samples in the training set; S2: Select n samples from the calculated k samples and perform linear interpolation to construct new samples; S3: Add the new samples to the training set to obtain the expanded training set samples, and remove the overlapping data pairs in the expanded training set samples.
10. The municipal maintenance work order overtime prediction system according to claim 6, characterized in that, In the optimal model establishment and timeout prediction module, after obtaining the optimal gradient boosting tree model, the evaluation index of the Macro-average method is used to evaluate the optimal gradient boosting tree model and verify that the optimal gradient boosting tree model is the optimal model.