CN110929922A - Index trend prediction method and device based on time series data - Google Patents

Index trend prediction method and device based on time series data Download PDF

Info

Publication number
CN110929922A
CN110929922A CN201911088698.6A CN201911088698A CN110929922A CN 110929922 A CN110929922 A CN 110929922A CN 201911088698 A CN201911088698 A CN 201911088698A CN 110929922 A CN110929922 A CN 110929922A
Authority
CN
China
Prior art keywords
trend
index
target
series data
determining
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
CN201911088698.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.)
Beijing Boln Software Ltd By Share Ltd
Original Assignee
Beijing Boln Software Ltd By Share Ltd
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 Beijing Boln Software Ltd By Share Ltd filed Critical Beijing Boln Software Ltd By Share Ltd
Priority to CN201911088698.6A priority Critical patent/CN110929922A/en
Publication of CN110929922A publication Critical patent/CN110929922A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q10/00Administration; Management
    • G06Q10/04Forecasting or optimisation specially adapted for administrative or management purposes, e.g. linear programming or "cutting stock problem"
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q10/00Administration; Management
    • G06Q10/06Resources, workflows, human or project management; Enterprise or organisation planning; Enterprise or organisation modelling
    • G06Q10/067Enterprise or organisation modelling

Landscapes

  • Business, Economics & Management (AREA)
  • Engineering & Computer Science (AREA)
  • Human Resources & Organizations (AREA)
  • Strategic Management (AREA)
  • Economics (AREA)
  • Entrepreneurship & Innovation (AREA)
  • Game Theory and Decision Science (AREA)
  • Development Economics (AREA)
  • Marketing (AREA)
  • Operations Research (AREA)
  • Quality & Reliability (AREA)
  • Tourism & Hospitality (AREA)
  • Physics & Mathematics (AREA)
  • General Business, Economics & Management (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Educational Administration (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The embodiment of the invention discloses an index trend prediction method and device based on time series data, wherein the method comprises the following steps: acquiring time series data of a target index; and respectively inputting the acquired time sequence data of the target index into preset trained models, and determining the final trend of the target index. The obtained time sequence data of the target index is input into different trained models, so that the trend prediction of the target index is realized, and the accuracy of the index trend prediction is improved.

Description

Index trend prediction method and device based on time series data
Technical Field
The invention relates to the technical field of computers, in particular to an index trend prediction method and device based on time series data.
Background
At present, the traditional index trend prediction is to collect relevant indexes of a service system, establish a corresponding single time series model by using a single arima (autoregressive moving average model) algorithm or other single algorithms, and perform data analysis and processing according to historical time series data of the indexes.
However, in practical cases, index data of different distribution characteristics are suitable for using different time series algorithms. For index data with different distribution characteristics, when the traditional arima algorithm or other single time series algorithms such as prophet, holt-winter, xgboost and moving average are used for prediction, the final prediction error rate is larger.
Therefore, how to perform trend prediction on time series data with different distribution characteristics becomes an urgent problem to be solved.
Disclosure of Invention
Because the existing method has the problems, the embodiment of the invention provides an index trend prediction method and device based on time series data.
In a first aspect, an embodiment of the present invention provides an index trend prediction method based on time series data, including:
acquiring time series data of a target index;
and respectively inputting the acquired time sequence data of the target index into preset trained models, and determining the final trend of the target index.
Optionally, the step of inputting the acquired time series data of the target index into a preset number of trained models respectively to determine a final trend of the target index includes:
respectively inputting the acquired time series data of the target indexes into a preset number of trained models to obtain preset number of model output results;
and determining the final trend of the target index according to the output result of the preset number of models.
Optionally, the preset number of model output results includes: and presetting the number of the trends of the target indexes and presetting the relative average error rates of the number corresponding to the trends of the target indexes respectively.
Optionally, the determining the final trend of the target index according to the preset number of model output results includes:
determining the minimum relative average error rate in the relative average error rates of which the preset numbers respectively correspond to the trends of the target indexes;
and determining the final trend of the target index according to the minimum relative average error rate.
Optionally, the determining a final trend of the target indicator according to the minimum relative average error rate includes:
and determining the trend of the target index corresponding to the minimum relative average error rate according to the minimum relative average error rate so as to determine the trend of the target index corresponding to the minimum relative average error rate as the final trend of the target index.
In a second aspect, an embodiment of the present invention further provides an index trend prediction apparatus based on time series data, including: the system comprises a data acquisition module and a final trend determination module;
the data acquisition module is used for acquiring time series data of the target index;
and the final trend determining module is used for respectively inputting the acquired time sequence data of the target indexes into preset number of trained models and determining the final trend of the target indexes.
Optionally, the final trend determining module is specifically configured to:
respectively inputting the acquired time series data of the target indexes into a preset number of trained models to obtain preset number of model output results;
and determining the final trend of the target index according to the output result of the preset number of models.
Optionally, the preset number of model output results includes: and presetting the number of the trends of the target indexes and presetting the relative average error rates of the number corresponding to the trends of the target indexes respectively.
Optionally, the determining the final trend of the target index according to the preset number of model output results includes:
determining the minimum relative average error rate in the relative average error rates of which the preset numbers respectively correspond to the trends of the target indexes;
and determining the final trend of the target index according to the minimum relative average error rate.
Optionally, the determining a final trend of the target indicator according to the minimum relative average error rate includes:
and determining the trend of the target index corresponding to the minimum relative average error rate according to the minimum relative average error rate so as to determine the trend of the target index corresponding to the minimum relative average error rate as the final trend of the target index.
In a third aspect, an embodiment of the present invention further provides an electronic device, including:
at least one processor; and
at least one memory communicatively coupled to the processor, wherein:
the memory stores program instructions executable by the processor, which when called by the processor are capable of performing the above-described methods.
In a fourth aspect, an embodiment of the present invention further provides a non-transitory computer-readable storage medium storing a computer program, which causes the computer to execute the above method.
According to the technical scheme, the acquired time series data of the target index are input into different trained models, trend prediction of the target index is achieved, the trend of the target index corresponding to the minimum relative average error rate is determined as the final trend of the target index, and accuracy of index trend prediction is improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to these drawings without creative efforts.
Fig. 1 is a schematic flowchart of an index trend prediction method based on time series data according to an embodiment of the present invention;
fig. 2 is a schematic structural diagram of an index trend prediction apparatus based on time series data according to an embodiment of the present invention;
fig. 3 is a logic block diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
The following further describes embodiments of the present invention with reference to the accompanying drawings. The following examples are only for illustrating the technical solutions of the present invention more clearly, and the protection scope of the present invention is not limited thereby.
Fig. 1 is a schematic flow chart illustrating an index trend prediction method based on time series data according to this embodiment, and the method includes:
and S11, acquiring time series data of the target index.
Wherein the target index is an index to be predicted.
The time series data is data to be predicted with a time axis.
And S12, respectively inputting the acquired time series data of the target indexes into preset number of trained models, and determining the final trend of the target indexes.
Wherein the trained models include, but are not limited to, a trained xgboost model, a trained arima model, and a trained holt-winter model. In the embodiment of the invention, the preset number is manually determined. And respectively inputting the acquired time series data of the target index into the trained xgboost model, the trained arima model and the trained holt-winter model to determine the final trend of the target index.
According to the method and the device, the acquired time series data of the target index are input into different trained models, the trend prediction of the target index is realized, and the accuracy of the index trend prediction is improved.
Further, on the basis of the above method embodiment, the step of inputting the acquired time series data of the target index into a preset number of trained models respectively to determine a final trend of the target index includes:
respectively inputting the acquired time series data of the target indexes into a preset number of trained models to obtain preset number of model output results;
and determining the final trend of the target index according to the output result of the preset number of models.
In the embodiment of the present invention, the preset number is 3. And respectively inputting the obtained time series data of the target index into a trained xgboost model, a trained arima model and a trained holt-winter model to obtain 3 model output results. The model output results include, but are not limited to, a trend of the target indicator and a relative average error rate corresponding to the trend of the target indicator. And then determining the final trend of the target index according to the 3 trends of the target index and the 3 relative average error rates corresponding to the trends of the target index.
The embodiment of the invention determines the final trend of the target index by using a trained model based on the time sequence data of the target index.
Further, on the basis of the above method embodiment, the outputting of the preset number of models includes: and presetting the number of the trends of the target indexes and presetting the relative average error rates of the number corresponding to the trends of the target indexes respectively.
In the embodiment of the invention, the trend number of the target indexes is the same as the number of the trained models. The number of relative average error rates corresponding to the trend of the target index is also the same as the number of trained models.
In the embodiment of the invention, the trend of the target index is preset, and the relative average error rates of the preset number respectively corresponding to the trends of the target index are the basis for determining the final trend of the target index.
Further, on the basis of the above method embodiment, the determining a final trend of the target index according to the preset number of model output results includes:
determining the minimum relative average error rate in the relative average error rates of which the preset numbers respectively correspond to the trends of the target indexes;
and determining the final trend of the target index according to the minimum relative average error rate.
Wherein a minimum relative average error rate among the relative average error rates corresponding to the tendency of the target index is determined first. And then determining the final trend of the target index according to the minimum relative average error rate.
The embodiment of the invention further determines the final trend of the target index by determining the minimum relative average error rate.
Further, on the basis of the above method embodiment, the determining a final trend of the target index according to the minimum relative average error rate includes:
and determining the trend of the target index corresponding to the minimum relative average error rate according to the minimum relative average error rate so as to determine the trend of the target index corresponding to the minimum relative average error rate as the final trend of the target index.
And determining the trend of the target index corresponding to the minimum relative average error rate. And then taking the trend of the target index corresponding to the minimum relative average error rate as the final trend of the target index.
According to the method and the device, the trend of the target index corresponding to the minimum relative average error rate is used as the final trend of the target index, and the accuracy of index trend prediction is improved.
It should be noted that, in practical cases, time series data of different distribution characteristics are suitable for using different time series algorithms, for example, for periodic time series data, a period length of the time series data is taken as a basis of whether index differences between peaks and troughs are calculated to be equidistant and an extraction distance, and then a threshold-winter model is used to predict the trend of the index in the future, where the prediction precision is high. And the auto _ arima algorithm is used for automatically extracting optimal parameters p, q and d from general time series data with trends, and the prediction accuracy of the established arima model is higher than that of other algorithms. The xgboost algorithm is trained by using the characteristics of the customized time series of the xgboost algorithm, such as dimensions of hour, day, week, day of month, season, etc., as training characteristics of the model. Therefore, a mode of integrating various mainstream algorithms is finally adopted, and an output algorithm model with the minimum relative average error rate is selected for each time series data to predict the trend of the index.
It should be noted here that the trained arima, xgboost and holt-winter models are obtained by the following methods:
first, autoregressive moving average model arima
The establishing of the arima model generally has three stages, and the most core is model identification and order determination:
1 model identification and scaling
The identification problem and the order-fixing problem of the model are mainly to determine three parameters of p, d and q, and the order d of the difference is generally obtained by observing an autocorrelation graph and is 5 as a default. The determination of p and q is mainly described here.
The optimal p, q combination of the models is found by a similar way to the grid search to generate the optimal arima model.
In the arima algorithm, the optimal p, q parameters will be automatically selected.
Two, xgboost for time series modeling
The main process is to construct the features required by the xgboost algorithm. Firstly, a sample set is divided into a training set and a testing set, and then the characteristics of the training set and the testing set are constructed, wherein the characteristics extracted aiming at a single time sequence index variable in the method are as follows:
hour: hour(s)
date of date
A quartz: quarterly
week: the next week
month: month of the year
day of week day
day _ of _ month: days in the month
day of year day
And inputting the constructed time sequence characteristics into an xgboost algorithm training model to obtain higher prediction precision.
Third, holt-winter seasonal prediction model
The prediction function of the holt-winter seasonal prediction model is related to a cubic smoothing function. Wherein the cubic smoothing functions are horizontal functions LtTrend function btAnd a seasonal component StThe smoothing parameters are α and γ.
level Lt=α(yt-St-s)+(1-α)(Lt-1+bt-1)
trend bt=β(Lt-Lt-1)+(1-β)bt-1
seasonal St=γ(yt-Lt)+(1-γ)St-s
forecast Ft+k=Lt+k bt+St+k-s
Wherein s is the length of the seasonal cycle, 0 is equal to or less than α is equal to or less than 1,0 is equal to or less than β is equal to or less than 1,0 is equal to or less than gamma is equal to or less than 1, t represents the time, and k represents the unit of the predicted length.
The level function is a weighted average between seasonally adjusted observations and non-seasonal predictions at time t. The seasonal function is a weighted average between the current seasonal index and the seasonal index of the same season of the last year.
Fig. 2 is a schematic structural diagram illustrating an index trend prediction apparatus based on time series data according to the present embodiment, where the apparatus includes: a data acquisition module 21 and a final trend determination module 22;
the data acquisition module 21 is configured to acquire time series data of a target index;
the final trend determining module 22 is configured to input the acquired time series data of the target index into a preset number of trained models, respectively, and determine a final trend of the target index.
Further, on the basis of the above device embodiment, the final trend determining module 22 is specifically configured to:
respectively inputting the acquired time series data of the target indexes into a preset number of trained models to obtain preset number of model output results;
and determining the final trend of the target index according to the output result of the preset number of models.
Further, on the basis of the above device embodiment, the preset number of model output results includes: and presetting the number of the trends of the target indexes and presetting the relative average error rates of the number corresponding to the trends of the target indexes respectively.
Further, on the basis of the above device embodiment, the determining the final trend of the target index according to the preset number of model output results includes:
determining the minimum relative average error rate in the relative average error rates of which the preset numbers respectively correspond to the trends of the target indexes;
and determining the final trend of the target index according to the minimum relative average error rate.
Further, on the basis of the above device embodiment, the determining a final trend of the target index according to the minimum relative average error rate includes:
and determining the trend of the target index corresponding to the minimum relative average error rate according to the minimum relative average error rate so as to determine the trend of the target index corresponding to the minimum relative average error rate as the final trend of the target index.
FIG. 3 is a logic block diagram of an electronic device according to an embodiment of the invention; the electronic device includes: a processor (processor)31, a memory (memory)32, and a bus 33;
wherein, the processor 31 and the memory 32 complete the communication with each other through the bus 33; the processor 31 is used for calling program instructions in the memory 2 to execute the method provided by the above method embodiment.
An embodiment of the present invention also provides a non-transitory computer-readable storage medium storing a computer program, which causes the computer to execute the above method.
The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware. With this understanding in mind, the above-described technical solutions may be embodied in the form of a software product, which can be stored in a computer-readable storage medium such as ROM/RAM, magnetic disk, optical disk, etc., and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the methods described in the embodiments or some parts of the embodiments.
It should be noted that: the above examples are only intended to illustrate the technical solution of the present invention, but not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

Claims (10)

1. An index trend prediction method based on time series data is characterized by comprising the following steps:
acquiring time series data of a target index;
and respectively inputting the acquired time sequence data of the target index into preset trained models, and determining the final trend of the target index.
2. The index trend prediction method based on time series data according to claim 1, wherein the step of inputting the acquired time series data of the target index into a preset number of trained models respectively to determine the final trend of the target index comprises:
respectively inputting the acquired time series data of the target indexes into a preset number of trained models to obtain preset number of model output results;
and determining the final trend of the target index according to the output result of the preset number of models.
3. The index trend prediction method based on time series data according to claim 2, wherein the preset number of model output results comprises: and presetting the number of the trends of the target indexes and presetting the relative average error rates of the number corresponding to the trends of the target indexes respectively.
4. The index trend prediction method based on time series data of claim 3, wherein the determining the final trend of the target index according to the preset number of model output results comprises:
determining the minimum relative average error rate in the relative average error rates of which the preset numbers respectively correspond to the trends of the target indexes;
and determining the final trend of the target index according to the minimum relative average error rate.
5. The time-series data-based index trend prediction method according to claim 4, wherein the determining a final trend of the target index according to the minimum relative average error rate includes:
and determining the trend of the target index corresponding to the minimum relative average error rate according to the minimum relative average error rate so as to determine the trend of the target index corresponding to the minimum relative average error rate as the final trend of the target index.
6. An index tendency prediction apparatus based on time-series data, characterized by comprising: the system comprises a data acquisition module and a final trend determination module;
the data acquisition module is used for acquiring time series data of the target index;
and the final trend determining module is used for respectively inputting the acquired time sequence data of the target indexes into preset number of trained models and determining the final trend of the target indexes.
7. The time-series data-based index trend prediction device of claim 6, wherein the final trend determination module is specifically configured to:
respectively inputting the acquired time series data of the target indexes into a preset number of trained models to obtain preset number of model output results;
and determining the final trend of the target index according to the output result of the preset number of models.
8. The index trend prediction apparatus based on time-series data according to claim 7,
the preset number of model output results comprise: and presetting the number of the trends of the target indexes and presetting the relative average error rates of the number corresponding to the trends of the target indexes respectively.
9. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the method for index trend prediction based on time-series data according to any one of claims 1 to 5 when executing the program.
10. A non-transitory computer-readable storage medium having stored thereon a computer program, wherein the computer program when executed by a processor implements the method for index trend prediction based on time-series data according to any one of claims 1 to 5.
CN201911088698.6A 2019-11-08 2019-11-08 Index trend prediction method and device based on time series data Pending CN110929922A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911088698.6A CN110929922A (en) 2019-11-08 2019-11-08 Index trend prediction method and device based on time series data

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911088698.6A CN110929922A (en) 2019-11-08 2019-11-08 Index trend prediction method and device based on time series data

Publications (1)

Publication Number Publication Date
CN110929922A true CN110929922A (en) 2020-03-27

Family

ID=69852647

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911088698.6A Pending CN110929922A (en) 2019-11-08 2019-11-08 Index trend prediction method and device based on time series data

Country Status (1)

Country Link
CN (1) CN110929922A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111651444A (en) * 2020-05-25 2020-09-11 成都千嘉科技有限公司 Self-adaptive time series data prediction method
CN112288158A (en) * 2020-10-28 2021-01-29 税友软件集团股份有限公司 Service data prediction method and related device
CN113807556A (en) * 2020-06-15 2021-12-17 青岛海信网络科技股份有限公司 Tourism index prediction method, device, equipment and medium

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111651444A (en) * 2020-05-25 2020-09-11 成都千嘉科技有限公司 Self-adaptive time series data prediction method
CN111651444B (en) * 2020-05-25 2023-04-18 成都千嘉科技股份有限公司 Self-adaptive time series data prediction method
CN113807556A (en) * 2020-06-15 2021-12-17 青岛海信网络科技股份有限公司 Tourism index prediction method, device, equipment and medium
CN112288158A (en) * 2020-10-28 2021-01-29 税友软件集团股份有限公司 Service data prediction method and related device

Similar Documents

Publication Publication Date Title
CN109495318B (en) Mobile communication network flow prediction method, device and readable storage medium
CN110929922A (en) Index trend prediction method and device based on time series data
CN109190808B (en) User behavior prediction method, device, equipment and medium
CN108829718B (en) Data processing method and device
CN112445690B (en) Information acquisition method and device and electronic equipment
CN113705929B (en) Spring festival holiday load prediction method based on load characteristic curve and typical characteristic value fusion
CN110110916A (en) A kind of prediction technique and system of the medical amount of hospital outpatient
CN111415027A (en) Method and device for constructing component prediction model
CN111178537A (en) Feature extraction model training method and device
CN113268403A (en) Time series analysis and prediction method, device, equipment and storage medium
CN113516275A (en) Power distribution network ultra-short term load prediction method and device and terminal equipment
CN110263136B (en) Method and device for pushing object to user based on reinforcement learning model
CN111563236A (en) Short-term wind speed prediction method and device
CN113743650B (en) Power load prediction method, device, equipment and storage medium
CN107330709B (en) Method and device for determining target object
CN113869599A (en) Fish epidemic disease development prediction method, system, equipment and medium
CN116977091A (en) Method and device for determining individual investment portfolio, electronic equipment and readable storage medium
CN104090932A (en) Content recommending method and device
CN111583010A (en) Data processing method, device, equipment and storage medium
CN110826196B (en) Industrial equipment operation data processing method and device
CN112200389A (en) Data prediction method, device, equipment and storage medium
CN109299832A (en) A kind of prediction technique and device of active users
CN110210959A (en) Analysis method, device and the storage medium of financial data
CN111339156B (en) Method, apparatus and computer readable storage medium for long-term determination of business data
CN110647386B (en) Data processing method and device, computer equipment and storage medium

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
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20200327