CN114595624A - Service life state prediction method of heat tracing belt device based on XGboost algorithm - Google Patents

Service life state prediction method of heat tracing belt device based on XGboost algorithm Download PDF

Info

Publication number
CN114595624A
CN114595624A CN202210020123.6A CN202210020123A CN114595624A CN 114595624 A CN114595624 A CN 114595624A CN 202210020123 A CN202210020123 A CN 202210020123A CN 114595624 A CN114595624 A CN 114595624A
Authority
CN
China
Prior art keywords
sample
splitting
tree
value
model
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210020123.6A
Other languages
Chinese (zh)
Inventor
赵利岗
胡贤贤
罗欣
李亚鹏
沈安文
唐其鹏
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shanxi Cecep Luan Power Energy Saving Service Co ltd
Huazhong University of Science and Technology
Original Assignee
Shanxi Cecep Luan Power Energy Saving Service Co ltd
Huazhong University of Science and Technology
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shanxi Cecep Luan Power Energy Saving Service Co ltd, Huazhong University of Science and Technology filed Critical Shanxi Cecep Luan Power Energy Saving Service Co ltd
Priority to CN202210020123.6A priority Critical patent/CN114595624A/en
Publication of CN114595624A publication Critical patent/CN114595624A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F30/00Computer-aided design [CAD]
    • G06F30/20Design optimisation, verification or simulation
    • G06F30/27Design optimisation, verification or simulation using machine learning, e.g. artificial intelligence, neural networks, support vector machines [SVM] or training a model
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F17/00Digital computing or data processing equipment or methods, specially adapted for specific functions
    • G06F17/10Complex mathematical operations
    • G06F17/18Complex mathematical operations for evaluating statistical data, e.g. average values, frequency distributions, probability functions, regression analysis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2119/00Details relating to the type or aim of the analysis or the optimisation
    • G06F2119/04Ageing analysis or optimisation against ageing
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y04INFORMATION OR COMMUNICATION TECHNOLOGIES HAVING AN IMPACT ON OTHER TECHNOLOGY AREAS
    • Y04SSYSTEMS INTEGRATING TECHNOLOGIES RELATED TO POWER NETWORK OPERATION, COMMUNICATION OR INFORMATION TECHNOLOGIES FOR IMPROVING THE ELECTRICAL POWER GENERATION, TRANSMISSION, DISTRIBUTION, MANAGEMENT OR USAGE, i.e. SMART GRIDS
    • Y04S10/00Systems supporting electrical power generation, transmission or distribution
    • Y04S10/50Systems or methods supporting the power network operation or management, involving a certain degree of interaction with the load-side end user applications

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Mathematical Analysis (AREA)
  • Computational Mathematics (AREA)
  • Mathematical Physics (AREA)
  • Pure & Applied Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Mathematical Optimization (AREA)
  • Evolutionary Computation (AREA)
  • Software Systems (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Operations Research (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Evolutionary Biology (AREA)
  • Artificial Intelligence (AREA)
  • Medical Informatics (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Probability & Statistics with Applications (AREA)
  • Geometry (AREA)
  • Algebra (AREA)
  • Computer Hardware Design (AREA)
  • Databases & Information Systems (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The invention discloses a service life state prediction method of a heat tracing belt device based on an XGboost algorithm, which comprises the following steps: acquiring historical data information of an experimental data set of a heat tracing belt device; dividing the data set into a training data set, a verification data set and a test data set according to a proportion; initializing the XGboost model; performing model training using the training data set; adjusting model parameters using the validation dataset; verifying the accuracy of the XGboost model through a test data set; if the requirement is not met, the steps are repeated, if the requirement is met, the verified XGboost model is used for predicting the real-time working data of the heat tracing band device to obtain a predicted value, the predicted value is converted to obtain a predicted probability, and the state label classification corresponding to the predicted probability is the service life state of the current heat tracing band device. The invention discovers the association rule through the existing data sample, strengthens the learning process through an efficient training method, establishes a classification, clustering and regression algorithm/model, and realizes the service life prediction of the tracing band according to the object data.

Description

Service life state prediction method of heat tracing belt device based on XGboost algorithm
Technical Field
The invention relates to the technical field of temperature control of heat tracing bands and pipelines, in particular to a service life state prediction method of a heat tracing band device based on an XGboost algorithm.
Background
The traditional pipeline is prevented frostbite and adopts a heating technology of a heat tracing band, constructors wind the heat tracing band on a pipeline, the two ends of the pipeline are communicated with 220VAC to continuously heat the heat tracing band, and heat-resistant flame-retardant materials such as aluminum silicate, high-silicon glass fiber and the like with certain thickness are wrapped outside the pipeline to preserve heat. However, the heat tracing band is continuously aged due to long-time uninterrupted work, and faults such as insufficient power, breakage and the like often occur to the heat tracing band with the exhausted service life, so that the protected pipeline is frozen in a short time, and industrial production is influenced. The aging of the heat tracing band has randomness and uncertainty, the service life of products in the same batch is different, and the products cannot be accurately predicted, so that field workers need to frequently patrol whether the heat tracing band effectively operates or not in order to ensure the normal work of pipelines at each position, wherein the heat tracing band comprises outdoor pipelines, overhead pipelines and the like which are difficult to explore. The traditional on-site inspection mode is low in detection efficiency, high in working strength, high in labor consumption time and has certain missing inspection risk.
At present, PTC materials are adopted in the heat tracing band, the materials age gradually along with the increase of the service time, the heating power of equipment is attenuated, and finally the required power for heating the pipeline cannot be achieved. The heat tracing band works to attenuate aging failure, and in addition, the heat tracing band equipment has unexpected aging conditions, such as too low temperature of heated objects, improper dragging, excessive stretching, dampness and the like. The aging of the heat tracing band products is accelerated due to the unexpected conditions, and the running state of the equipment cannot be effectively estimated by adopting the traditional heat tracing band work attenuation aging failure curve for prediction due to the individual difference of the heat tracing band products.
The uncertainty and randomness of the service life of the traditional heat tracing band are important reasons for the disorder and urgency of construction operation of replacing equipment, and the scientific prediction of the service life of the heating equipment can provide a basis for the development work of guarantee personnel. The invention researches the application technology of AI mechanical learning in the aspect of service life prediction of the tracing band, finds out the association rule through the existing data sample, strengthens the learning process through an efficient training method, establishes a classification, clustering and regression algorithm/model, and realizes service life prediction of the tracing band according to the object data.
Disclosure of Invention
The invention aims to overcome the defects of the prior art and provides a service life state prediction method of a heat tracing belt device based on an XGboost algorithm to solve the problems in the technical background.
In order to achieve the purpose, the invention is realized by the following technical scheme:
the XGboost algorithm-based service life state prediction method for the heat tracing belt device comprises the following steps:
adding historical data information of a heat tracing belt device into a data set;
each data sample in the data set comprises three characteristic values of heat tracing band working current, terminal voltage and temperature and a real label value;
step two, dividing the data set in the step one according to the proportion of 7:2:1, wherein 70% of data is used as a training data set for training a model, 20% of data is used as a verification data set for adjusting model parameters, and 10% of data is used as a test data set for verifying the accuracy of the model;
initializing Xgboost model parameters before training the XGboost model, wherein the Xgboost model parameters comprise general parameters, Booster parameters and learning target parameters;
step four, setting iteration times num _ round as t (t is default to 10), training the XGboost initialization model in the step three by using the training data set in the step two, and obtaining a trained model, namely constructing 1 st tree to 3t tree, wherein the model training specifically comprises the following steps:
4.1 set initial prediction probability of each sample to be P0Constructing the first three trees according to the initial prediction probability and the sample real label value;
4.2 prediction probability P from each sample in the first three trees1iCarrying out second iteration on the real label value of the sample until the set iteration times are reached, and finishing the construction of the training model;
in the model training process, samples x in t trees for each categoryiThe variation of the predicted score is shown in the following formula (1),
Figure BDA0003462049310000021
in the formula (1), ft(xi) Refers to a certain type of sample x in the t-th treeiThe corresponding leaf node weight; k represents a category, and k takes the value 1, 2 or 3;
Figure BDA0003462049310000022
represent samples x in the top t-1 trees in the kth categoryiCorresponding leaf node weight and sample x in the t treeiThe sum of the corresponding leaf node weights;
sample xiThe conversion relation between the sum of the leaf node weights and the prediction probability is as follows:
Figure BDA0003462049310000023
in the formula (2), p1iRepresents a sample xiIs a predictive probability of the first class, p2iRepresents a sample xiIs a prediction probability of the second class, p3iRepresents a sample xiA predicted probability of a third class;
step five, adjusting the model parameters of the trained model obtained in the step four by using the verification data set in the step two, specifically checking the classification result of the verification data set by continuously adjusting the model parameters, and finally selecting the optimal model parameters;
step six, verifying the accuracy of the XGboost model obtained in the step five through the test data set in the step two;
step seven, when the accuracy of the XGboost model is verified to not meet the requirement in the step six, repeating the step one to the step six until the accuracy is achieved; and if the accuracy of the XGboost model meets the requirements in the sixth step, obtaining the verified XGboost model, predicting the real-time working data of the heat tracing band device by using the verified XGboost model to obtain a predicted score, and converting the predicted score into a corresponding service life type, namely the service life state of the current heat tracing band device.
In the above technical solution, the real tag values in the step one are [1,0,0], [0,1,0] or ]0,0,1], and the tag values [1,0,0], [0,1,0] and [0,0,1] respectively correspond to three different life states of normal operation, life warning and short life.
In the above technical solution, the initializing process of the Xgboost model parameter in the third step is specifically:
setting the boost in the general parameters as gbtree; setting eta to be 0.1, gamma to be 0.1, max _ depth to be 5, min _ child _ weight to be 2 and lambda to be 2 in the Booster parameter; the learning target parameters are set as: object is set to multi, softmax, num _ class is set to 3;
wherein gbtree represents a tree-based model, eta represents a learning rate, gamma represents a minimum loss function degradation value required for node splitting, max _ depth represents a maximum depth of the tree, min _ child _ weight represents a minimum leaf node sample weight sum, lambda represents an L2 regularization term of the weight, objective represents a category of return prediction, multi: softmax represents a multi-classifier of softmax, and num _ class is the number of categories.
In the above technical solution, in step 4.1, the specific construction process of constructing the first three trees according to the initial prediction probability and the sample true label value is as follows:
4.1.1, constructing 1 st tree for the first category, and performing node division on training set samples according to an initial prediction probability (set to be 0.333) and sample real label values; in the training set sample, the real label value of the sample belonging to the first class is 1, and the real label value of the sample not belonging to the first class is 0;
4.1.2 in the process of node division of the training set sample, when the sum of the weights of the leaf nodes of the tree reaches the minimum leaf node sample weight sum (min _ child _ weight), or the depth of the tree in the tree reaches the set maximum depth (max _ depth) of the tree, or the division profit reaches a threshold value (the threshold value is set to 0), stopping node division, and obtaining the 1 st tree of the first class, namely the 1 st tree of the training model;
4.1.3 construction of the 1 st trees for the second and third categories, i.e. the 2 nd and 3 rd trees of the training model, in the same way.
In the above technical solution, in step 4.1.1, the specific method for performing node division on the training sample according to the initial prediction probability and the sample true label value (0/1/2) is as follows:
4.1.1.1 setting the initial prediction probability P of each sample0Obtaining a first-order partial derivative value and a second-order partial derivative value of a training set sample loss function according to the initial prediction probability and the sample real label value, and obtaining a target function before and after splitting according to the first-order partial derivative value and the second-order partial derivative value;
the first and second partial derivative values of the training set sample loss function are given by:
Figure BDA0003462049310000041
Figure BDA0003462049310000042
wherein, giIs a sample xiFirst derivative of the loss function, hiIs xiSecond derivative of the loss function, yiRepresents a sample xiThe value of the true tag of (a),
Figure BDA0003462049310000043
represents a sample xiIs predicted to score or sample xiThe sum of the corresponding leaf node weights; initial prediction probability P of each sample in the process of building the first three trees0=0.333;
The objective functions before and after splitting are respectively:
Figure BDA0003462049310000044
Figure BDA0003462049310000045
wherein, the first-order partial derivative value of the left sub-tree is calculated
Figure BDA0003462049310000046
Left sub-tree second order partial derivative value calculation
Figure BDA0003462049310000047
Calculation of first-order partial derivative value of right subtree
Figure BDA0003462049310000048
Calculation of second-order partial derivative value of right subtree
Figure BDA0003462049310000049
IleftIs a left subtree sample set, IrightFor the right subtree sample set, i denotes sample xiλ represents the parameter lambda in step three, γ represents the parameter gamma in step three;
4.1.1.2, calculating the splitting Gain according to the objective function before and after splitting, namely the splitting Gain after splitting is the objective function before splitting-the objective function after splitting, and the splitting Gain after splitting is shown as the following formula:
Figure BDA00034620493100000410
4.1.1.3, calculating the splitting gain corresponding to each eigenvalue of the training data set sample according to the steps 4.1.1.1 to 4.1.1.2, and dividing the nodes by taking the eigenvalue corresponding to the maximum splitting gain as the splitting point.
In the above technical solution, in step 4.2, the prediction probability P of each sample in the first three trees is determinedkiAnd carrying out second iteration on the sample real label values to construct 4 th to 6 th trees, wherein the specific construction process is as follows:
4.2.1 constructing 2 nd Tree of first class for Tree of first class according to predicted probability P of each sample in the class1i(k is 1, i.e. P)ki=P1i) And a sample real label value, and carrying out node division on the training set sample, wherein in the training set sample, the sample real label value belonging to the first type is 1, and the sample real label value not belonging to the first type tree is 0; the specific node dividing method comprises the following steps:
4.2.1.1 prediction probability P from each sample1iObtaining a first-order partial derivative value and a second-order partial derivative value of the training set sample loss function according to the sample real label value, and obtaining a target function before and after splitting according to the first-order partial derivative value and the second-order partial derivative value;
the first and second partial derivative values of the training set sample loss function are given by:
Figure BDA0003462049310000051
Figure BDA0003462049310000052
Figure BDA0003462049310000053
wherein, giIs a sample xiLoss boxFirst derivative of number, hiIs xiSecond derivative of the loss function, yiRepresents a sample xiThe value of the true tag of (a),
Figure BDA0003462049310000054
represents a sample xiIs predicted to score or sample xiThe sum of the corresponding leaf node weights; p1iRepresenting samples x in the first classiA predicted probability of (d);
the objective functions before and after splitting are respectively:
Figure BDA0003462049310000055
Figure BDA0003462049310000056
wherein, the first-order partial derivative value of the left sub-tree is calculated
Figure BDA0003462049310000057
Left sub-tree second order partial derivative value calculation
Figure BDA0003462049310000058
Calculation of first-order partial derivative value of right subtree
Figure BDA0003462049310000059
Calculation of second-order partial derivative value of right subtree
Figure BDA00034620493100000510
IleftIs a left subtree sample set, IrightFor the right subtree sample set, i denotes sample xiλ represents the parameter lambda in step three, γ represents the parameter gamma in step three;
4.2.1.2 calculating the splitting yield, i.e. the score after splitting, according to the objective function before and after splittingFission yield Gain is the objective function before fission Obj1-post-splitting objective function Obj2The cleavage yield Gain after cleavage is shown as follows:
Figure BDA0003462049310000061
4.2.1.3, calculating the splitting profit corresponding to each eigenvalue of the training data set sample according to the steps 4.2.1.1 to 4.2.1.2, and carrying out node division by taking the eigenvalue corresponding to the maximum splitting profit as a splitting point;
4.2.2 in the process of node division of the training set sample, when the sum of the weights of the leaf nodes of the tree reaches the minimum leaf node sample weight and min _ child _ weight, or the depth of the tree in the tree reaches the set maximum depth max _ depth of the tree, or the splitting yield reaches a threshold value, the threshold value is set to 0, namely node splitting is stopped, and at this time, the 2 nd tree of the first class, namely the 4 th tree of the training model is obtained;
4.2.3 the construction of the 2 nd trees of the second and third classes is carried out in the same way.
In the above technical solution, in the fifth step, the specific method for adjusting the model parameters by verifying the data set is as follows:
firstly, optimizing max _ depth and min _ child _ weight, performing coarse adjustment in a large range, fine adjustment in a small range, and then determining the optimal max _ depth and the optimal min _ child _ weight by using high-load grid search;
secondly, optimizing gamma parameters, and finely adjusting after grid searching to determine an optimal value;
thirdly, adjusting lambda parameters to be optimal;
finally, optimizing the learning rate eta;
the evaluation criterion of parameter tuning is whether the prediction accuracy of the verification data set is improved.
In the above technical solution, in the sixth step, a specific verification method for the accuracy of the XGBoost model is as follows: and predicting the sample data of the verification set by using the training model with the optimized model parameters obtained in the step five to obtain a prediction score, converting the prediction score into a life class, and comparing the life class with the actual life class to obtain relative accuracy, wherein if the accuracy is less than 97%, the step one is restarted.
Compared with the prior art, the invention has the beneficial effects that:
1. the invention applies AI mechanical learning to the aspect of service life prediction of the heat tracing band, finds out the association rule through the existing data samples, strengthens the learning process through an efficient training method, establishes a classification, clustering and regression algorithm/model, and realizes the service life prediction of the heat tracing band according to the object data.
2. The XGboost solves the problem of bifurcation feature selection by using a greedy strategy, solves the problem of how to obtain a prediction score by solving the maximum value of a target function, increases a new CART tree in each iteration in an iteration mode, finally realizes gradual fitting of a prediction residual error, and completes service life prediction.
Drawings
FIG. 1 is a flow chart of a life state prediction method of a heat tracing belt device of an XGboost algorithm in the invention;
Detailed Description
The embodiments of the present invention are described below with reference to specific embodiments, and other advantages and effects of the present invention will be easily understood by those skilled in the art from the disclosure of the present specification. The invention is capable of other and different embodiments and of being practiced or of being carried out in various ways, and its several details are capable of modification in various respects, all without departing from the spirit and scope of the present invention. It is to be noted that the features in the following embodiments and examples may be combined with each other without conflict.
It should be noted that the drawings provided in the following embodiments are only for illustrating the basic idea of the present invention, and the components related to the present invention are only shown in the drawings rather than drawn according to the number, shape and size of the components in actual implementation, and the type, quantity and proportion of the components in actual implementation may be changed freely, and the layout of the components may be more complicated.
Referring to fig. 1, the invention provides a service life state prediction method of a heat tracing band device based on an XGBoost algorithm, which comprises the following steps.
The XGboost algorithm-based service life state prediction method for the heat tracing belt device comprises the following steps:
adding historical data information of a heat tracing belt device into a data set;
each group of data in the data set comprises three characteristic values of the working current, the terminal voltage and the temperature of the heat tracing band and a real label value, wherein the real label value is [1,0,0], [0,1,0] or [0,0,1], and the label values [1,0,0], [0,1,0] and [0,0,1] respectively correspond to three different service life states of normal work (more than 500 hours), service life early warning (less than 500 hours and more than 100 hours) and insufficient service life (less than 100 hours);
step two, dividing the data set in the step one according to the proportion of 7:2:1, wherein 70% of data is used as a training data set for training the model, 20% of data is used as a verification set for adjusting model parameters, and 10% of data is used as a test set for verifying the accuracy of the model;
initializing Xgboost model parameters before training the XGboost model, wherein the Xgboost model parameters comprise general parameters, Booster parameters and learning target parameters;
wherein, the boost in the general parameters is set as the gbtree (the gbtree refers to a tree-based model), and other parameters in the general parameters keep default values; in the Booster parameter, the learning rate eta is set to 0.1 (the robustness of the model can be improved by reducing the weight of each step, the typical value is 0.01-0.2), the gamma is set to 0.1 (when a node is split, the node is split only if the value of a loss function after splitting is reduced, the gamma specifies the minimum loss function reduction value required by the node splitting), the max _ depth is set to 5 (referring to the maximum depth of the tree), the min _ child _ weight is set to 2 (determining the sum of the sample weights of the minimum leaf nodes), the lambda is set to 2 (L2 regularization term of the lambda referring to the weight), and other parameters keep default values; setting object to be multi in the learning target parameters, wherein the object is softmax (a multi-classifier of the softmax is used, the object is a return prediction category), and num _ class is set to be 3(num _ class is a category number), and other parameters in the learning target parameters keep default values;
step four, setting iteration times num _ round as t (t is default to 10, and can also be set), training the XGboost initialization model in the step three by using the training data set in the step two, and obtaining the trained XGboost model, namely constructing the first tree to the 3t tree, wherein the specific steps of the training model are as follows:
1) in the model training process, samples x in t trees for each categoryiThe variation of the predicted score is shown in the following formula (1),
Figure BDA0003462049310000081
wherein the content of the first and second substances,
Figure BDA0003462049310000082
and sample xiContained within leaf node j.
In the formula (1), fkt(xi) Refers to a sample x in the t-th tree of a certain classiThe corresponding leaf node weight; k represents a category, and k takes the value 1, 2 or 3;
Figure BDA0003462049310000083
represent samples x in the top t-1 trees in the kth categoryiCorresponding leaf node weight and sample x in the t treeiThe sum of the corresponding leaf node weights;
Figure BDA0003462049310000084
is the weight value corresponding to the leaf node j in the t-th tree of a certain class,
Figure BDA0003462049310000085
the leaf node j in the t-th tree of a certain class contains the sum of the first partial derivatives of the samples,
Figure BDA0003462049310000086
in the t-th tree of a certain classThe leaf node j contains the sum of the second partial derivatives of the samples, and λ represents the parameter lambda in step three.
For example, for the first class, sample x in the 1 st tree through the t treeiThe variation of the predicted score is shown in the following formula,
Figure BDA0003462049310000087
wherein f is1t(xi) Refers to sample x in the t-th tree of the first classiThe weight of the corresponding leaf node is determined,
Figure BDA0003462049310000088
represents the sample x in the first t-1 trees in the first classiSum of corresponding leaf node weights and sample x in the t treeiThe sum of the corresponding leaf node weights;
2) sample xiThe conversion relation between the sum of the leaf node weights and the prediction probability is as follows:
Figure BDA0003462049310000091
in the formula (2), P1iRepresents a sample xiA predicted probability of being a first class; p is a radical of2iRepresents a sample xiIs a prediction probability of the second class, p3iRepresents a sample xiIs the predicted probability of the third class.
The formula (1) is directed to the first class
Figure BDA0003462049310000092
And for the second class
Figure BDA0003462049310000093
And for the third class
Figure BDA0003462049310000094
Carry-in (2) can get the sample x in the next tree of a certain classiPrediction corresponding to the categoryScore value P1i、P2i、P3i
3) Before starting the next iteration, obtaining a first-order partial derivative value and a second-order partial derivative value of the training set sample according to the prediction probability of the previous iteration and the real label value of the sample, as shown in the following formula:
Figure BDA0003462049310000095
Figure BDA0003462049310000096
Figure BDA0003462049310000097
Figure BDA0003462049310000098
wherein, giIs a sample xiFirst derivative of the loss function, hiIs xiSecond derivative of the loss function, yiRepresents a sample xiThe value of the true tag of (a),
Figure BDA0003462049310000099
representing a sample xiIs predicted to score or sample xiThe sum of the corresponding leaf node weights; pkiRepresenting sample x in the previous iterationiCorresponding to the prediction probability of the kth class, P is obtained in the process of building the first three treeski=P0=0.333;
The specific construction process of the Xgboost model is as follows:
4.1 constructing the first three trees according to the initial prediction probability and the sample real label value; the first three trees are respectively corresponding 1 st trees of three categories, when the 1 st tree of a certain category is constructed, in a training data set sample, the real label value belonging to the category is 1, the real label value not belonging to the category is 0, and the verification data set and the test data set are the same in structure and are not repeated;
setting an initial prediction probability P0=0.333;
The specific construction process is as follows:
4.1.1, constructing a 1 st tree aiming at the first class, and performing node division on a training sample according to the initial prediction probability; the specific method for dividing the nodes comprises the following steps:
4.1.1.1 from the initial prediction probability P0Obtaining a first-order partial derivative value and a second-order partial derivative value of the training set sample loss function according to the sample real label value, and obtaining a target function before and after splitting according to the first-order partial derivative value and the second-order partial derivative value;
the first and second partial derivative values of the training set sample loss function are given by:
Figure BDA0003462049310000101
Figure BDA0003462049310000102
wherein, giIs a sample xiFirst derivative of the loss function, hiIs xiSecond derivative of the loss function, yiRepresents a sample xiThe value of the true tag of (a) is,
Figure BDA0003462049310000103
represents a sample xiIs predicted to score or sample xiThe sum of the corresponding leaf node weights; initial prediction probability P of each sample in the process of building the first three trees0=0.333;
The objective functions before and after splitting are respectively:
Figure BDA0003462049310000104
Figure BDA0003462049310000105
wherein, the first-order partial derivative value of the left sub-tree is calculated
Figure BDA0003462049310000106
Left sub-tree second order partial derivative value calculation
Figure BDA0003462049310000107
Calculation of first-order partial derivative value of right subtree
Figure BDA0003462049310000108
Calculation of second-order partial derivative value of right subtree
Figure BDA0003462049310000109
Wherein HLRepresenting the sum of the second partial derivatives, H, of the samples contained in the left sub-treeRRepresenting the right subtree containing the sum of the second partial derivatives of the samples, GLThe sum of the first partial derivatives, G, representing the samples contained in the left sub-treeRIndicating that the right sub-tree contains the sum of the first partial derivatives, I, of the samplesleftIs a left subtree sample set, IrightFor the right subtree sample set, i denotes sample xiλ represents the parameter lambda in step three, γ represents the parameter gamma in step three;
4.1.1.2, calculating the splitting profit according to the objective function before and after splitting, namely the splitting profit after splitting is the objective function before splitting Obj1-post-splitting objective function Obj2The cleavage yield Gain after cleavage is shown as follows:
Figure BDA00034620493100001010
4.1.1.3, calculating the splitting profit corresponding to each eigenvalue of the training data set sample according to the steps 4.1.1.1 to 4.1.1.2, and dividing the nodes by taking the eigenvalue corresponding to the maximum splitting profit as a splitting point;
4.1.2 in the process of node division at step 4.1.1, when the sum of the weights of the leaf nodes of the tree reaches the minimum leaf node sample weight sum (min _ child _ weight), or the depth of the tree in the tree reaches the set maximum depth of the tree (max _ depth) or the splitting profit reaches the threshold (the threshold is set to 0), stopping splitting, at this time, obtaining the 1 st tree of the first class, where the sum of the weights of the leaf nodes of the tree is:
Figure BDA0003462049310000111
4.1.3 the same method is adopted to construct the 1 st trees corresponding to the second and third classes, namely the 2 nd and 3 rd trees of the training model;
4.2 prediction probability P from each sample in the first three treeskiPerforming second iteration on the sample real label value;
the procedure of the second iteration of step 4.2 is similar to the procedure of step 4.1 for constructing the first three trees, except that step 4.2 is based on the predicted probabilities (i.e. P) of the 1 st trees of the three categories before starting construction of the 2 nd trees of the three categories (i.e. the 4 th, 5 th and 6 th trees)1i、P2iAnd P3i) Obtaining a first-order partial derivative value and a second-order partial derivative value of the training set sample loss function according to the sample real label value; step 4.1, before the first three trees are constructed, a first-order partial derivative value and a second-order partial derivative value of a training set sample loss function are obtained according to the initial prediction probability and the sample real label value; the construction process of the second iteration is specifically as follows:
1) before starting the second iteration, obtaining a first-order partial derivative value and a second-order partial derivative value of a training set sample loss function according to the prediction probabilities of the first three trees and the sample real label value; respectively and correspondingly obtaining target functions before and after splitting of the 4 th tree, the 5 th tree and the 6 th tree according to the first-order partial derivative value and the second-order partial derivative value;
Figure BDA0003462049310000112
Figure BDA0003462049310000113
Figure BDA0003462049310000114
Figure BDA0003462049310000115
wherein, giIs a sample xiFirst derivative of the loss function, hiIs xiSecond derivative of the loss function, yiRepresents a sample xiThe value of the true tag of (a),
Figure BDA0003462049310000116
represents a sample xiIs predicted to score or sample xiThe sum of the corresponding leaf node weights; pkiRepresents a sample xiA prediction probability corresponding to the kth class;
the objective functions before and after splitting are respectively:
Figure BDA0003462049310000117
Figure BDA0003462049310000121
wherein, the first-order partial derivative value of the left sub-tree is calculated
Figure BDA0003462049310000122
Left sub-tree second order partial derivative value calculation
Figure BDA0003462049310000123
Calculation of first-order partial derivative value of right subtree
Figure BDA0003462049310000124
Calculation of second-order partial derivative value of right subtree
Figure BDA0003462049310000125
IleftSet of left subtree samples, IrightFor the right subtree sample set, i denotes sample xiλ represents the parameter lambda in step three, γ represents the parameter gamma in step three;
2) calculating splitting income according to the objective function before and after splitting;
3) calculating splitting gains corresponding to each characteristic value of the sample characteristics according to the steps 1) to 2), and performing node division by taking the characteristic value corresponding to the maximum splitting gain as a splitting point;
4) in the process of node division in steps 1) to 3), when the sum of the weights of leaf nodes of the tree reaches a threshold (min _ child _ weight), or the depth of a tree in the tree reaches a set maximum depth (max _ depth), or the division yield reaches a threshold (set to 0, if greater than 0, the objective function value is still decreasing), stopping the division;
4.3 before the next three trees are constructed, namely before the next iteration, obtaining a first-order partial derivative value and a second-order partial derivative value of the training set sample according to the prediction probability of the last three trees and the real label value of the sample, and repeating the iterative learning of the step 4.2 until the set iteration times are reached, so that the Xgboost model is constructed completely.
Step five, model parameters of the trained model obtained in the step four are adjusted by using the verification data set in the step two, specifically, classification results of the verification data set are checked by continuously adjusting the model parameters, and finally, optimal model parameters are selected to obtain a parameter-adjusted XGboost model;
in the fifth step, the specific method for adjusting the model parameters through the verification data set comprises the following steps:
firstly, determining the optimal decision tree number 3t by using a cv function in the xgboost, and when the learning rate is 0.1 and the given iteration time t is 1000, setting early _ stopping _ rounds in the cv function to be 50, which means that if the loss function is not reduced after 50 iterations, the training is stopped, so that the obtained ideal decision tree number 3t is 114, and the accuracy of the training set is 94.44%;
where early _ stopping _ rounds in the cv function is set to 50, indicating that training is stopped if the loss function does not drop after 50 iterations.
The first step is to optimize max _ depth and min _ child _ weight, firstly carry out coarse adjustment in a large range, then carry out fine adjustment in a small range, and then determine the optimal max _ depth and the optimal min _ child _ weight by using high-load grid search, wherein the specific steps are as follows: firstly, giving a max _ depth range of 3-10, a step length of 1, giving a min _ child _ weight range of 1-6 and a step length of 1, and performing grid search by utilizing GridSearchCV.fit to obtain an optimal max _ depth of 3 and an optimal min _ child _ weight of 5; then, giving a max _ depth of 2/3/4 and a min _ child _ weight of 4/5/6, and performing grid search by using GridSearchCV.fit to obtain an optimal max _ depth of 2 and an optimal min _ child _ weight of 4;
and the second step is to optimize the gamma parameter, and fine adjustment can be carried out to determine the optimal value after the grid search, and the specific steps are as follows: firstly, giving a gamma range of 0-5 and a step length of 0.1, performing grid search by utilizing GridSearchCV.fit to obtain the optimal gamma of 0, then giving a gamma range of 0-1 and a step length of 0.02, and performing grid search by utilizing GridSearchCV.fit to obtain the optimal gamma of 0;
the third step is to optimize lambda parameters, and the specific steps are as follows: firstly, giving a lambda range of 0-5 and a step length of 1, performing grid search by utilizing GridSearchCV.fit to obtain the optimal lambda of 0, then giving the lambda range of 0-1 and the step length of 0.01, and performing grid search by utilizing GridSearchCV.fit to obtain the optimal lambda of 0;
and finally, optimizing the learning rate eta, and specifically comprising the following steps: firstly, setting the eta range to be 0-1 and the step length to be 0.01, carrying out grid search by utilizing GridSearchCV.fit to obtain the optimal eta of 0.1, then setting the eta range to be 0.09/0.1/0.11, carrying out grid search by utilizing GridSearchCV.fit to obtain the optimal eta of 0.1;
the evaluation criterion of parameter tuning is whether the prediction accuracy of the verification data set is improved.
Step six, verifying the accuracy of the XGboost model obtained in the step five through the test data set in the step two;
the specific verification method for the accuracy of the XGboost model comprises the following steps: and predicting the sample data of the verification set by using the XGboost model with the optimized model parameters obtained in the fifth step to obtain a predicted value, converting the predicted value into a life class, and comparing the life class with the actual class to obtain relative accuracy, wherein if the accuracy does not meet the requirement, namely the accuracy is less than 97%, the step is restarted from the first step.
Step seven, when the accuracy of the XGboost model is verified to not meet the requirement in the step six, repeating the step one to the step six until the accuracy is achieved; and if the accuracy of the XGboost model meets the requirements in the sixth step, obtaining the verified XGboost model, predicting the real-time working data of the heat tracing band device by using the verified XGboost model to obtain a predicted score, and converting the predicted score into a corresponding service life type, namely the service life state of the current heat tracing band device.
In the invention, three prediction scores of each training sample are respectively equal to the sum of node weights corresponding to the sample in t trees of corresponding categories, the prediction probabilities corresponding to the three categories are obtained through conversion, the three probabilities are added to be 1, and the category with the maximum probability value is selected as the life label category of the sample.
In the invention, in the model training process, each iteration learning cycle traverses all characteristics of each sample by minimizing a loss function as a target, the sum of leaf node weights corresponding to each sample is calculated, so that a prediction score of each sample is obtained, and finally label classification of the service life state of the tracing band is completed according to probabilities (wherein each data sample corresponds to three prediction scores, namely three types of classes respectively), the three probabilities are added to be 1, and the sample class with the maximum probability value is selected; wherein, all the characteristics refer to three characteristics of current, terminal voltage and temperature information in the training data,
for the three-classification problem, if the iteration number is set to be t, 3t trees can be obtained after iteration is completed, each iteration generates one tree for each class, the sum of three prediction probabilities corresponding to each sample is 1, and the class corresponding to the maximum prediction probability is the prediction class corresponding to the sample.
In the invention, the XGboost adopts an ensemble learning method, namely, a plurality of classifiers (weak classifiers) are constructed to predict a data set, and then the prediction results of the plurality of classifiers are integrated to be used as the final prediction result. The XGBoost is derived from the GBDT, and the principle is that the sum of the results of all weak classifiers equals to the predicted value, and then the next weak classifier fits the gradient/residual of the error function to the predicted value (this gradient/residual is the error between the predicted value and the true value), and the expression form of the weak classifier is each tree. For the iteration number num _ round which is t and represents the number of weak classifiers, the larger the value is, the stronger the learning capability of the model is, the easier the model is to be overfitted, the default value is t which is 10, the cv function in the XGBoost can be used for determining the optimal number of decision trees, namely the optimal iteration number, and the new tree added each time in the iteration process is ensured to improve the expression effect of the model.
In the invention, the XGboost adopts a forward distribution algorithm, namely, a learning process is decomposed into first three trees, then second iteration is carried out based on the first three learned trees, and the like, so that an objective function is as small as possible and is as follows:
Figure BDA0003462049310000141
the objective function derivation process is as follows:
the loss function L can be predicted from
Figure BDA0003462049310000142
With the true value yiThe following are shown:
Figure BDA0003462049310000143
the expression is as follows:
Figure BDA0003462049310000144
the prediction accuracy of the XGboost model is determined by the deviation and the variance of the model, the loss function represents the deviation of the model, and if the variance is small, a regular term needs to be added into the objective function to prevent overfitting. Therefore, the objective function is composed of a loss function L and a regularization term Ω for suppressing the complexity of the model, and is defined as:
Figure BDA0003462049310000145
wherein
Figure BDA0003462049310000146
The complexity of all t trees is summed (the t trees are constructed aiming at a certain category), XGBoodt is an algorithm in a boosting family, so that forward step-by-step addition is followed, taking a model in the t step as an example, a sample xiThe sum of the prediction scores of (a) is:
Figure BDA0003462049310000147
wherein
Figure BDA0003462049310000148
Is a predicted value given by the model of step t-1, is a known constant, ft(xi) Is the predicted value of the new model that needs to be added this time. The objective function can be written as:
Figure BDA0003462049310000151
Figure BDA0003462049310000152
in the above formula, only one variable is the t-th tree ft(xi) The remainder are known amounts or can be calculated from known amounts. It should be noted that, since the structure of the first t-1 tree is determined, the complexity of the first t-1 tree can be represented by a constant, and the regularization term
Figure BDA0003462049310000153
From the taylor equation, the second order expansion of taylor is performed on the function f (x + Δ x) at point x, which can be given by the following equation:
Figure BDA0003462049310000154
applying the method to an objective function, f (x) corresponding to a loss function
Figure BDA0003462049310000155
x corresponds to the predicted score of the top t-1 trees
Figure BDA0003462049310000156
Δ x corresponds to the t-th tree f we are trainingt(xi) Then the loss function can be written as:
Figure BDA0003462049310000157
giis the first derivative of the loss function, hiIs the second derivative of the loss function.
The above equation is substituted into the target function of XGBoost, and an approximation of the target function can be obtained:
Figure BDA0003462049310000158
due to the fact that in the t step
Figure BDA0003462049310000159
Is a known value, therefore
Figure BDA00034620493100001510
Is a constant, all constant terms are removed to obtain an objective function as:
Figure BDA00034620493100001511
the complexity Ω of the decision tree may be composed of a leaf tree T, the less the leaf nodes, the simpler the model, so the regularization term of the objective function is jointly determined by the normal form of the vector composed of the number of leaf nodes and the weights of all nodes of all decision trees generated.
Figure BDA00034620493100001512
We will belong to all samples x of the jth leaf nodeiIs divided into a sample set of leaf nodes and is mathematically expressed as Ij={i|q(xi) J, then the objective function of XGBoost may be written as:
Figure BDA0003462049310000161
Figure BDA0003462049310000162
Figure BDA0003462049310000163
thus obtaining:
Figure BDA0003462049310000164
note GjAnd HjIs the result obtained from the first t-1 step, the value can be regarded as a constant, and only the leaf node omega of the last treejAnd (4) uncertain.
Because the target sub-formulas of the leaf nodes are independent of each other, that is, the entire target function reaches the maximum point when the sub-formula of each leaf node reaches the maximum point. Applying the maximum formula of the unary quadratic function to pair the target function to omegajSolving a first derivative, and making the first derivative equal to zero to obtain a weight corresponding to the leaf node j:
Figure BDA0003462049310000165
the final simplified objective function can be obtained as follows:
Figure BDA0003462049310000166
for a single leaf node, the above formula is equivalent to the formula (3), and the objective function is derived.
GjIndicating that leaf node j contains the sum of the first partial derivatives of the samples, HjIndicating that the leaf node j contains the sum of the second partial derivatives, ω, of the samplesjExpressing the weight of the leaf node, wherein lambda is the parameter lambda in the step three, gamma is the parameter gamma in the step three, and T expresses the total number of the leaf node; t denotes the number of iterations or the t-th tree.
Sample xiSum x of leaf node weightsiThe conversion relationship between the prediction probabilities is:
Figure BDA0003462049310000167
wherein the content of the first and second substances,
Figure BDA0003462049310000168
represents a sample xiThe sum of the leaf node weights corresponding to the first class,
Figure BDA0003462049310000169
represents a sample xiLeaf nodes corresponding to the second classThe sum of the weight values is calculated,
Figure BDA0003462049310000171
represents a sample xiSum of leaf node weights, p, corresponding to the third class1iRepresents a sample xiIs a predictive probability of the first class, p2iRepresents a sample xiIs a prediction probability of the second class, p3iRepresents a sample xiA predicted probability of a third class; when the first tree is established, the prediction probability of all samples is given to be 0.333, and when the iteration times are large enough, the influence of the initial prediction probability can be ignored.
In the fourth step, the node division is performed on the samples of the training set, and the specific process is as follows:
according to the initial prediction probability and the sample real label value, a first-order partial derivative value and a second-order partial derivative value of the training set sample can be obtained, and the objective functions before and after splitting are respectively as follows:
Figure BDA0003462049310000172
Figure BDA0003462049310000173
wherein, the first-order partial derivative value of the left sub-tree is calculated
Figure BDA0003462049310000174
Left sub-tree second order partial derivative value calculation
Figure BDA0003462049310000175
The left subtree set is Ileft
Calculation of first-order partial derivative value of right subtree
Figure BDA0003462049310000176
Calculation of second-order partial derivative value of right subtree
Figure BDA0003462049310000177
The right subtree set is Iright
Figure BDA0003462049310000178
Figure BDA0003462049310000179
Figure BDA00034620493100001710
Figure BDA00034620493100001711
Calculating the splitting profit according to the objective function before and after splitting, namely the splitting profit after splitting is equal to the objective function before splitting-the objective function after splitting, and the splitting profit after splitting is shown as the following formula:
Figure BDA00034620493100001712
when the samples of the training set are subjected to node classification, an optimal splitting point needs to be searched in sample characteristic current, terminal voltage and temperature, all the samples of the training set are sorted according to the magnitude of a current value, the magnitude of a terminal voltage value and the magnitude of a temperature value respectively, splitting income of each characteristic value in the sample characteristic current, splitting income of each characteristic value in the terminal voltage and splitting income of each characteristic value in the temperature are calculated, a current characteristic value with the maximum income value, a terminal voltage characteristic value with the maximum income value and a temperature characteristic value with the maximum income value are obtained respectively, and a characteristic value (current, breaking voltage or temperature characteristic value) corresponding to the maximum value in the three income values is used as the splitting point;
taking current as an example, for all training set samples, the samples are first reduced from small to small according to the current valueBig sorting, solving the G of the left sub-tree with each current value as a division pointLAnd HLAnd G of the right subtreeRAnd HRRespectively calculating the splitting Gain (a node of a certain characteristic) of each current characteristic value to obtain a current characteristic value corresponding to the maximum splitting Gain, sequencing all training set samples from small to large according to the voltage values, repeating the calculation to obtain a terminal voltage characteristic value and a temperature characteristic value with the maximum Gain, comparing the obtained three maximum Gain values (the maximum Gain values corresponding to the current characteristic value, the terminal voltage characteristic value and the temperature characteristic value), and finally selecting the characteristic value corresponding to the maximum value of the three maximum Gain values as a splitting point; splitting all training set samples by the splitting point to obtain a currently split node; the currently obtained sample of each node is subjected to the process of searching for the optimal splitting point in the characteristic current, the terminal voltage and the temperature again, and the currently obtained sample of each node is split to obtain a node subjected to secondary splitting; repeating the above process, and in the process, performing splitting according to a principle that the splitting is stopped when the sum of the weights of all nodes reaches a threshold (the threshold is min _ child _ weight, the min _ child _ weight is also called as the minimum leaf node sample weight sum; the min _ child _ weight is set to be 2, and when the sum is less than the threshold 2, the splitting is stopped), or the depth of the tree reaches a set maximum depth (max _ depth is set to be 5, and when the sum is greater than the maximum depth of the tree 5), or the splitting yield reaches the threshold, and finally obtaining the first three trees.
In the invention, each leaf node corresponds to a weight ω (the leaf node is the node at the bottommost section of the tree), and the next iteration is performed on the basis of the weights, which is specifically as follows:
corresponding to x in t trees of a certain classiSum of leaf node weights corresponding to samples
Figure BDA0003462049310000181
Equal to x in the first t-1 treesiSum of leaf node weights corresponding to samples
Figure BDA0003462049310000182
And the t-thX in treeiLeaf node weight f corresponding to samplet(xi) And the sum is shown as follows:
Figure BDA0003462049310000183
sample x, for example the first tree1The prediction score for the first category is equal to f in equation (1)1(x1) I.e. sample x1Weight omega of the leaf node1Then, the compound of formula (1) can be obtained
Figure BDA0003462049310000184
Then x can be obtained1First partial derivative g of the sample1And h1And in the same way, the first-order partial derivative and the second-order partial derivative value corresponding to other samples can be obtained, and in the same way, the sample x is obtained1A second iteration may be performed after the predicted scores for the second category and the third category are assigned.
Take the t-th tree as an example (corresponding to a certain category), if the sample xiSplit to leaf node j, sample xiThe corresponding prediction score is equal to f in equation (1)t(xi) I.e. sample xiWeight omega of located leaf node jj
Figure BDA0003462049310000191
Can obtain the compound of formula (1)
Figure BDA0003462049310000192
Then x can be obtained1First partial derivative g of the sampleiAnd hiAnd by analogy, the first-order partial derivative and the second-order partial derivative value corresponding to other samples can be obtained, and then the next iteration can be carried out.
The above-mentioned embodiments only express the specific embodiments of the present invention, and the description thereof is more specific and detailed, but not construed as limiting the scope of the present invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the inventive concept, which falls within the scope of the present invention.

Claims (8)

1. The XGboost algorithm-based service life state prediction method for the heat tracing belt device is characterized by comprising the following steps of:
adding historical data information of a heat tracing belt device into a data set;
each data sample in the data set comprises three characteristic values of heat tracing band working current, terminal voltage and temperature and a real label value;
step two, dividing the data set in the step one according to the proportion of 7:2:1, wherein 70% of data is used as a training data set for training a model, 20% of data is used as a verification data set for adjusting model parameters, and 10% of data is used as a test data set for verifying the accuracy of the model;
initializing Xgboost model parameters before training the XGboost model, wherein the Xgboost model parameters comprise general parameters, Booster parameters and learning target parameters;
step four, setting iteration times num _ round as t, training the XGboost initialization model in the step three by using the training data set in the step two, and obtaining a trained model, namely constructing 1 st tree to 3t tree, wherein the model training specifically comprises the following steps:
4.1 set initial prediction probability of each sample to be P0Constructing the first three trees according to the initial prediction probability and the sample real label value; the first three trees are respectively corresponding 1 st trees of three categories, when the 1 st tree of a certain category is constructed, the real label value belonging to the category in the training data set sample is 1, and the real label value not belonging to the category is 0;
4.2 prediction probability P from each sample in the first three treeskiCarrying out second iteration on the real label value of the sample until the set iteration times are reached, and finishing the construction of the training model;
in the model training process, samples x in t trees for each categoryiThe variation of the predicted score is shown in the following formula (1),
Figure FDA0003462049300000011
in the formula (1), fkt(xi) Refers to sample x in the t tree of the k categoryiThe corresponding leaf node weight; k represents a category, and k takes the value 1, 2 or 3;
Figure FDA0003462049300000012
represent samples x in the top t-1 trees in the kth categoryiCorresponding leaf node weight and sample x in the t treeiThe sum of the corresponding leaf node weights;
sample xiThe conversion relation between the sum of the leaf node weights and the prediction probability is as follows:
Figure FDA0003462049300000021
in the formula (2), p1iRepresents a sample xiIs a predictive probability of the first class, p2iRepresents a sample xiIs a prediction probability of the second class, p3iRepresents a sample xiA predicted probability of a third class; exp () represents an exponential function;
step five, model parameters of the trained model obtained in the step four are adjusted by using the verification data set in the step two, specifically, classification results of the verification data set are checked by continuously adjusting the model parameters, and finally, optimal model parameters are selected to obtain a parameter-adjusted XGBoost model;
step six, verifying the accuracy of the XGboost model obtained in the step five through the test data set in the step two;
step seven, when the accuracy of the XGboost model is verified to not meet the requirement in the step six, repeating the step one to the step six until the accuracy is achieved; and if the accuracy of the XGboost model meets the requirements in the sixth step, obtaining the verified XGboost model, predicting the real-time working data of the heat tracing band device by using the verified XGboost model to obtain a predicted score, and converting the predicted score into a corresponding service life type, namely the service life state of the current heat tracing band device.
2. The XGboost algorithm-based heat tracing band device life state prediction method as claimed in claim 1, wherein the real tag values in the first step are [1,0,0], [0,1,0] and [0,0,1], and the tag values [1,0,0], [0,1,0] and [0,0,1] correspond to three different life states of normal operation, life warning and short life, respectively.
3. The XGboost algorithm-based service life state prediction method for the heat tracing belt device according to claim 1, wherein the initialization processing of Xgboost model parameters in the third step is specifically as follows:
setting the boost in the general parameters as gbtree; setting eta to be 0.1, gamma to be 0.1, max _ depth to be 5, min _ child _ weight to be 2 and lambda to be 2 in the Booster parameter; the learning target parameters are set as: object is set to multi, softmax, num _ class is set to 3;
wherein gbtree represents a tree-based model, eta represents a learning rate, gamma represents a minimum loss function degradation value required for node splitting, max _ depth represents a maximum depth of the tree, min _ child _ weight represents a minimum leaf node sample weight sum, lambda represents an L2 regularization term of the weight, objective represents a category of return prediction, multi: softmax represents a multi-classifier of softmax, and num _ class is the number of categories.
4. The XGboost algorithm-based method for predicting the life state of the heat tracing belt device according to the claim 3, wherein in the step 4.1, the concrete construction process of constructing the first three trees according to the initial prediction score and the sample real label value comprises the following steps:
4.1.1, constructing a 1 st tree aiming at the first class, and performing node division on a training set sample according to the initial prediction probability and a sample real label value; in the training set sample, the real label value of the sample belonging to the first class is 1, and the real label value of the sample not belonging to the first class is 0;
4.1.2 in the process of node division of the training set sample, when the sum of the weights of the leaf nodes of the tree reaches the minimum leaf node sample weight and min _ child _ weight, or the depth of the tree in the tree reaches the set maximum depth max _ depth of the tree, or the splitting yield reaches a threshold value, the threshold value is set to 0, namely node splitting is stopped, and at this time, the 1 st tree of the first class, namely the 1 st tree of the training model is obtained;
4.1.3 construction of the 1 st trees of the second and third classes, i.e. the 2 nd and 3 rd trees, is performed in the same way.
5. The XGboost algorithm-based method for predicting the life state of the heat tracing belt device according to the claim 4, wherein in the step 4.1.1, the specific method for performing node division on the training samples according to the initial prediction probability and the real label values of the samples comprises the following steps:
4.1.1.1 setting the initial prediction probability P of each sample0Obtaining a first-order partial derivative value and a second-order partial derivative value of a training set sample loss function according to the initial prediction probability and the sample real label value, and obtaining a target function before and after splitting according to the first-order partial derivative value and the second-order partial derivative value;
the first and second partial derivative values of the training set sample loss function are given by:
Figure FDA0003462049300000031
Figure FDA0003462049300000032
wherein, giIs a sample xiFirst derivative of the loss function, hiIs xiSecond derivative of the loss function, yiRepresents a sample xiTrue tag ofThe value of the one or more of the one,
Figure FDA0003462049300000033
represents a sample xiIs predicted to score or sample xiThe sum of the corresponding leaf node weights; initial prediction probability P of each sample in the process of building the first three trees0=0.333;
The objective functions before and after splitting are respectively:
Figure FDA0003462049300000034
Figure FDA0003462049300000035
wherein, the first-order partial derivative value of the left sub-tree is calculated
Figure FDA0003462049300000036
Left sub-tree second order partial derivative value calculation
Figure FDA0003462049300000037
Calculation of first-order partial derivative value of right subtree
Figure FDA0003462049300000038
Calculation of second-order partial derivative value of right subtree
Figure FDA0003462049300000041
IleftIs a left subtree sample set, IrightFor the right subtree sample set, i denotes sample xiλ represents the parameter lambda in step three, γ represents the parameter gamma in step three;
4.1.1.2, calculating the splitting Gain according to the objective function before and after splitting, namely the splitting Gain after splitting is the objective function before splitting-the objective function after splitting, and the splitting Gain after splitting is shown as the following formula:
Figure FDA0003462049300000042
4.1.1.3, calculating the splitting gain corresponding to each eigenvalue of the training data set sample according to the steps 4.1.1.1 to 4.1.1.2, and dividing the nodes by taking the eigenvalue corresponding to the maximum splitting gain as the splitting point.
6. The XGboost algorithm-based heat tracing belt device life state prediction method according to claim 3, characterized in that in step 4.2, the prediction probability P of each sample in the first three trees is determined according tokiAnd carrying out second iteration on the sample real label values to construct 4 th to 6 th trees, wherein the specific construction process is as follows:
4.2.1 construction of 2 nd trees of the first class for the first class, from the predicted probability P of each sample in the class1iAnd a sample real label value, and performing node division on the training set sample, wherein the real label value of the sample belonging to the first type is 1, and the real label value of the sample not belonging to the first type tree is 0; the specific node dividing method comprises the following steps:
4.2.1.1 prediction probability P from each sample1iObtaining a first-order partial derivative value and a second-order partial derivative value of the training set sample loss function according to the sample real label value, and obtaining a target function before and after splitting according to the first-order partial derivative value and the second-order partial derivative value;
the first and second partial derivative values of the training set sample loss function are given by:
Figure FDA0003462049300000043
Figure FDA0003462049300000044
Figure FDA0003462049300000045
wherein, giIs a sample xiFirst derivative of the loss function, hiIs xiSecond derivative of the loss function, yiRepresents a sample xiThe value of the true tag of (a),
Figure FDA0003462049300000046
represents a sample xiIs predicted to score or sample xiThe sum of the corresponding leaf node weights; p1iRepresenting samples x in the first classiA predicted probability of (d);
the objective functions before and after splitting are respectively:
Figure FDA0003462049300000051
Figure FDA0003462049300000052
wherein, the first-order partial derivative value of the left sub-tree is calculated
Figure FDA0003462049300000053
Left sub-tree second order partial derivative value calculation
Figure FDA0003462049300000054
Calculation of first-order partial derivative value of right subtree
Figure FDA0003462049300000055
Calculation of second-order partial derivative value of right subtree
Figure FDA0003462049300000056
IleftIs a left subtree sample set, IrightFor the right subtree sample set, i denotes sample xiλ represents the parameter lambda in step three, γ represents the parameter gamma in step three;
4.2.1.2 calculating the splitting Gain according to the objective function before and after splitting, namely the splitting Gain after splitting is equal to the objective function before splitting Obj1-post-splitting objective function Obj2The cleavage yield Gain after cleavage is shown as follows:
Figure FDA0003462049300000057
4.2.1.3, calculating the splitting profit corresponding to each eigenvalue of the training data set sample according to the steps 4.2.1.1 to 4.2.1.2, and carrying out node division by taking the eigenvalue corresponding to the maximum splitting profit as a splitting point;
4.2.2 in the process of node division of the training set sample, when the sum of the weights of the leaf nodes of the tree reaches the minimum leaf node sample weight and min _ child _ weight, or the depth of the tree in the tree reaches the set maximum depth max _ depth of the tree, or the splitting yield reaches a threshold value, the threshold value is set to 0, namely node splitting is stopped, and at this time, the 2 nd tree of the first class, namely the 4 th tree of the training model is obtained;
4.2.3 construction of the 2 nd trees of the second and third classes was carried out in the same way.
7. The XGboost algorithm-based service life state prediction method for the heat tracing belt device is characterized in that in the fifth step, a specific method for adjusting model parameters through verification data sets is as follows:
firstly, optimizing max _ depth and min _ child _ weight, performing coarse adjustment in a large range, fine adjustment in a small range, and then determining the optimal max _ depth and the optimal min _ child _ weight by using high-load grid search;
secondly, optimizing gamma parameters, and finely adjusting after grid searching to determine an optimal value;
thirdly, adjusting lambda parameters to be optimal;
finally, optimizing the learning rate eta;
the evaluation criterion of parameter tuning is whether the prediction accuracy of the verification data set is improved.
8. The XGboost algorithm-based service life state prediction method for the heat tracing belt device is characterized in that in the sixth step, a specific verification method for the accuracy of the XGboost model is as follows: and predicting the sample data of the verification set by using the training model with the optimized model parameters obtained in the step five to obtain a prediction score, converting the prediction score into a life class, and comparing the life class with the actual life class to obtain relative accuracy, wherein if the accuracy is less than 97%, the step one is restarted.
CN202210020123.6A 2022-01-10 2022-01-10 Service life state prediction method of heat tracing belt device based on XGboost algorithm Pending CN114595624A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210020123.6A CN114595624A (en) 2022-01-10 2022-01-10 Service life state prediction method of heat tracing belt device based on XGboost algorithm

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210020123.6A CN114595624A (en) 2022-01-10 2022-01-10 Service life state prediction method of heat tracing belt device based on XGboost algorithm

Publications (1)

Publication Number Publication Date
CN114595624A true CN114595624A (en) 2022-06-07

Family

ID=81803433

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210020123.6A Pending CN114595624A (en) 2022-01-10 2022-01-10 Service life state prediction method of heat tracing belt device based on XGboost algorithm

Country Status (1)

Country Link
CN (1) CN114595624A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115688588A (en) * 2022-11-04 2023-02-03 自然资源部第一海洋研究所 Sea surface temperature daily change amplitude prediction method based on improved XGB method
CN117649906A (en) * 2024-01-30 2024-03-05 浙江大学 Casting quality prediction method for integrated aluminum alloy structural part, electronic equipment and medium

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115688588A (en) * 2022-11-04 2023-02-03 自然资源部第一海洋研究所 Sea surface temperature daily change amplitude prediction method based on improved XGB method
CN115688588B (en) * 2022-11-04 2023-06-27 自然资源部第一海洋研究所 Sea surface temperature daily variation amplitude prediction method based on improved XGB method
CN117649906A (en) * 2024-01-30 2024-03-05 浙江大学 Casting quality prediction method for integrated aluminum alloy structural part, electronic equipment and medium
CN117649906B (en) * 2024-01-30 2024-04-26 浙江大学 Casting quality prediction method for integrated aluminum alloy structural part, electronic equipment and medium

Similar Documents

Publication Publication Date Title
CN114595624A (en) Service life state prediction method of heat tracing belt device based on XGboost algorithm
CN110782658B (en) Traffic prediction method based on LightGBM algorithm
CN107506865B (en) Load prediction method and system based on LSSVM optimization
CN111860989B (en) LSTM neural network short-time traffic flow prediction method based on ant colony optimization
CN111583031A (en) Application scoring card model building method based on ensemble learning
CN110245390B (en) Automobile engine oil consumption prediction method based on RS-BP neural network
CN115130741A (en) Multi-model fusion based multi-factor power demand medium and short term prediction method
CN110674965A (en) Multi-time step wind power prediction method based on dynamic feature selection
CN110555058A (en) Power communication equipment state prediction method based on improved decision tree
CN113205233A (en) Lithium battery life prediction method based on wolf algorithm and multi-core support vector regression
CN112163376A (en) Extreme random tree furnace temperature prediction control method based on longicorn stigma search
CN108596204B (en) Improved SCDAE-based semi-supervised modulation mode classification model method
CN117034767A (en) Ceramic roller kiln temperature prediction method based on KPCA-GWO-GRU
CN110569883A (en) Air quality index prediction method based on Kohonen network clustering and Relieff feature selection
CN113935557A (en) Same-mode energy consumption big data prediction method based on deep learning
CN114169434A (en) Load prediction method
CN115018191A (en) Carbon emission prediction method based on small sample data
CN115730228A (en) Central air conditioner energy consumption analysis method based on BP neural network
CN113780420B (en) GRU-GCN-based method for predicting concentration of dissolved gas in transformer oil
CN114091360A (en) Multi-model fused voltage transformer error state evaluation method
CN113762591A (en) Short-term electric quantity prediction method and system based on GRU and multi-core SVM counterstudy
Jinlian et al. Long and medium term power load forecasting based on a combination model of GMDH, PSO and LSSVM
CN112598050A (en) Ecological environment data quality control method
CN116882292A (en) Lost circulation overflow early warning method based on LightGBM and anomaly detection algorithm
CN109101683B (en) Model updating method for pyrolysis kettle of coal quality-based utilization and clean pretreatment system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination