Summary of the invention
To solve the above-mentioned deficiency mentioned in the prior art, the present invention provides a kind of use LSTM modeling and forecasting labour need
The method for seeking increment, to obtain high-precision region labour demand incremental forecasting result.
To achieve the above object, the method provided by the invention using LSTM modeling and forecasting labour demand increment, including
Following steps:
S10: designated time period unit recruitment information in the past is collected, recruitment consumer confidence index incremental data is obtained;
S20: modeling the recruitment consumer confidence index incremental data obtained in step S10 using LSTM, obtains following use
Work consumer confidence index incremental forecasting model;
S30: according to the pre- of the following recruitment consumer confidence index incremental forecasting model prediction future designated time period obtained by step S20
Incremental value is surveyed, cumulative recovery is carried out, obtains the following recruitment consumer confidence index;
Wherein, the step S20 is specifically included:
S201: training set and test set are divided into after being standardized to recruitment consumer confidence index incremental data;
S202: initialization LSTM model parameter determines the initial configuration of LSTM model;
S203: study is trained to LSTM model using training set data;
S204: judge to predict whether error meets the requirements, LSTM model parameter is adjusted if being unsatisfactory for, re-starts net
Network training, until error meet demand;
S205: the following recruitment consumer confidence index incremental forecasting model finally determined is obtained.
Further, in step S20, LSTM model parameter include the length of window of training set, hidden layer neuron number,
The number of iterations, oversampling ratio, activation primitive, optimizer, loss function and error-tested value.
Further, in the step S20, the length of window initial value of training set is set as 3, hidden layer neuron number
3 are initially set, the number of iterations initial value is set as 100, and oversampling ratio is initially set 1, and activation primitive initially uses ReLU
Function, optimizer initially use adam function, and loss function initially uses mean_squared_error, and error-tested value is initial
Value is accuracy.
Further, the recruitment consumer confidence index includes that overall recruitment consumer confidence index and branch trade recruitment are prosperous.
Further, according to the unit recruitment acquisition of information recruitment consumer confidence index incremental data being collected into step S10
Specific steps include are as follows:
S101: designated time period unit recruitment information in the past is collected;
S102: according to recruitment index boom calculation formula, the calculating of recruitment consumer confidence index is carried out;
S103: rejecting outliers, outlier processing and processing empty value are carried out to the recruitment consumer confidence index of acquisition;
S104: to treated, recruitment consumer confidence index carries out first-order difference, obtains recruitment consumer confidence index incremental data.
Further, the calculation formula of recruitment consumer confidence index described in step S102:
Recruitment consumer confidence index=(rise enterprise's percentage-number with number and decline enterprise's percentage) * 100+100.
Further, in step S103, exceptional value is detected using 3 σ rules, and passes through Lagrange's interpolation pair
Dealing of abnormal data.
Method provided by the invention using LSTM modeling and forecasting labour demand increment, according to each work post history recruitment
Increment variation carries out mathematical modeling to past recruitment consumer confidence index using LSTM model, obtains the following recruitment consumer confidence index prediction
Model predicts the increment variation of its following consumer confidence index, can effectively improve the accuracy of prediction, is the prison of labour market
Pipe and specific aim policy making provide necessary data reference foundation.
Specific embodiment
It in order to make the object, technical scheme and advantages of the embodiment of the invention clearer, below will be in the embodiment of the present invention
Technical solution be clearly and completely described, it is clear that described embodiments are some of the embodiments of the present invention, rather than
Whole embodiments.Based on the embodiments of the present invention, those of ordinary skill in the art are not making creative work premise
Under every other embodiment obtained, shall fall within the protection scope of the present invention.
Method provided by the invention using LSTM modeling and forecasting labour demand increment, includes the following steps:
S10: designated time period unit recruitment information in the past is collected, recruitment consumer confidence index incremental data is obtained;Specific steps
Including
S101: designated time period unit recruitment information in the past is collected;
S102: according to recruitment index boom calculation formula, the calculating of recruitment consumer confidence index is carried out;
S103: rejecting outliers, outlier processing and processing empty value are carried out to the recruitment consumer confidence index of acquisition;
S104: to treated, recruitment consumer confidence index carries out first-order difference, obtains recruitment consumer confidence index incremental data.
Specifically, arrangement is collected to the unit recruitment data in some region Employment data, obtains at least 3
Year region Employment data, at least contain following field: month, unit i d, with number, unit property, industrial nature;
Then according to recruitment consumer confidence index calculation formula, the calculating of recruitment consumer confidence index is carried out;The formula of recruitment consumer confidence index are as follows:
Recruitment consumer confidence index=(rise enterprise's percentage-number with number and decline enterprise's percentage) * 100+100;
Overall recruitment consumer confidence index, branch trade recruitment consumer confidence index can be calculated using above formula;
Index value > 100 shows that overall labour demand or industry labour demand are in propradation;
Index value < 100 shows that overall labour demand or industry labour demand are in decline state;
To avoid abnormal data from causing larger interference to prediction result, cause final prediction result deviation excessive, to data
Exceptional value and null value detected and carry out respective handling;The present invention uses the method progress based on classical statistics different in implementing
Constant value detection, will be three times in the data judging on standard deviation is exceptional value, that is, statistical 3 σ rule is based on, if data
Obedience or approximate Normal Distribution, under 3 σ principles, exceptional value is defined as in one group of measured value and the deviation of average value
More than the value of 3 times of standard deviations, because the probability that the value except 3 σ of distance average occurs is less than under the hypothesis of normal distribution
0.003。
Specific detection process is as follows:
S1031: initialization counter n=1, setting terminates step number N;
S1032: detection 0.1 confidence level on whether Normal Distribution, if so, entering step S1033;
S1033: generating data to be tested, and calculates the mean value and standard deviation of data column;
S1034: judging whether there is the value except 3 σ, if it does not, exporting result and terminating;
S1035: if there is the value except 3 σ, outlier processing is carried out;
Whether S1036: reaching stop condition N after judging n+1, stop if reaching, output result simultaneously terminate, otherwise into
Enter next round and judges whether there is exceptional value.
After wherein detecting abnormal data in step S1035, can using Lagrange's interpolation to dealing of abnormal data,
It generates new data and replaces former data.
To overall recruitment index boom data or industry-specific recruitment index boom data progress one after treatment
All aggregate datas are converted to incremental data by order difference;Influence of the quantity to prediction result that total amount can be eliminated, from
And improve the accuracy that Future Data is predicted by historical data.
After obtaining the recruitment consumer confidence index incremental data in region past designated time period, step S20 is executed.
S20: modeling the recruitment consumer confidence index incremental data obtained in step S10 using LSTM, obtains following use
Work consumer confidence index incremental forecasting model;
Specifically, time recurrent neural network is modeled using LSTM, obtains the prediction mould of the following recruitment consumer confidence index increment
Type, to be increased according to the following recruitment index boom value in a short time of the prediction such as history recruitment index boom and recruitment incremental value and recruitment
The variation tendency of magnitude.
Wherein, described to include: using LSTM modeling specific steps
S201: training set and test set are divided into after being standardized to recruitment consumer confidence index incremental data;
S202: initialization LSTM model parameter determines the initial configuration of LSTM model;
S203: study is trained to LSTM model using training set data;
S204: judge to predict whether error meets the requirements, LSTM model parameter is adjusted if being unsatisfactory for, re-starts net
Network training, until error meet demand;
S205: the following recruitment consumer confidence index incremental forecasting model finally determined is obtained.
Sample data set is constituted after the recruitment consumer confidence index incremental data obtained in step S10 is standardized,
And sample data set is divided into training set and test set according to a certain percentage, it specifically, can be by sample data set by 7:3's
Ratio cut partition is training set and test set, and it is training set that wherein the time is preceding, and the time is posterior as test set.
After having divided training set and test set, the length of window of training set in LSTM model formation, hidden layer mind are initialized
Through parameters such as first number, the number of iterations, oversampling ratio, activation primitive, optimizer, loss function and error-tested values;
Wherein, the length of window initial value of training set is set as 3, i.e., there are three neurons for the input layer of neural network;By
Future Data is predicted in conventional time series predicting model is the historical data based on many years, once policy vibration occurs,
When there are certain abnormal datas, maximum error will occur for prediction result;By the length of window of training set in the embodiment of the present invention
It is set as 3, i.e., predicts observation time data according to the data of preceding 3 time windows of observation time, can effectively avoids short-term
Policy shakes the influence to prediction result;
The activation primitive initialization of LSTM model uses ReLU function: ReLU activation primitive is acted on each layer defeated
Out, the ability to express of neural network model can be effectively promoted, and computation complexity is lower, faster, while gradient is or not convergence rate
Easily saturation;
The neuron number of the hidden layer of LSTM model is initially set 3: the neuron number of hidden layer is initially set
It is 3, is adapted with the length of window of training set, can reduce the complexity of model and reduces consumption required for model training
Time;
The optimizer initialization of LSTM model uses adam function;It can be effectively reduced noisy samples present in former data
The influence to final calculation result of data improves the precision of final prediction result, and can effectively improve model training and meter
The efficiency of calculation;
The loss function initialization of LSTM model uses mean_squared_error, i.e. mean square error: using mean square error
Difference is used as loss function, can effectively reflect the degree of predicted value and actual value difference, to be conducive to the study of LSTM model parameter
Adjustment, improves the precision of final prediction result;
The prediction error value test value initialization of LSTM model uses accuracy: using mean_squared_
While error is as loss function, using accuracy as prediction error-tested value, it is capable of the essence of final prediction result
Degree;
The number of iterations initializing set of LSTM model is 100: being found in actual test, when the number of iterations is more than 100
Later, the accuracy of model prediction does not have a greater change;The number of iterations is set as 100, is guaranteeing to consider model prediction
Accuracy reduces the time consumed required for model training, improves the efficiency of calculating;
The oversampling ratio initializing set of LSTM model is 1, that is, uses fully sampled method.
After initializing LSTM model parameter, the parameter in LSTM model is iteratively trained using the data in training set,
And the LSTM model after each training is assessed using test set data, judge whether the error of prediction result meets and wants
It asks;Hidden neuron number, the number of iterations, the parameter that LSTM model is adjusted if being unsatisfactory for re-start LSTM model instruction
Practice study;Until the error meet demand of prediction result, the LSTM model finally obtained is the following recruitment consumer confidence index
Incremental forecasting model.
S30: the prediction of the following designated time period is predicted according to the following recruitment consumer confidence index prediction model obtained by step S20
Value carries out cumulative recovery, obtains the following recruitment consumer confidence index;
Specifically, the recruitment scape of the following designated time period is predicted according to the following recruitment consumer confidence index prediction model obtained by S20
The predicted value of gas exponential increment;It is prosperous therefore, it is necessary to obtain recruitment by cumulative summation due to carrying out first-order difference processing before
The predicted value of index;If the recruitment consumer confidence index in Xiamen City in December, 2017 is 99.0239, passes through the following recruitment consumer confidence index and increase
The predicted value for measuring the work consumer confidence index increment in prediction model calculated in January, 2018 is -0.1164, then Xiamen City 2018 1
The recruitment consumer confidence index predicted value of the moon is 99.0239+ (- 0.1164)=98.9075.
It, can according to the market development planning and industry development policy of this area after the predicted value for obtaining recruitment consumer confidence index
With offline in the overall recruitment consumer confidence index of setting, the setting early warning of branch trade recruitment consumer confidence index, the upper limit 110 is paid close attention in such as setting, under
Limit 90, high alarm setting 120, lower limit 80.Between predictive index appears in 110 to 120, there is concern prompt, when predicted value is greater than
When 120, there is warning note.Cooperate the analyses such as recruitment incremental forecasting, recruitment source analysis, employment stability analysis, is finally
The supervision and specific aim policy making of labour market provide necessary data reference foundation.
It is predicted further to verify using the method provided by the invention using LSTM modeling and forecasting labour demand increment
The accuracy of recruitment consumer confidence index illustrates by taking the prediction of Xiamen City's recruitment consumer confidence index future value as an example;Collect Xiamen City 2014
The Employment data in December in June, 2018 carry out recruitment scape according to recruitment index boom calculation formula after being arranged
Gas index calculates;Due to 2 months 2017 artificial amended record data, cause the recruitment consumer confidence index of this month obviously abnormal, it is automatic to detect
Out after this month exceptional value, corresponding data is generated by 3 rank Lagrange's interpolations with the data of historical data relevant month, to this
Month, data were replaced;The recruitment index boom value for obtaining in July, 2016 in June, 2018 in each month is as follows:
It is respectively adopted the method provided by the invention using LSTM modeling and forecasting labour demand increment, and application No. is
A kind of region labour demand incremental forecasting method disclosed in 2018102894172, to Xiamen City in July, 2016 to 2018
The recruitment index boom value in each month in June is predicted that prediction result is as shown in the table:
Serial number |
Month |
Real index |
Predictive index 1 |
Error 1 |
Predictive index 2 |
Error 2 |
1 |
201607 |
100.33 |
100.89 |
0.56 |
99.99 |
-0.34 |
2 |
201608 |
99.20 |
97.65 |
-1.55 |
98.29 |
-0.91 |
3 |
201609 |
99.27 |
100.05 |
0.78 |
99.71 |
0.44 |
4 |
201610 |
99.99 |
100.53 |
0.54 |
99.36 |
-0.63 |
5 |
201611 |
99.88 |
98.04 |
-1.84 |
100.1 |
0.18 |
6 |
201612 |
99.58 |
100.89 |
1.31 |
100.7 |
1.15 |
7 |
201701 |
98.85 |
99.95 |
1.1 |
99.06 |
0.21 |
8 |
201702 |
95.77 |
98.07 |
2.3 |
95.04 |
-0.73 |
9 |
201703 |
101.01 |
98.84 |
-2.17 |
100.8 |
-0.17 |
10 |
201704 |
100.54 |
100.49 |
-0.05 |
101.2 |
0.64 |
11 |
201705 |
98.00 |
97.85 |
-0.15 |
99.29 |
1.29 |
12 |
201706 |
101.70 |
99.94 |
-1.76 |
101.4 |
-0.33 |
13 |
201707 |
101.02 |
101.70 |
0.68 |
101.2 |
0.16 |
14 |
201708 |
94.62 |
98.09 |
3.47 |
95.84 |
1.22 |
15 |
201709 |
97.57 |
98.46 |
0.89 |
97.81 |
0.24 |
16 |
201710 |
96.1132 |
97.683 |
1.57 |
95.14 |
-0.97 |
17 |
201711 |
98.1345 |
98.815 |
0.68 |
98 |
-0.13 |
18 |
201712 |
99.0239 |
97.754 |
-1.27 |
100.4 |
1.37 |
19 |
201801 |
98.90 |
98.44 |
-0.46 |
99.41 |
0.51 |
20 |
201802 |
96.00 |
93.51 |
-2.49 |
96.6 |
0.6 |
21 |
201803 |
99.4752 |
100.53 |
1.05 |
99.25 |
-0.23 |
22 |
201804 |
99.7717 |
97.582 |
-2.19 |
99.64 |
-0.13 |
23 |
201805 |
99.81 |
98.6 |
-1.21 |
99.94 |
0.13 |
24 |
201806 |
98.64 |
99.85 |
1.21 |
98.73 |
0.09 |
Wherein, predictive index 1 is using application No. is a kind of increasings of region labour demand disclosed in 2018102894172
Xiamen this month recruitment consumer confidence index that amount prediction technique is predicted, error of the error 1 between predictive index 1 and real index, i.e.,
Using application No. is a kind of Xiamen that labour demand incremental forecasting method in region is predicted disclosed in 2018102894172 to work as
Error between the of that month practical recruitment consumer confidence index of month recruitment consumer confidence index and Xiamen;Predictive index 2 is provides using the present invention
The Xiamen this month recruitment consumer confidence index predicted using the method for LSTM modeling and forecasting labour demand increment, error 2 is pre-
Survey the error between index 2 and real index, i.e., using provided by the invention using LSTM modeling and forecasting labour demand increment
Error between the of that month practical recruitment consumer confidence index of the method Xiamen this month recruitment consumer confidence index predicted and Xiamen.
As can be seen from the above table, using the method institute provided by the invention using LSTM modeling and forecasting labour demand increment
Predict obtained recruitment consumer confidence index, the error between actual recruitment consumer confidence index is between -0.97~1.37;This
The method using LSTM modeling and forecasting labour demand increment that invention provides predicts recruitment consumer confidence index with higher standard
True property.
Method provided by the invention using LSTM modeling and forecasting labour demand increment, according to each work post history recruitment
Increment variation carries out mathematical modeling to past recruitment consumer confidence index using LSTM model, obtains the following recruitment consumer confidence index prediction
Model predicts the increment variation of its following consumer confidence index, can effectively improve the accuracy of prediction, is the prison of labour market
Pipe and specific aim policy making provide necessary data reference foundation.
Although herein more has used such as LSTM model, training set, test set, hidden layer neuron number, has changed
The terms such as generation number, oversampling ratio, activation primitive, optimizer, loss function, but the possibility using other terms is not precluded
Property.The use of these items is only for be more convenient to describe and explain essence of the invention;It is construed as any one
Additional limitation is disagreed with spirit of that invention.
Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention., rather than its limitations;To the greatest extent
Pipe present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that: its according to
So be possible to modify the technical solutions described in the foregoing embodiments, or to some or all of the technical features into
Row equivalent replacement;And these are modified or replaceed, various embodiments of the present invention technology that it does not separate the essence of the corresponding technical solution
The range of scheme.