CN114841757A - Prediction model training method and device and price prediction method and device - Google Patents

Prediction model training method and device and price prediction method and device Download PDF

Info

Publication number
CN114841757A
CN114841757A CN202210610107.2A CN202210610107A CN114841757A CN 114841757 A CN114841757 A CN 114841757A CN 202210610107 A CN202210610107 A CN 202210610107A CN 114841757 A CN114841757 A CN 114841757A
Authority
CN
China
Prior art keywords
price
prediction model
prediction
target
training
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
CN202210610107.2A
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.)
Industrial and Commercial Bank of China Ltd ICBC
Original Assignee
Industrial and Commercial Bank of China Ltd ICBC
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 Industrial and Commercial Bank of China Ltd ICBC filed Critical Industrial and Commercial Bank of China Ltd ICBC
Priority to CN202210610107.2A priority Critical patent/CN114841757A/en
Publication of CN114841757A publication Critical patent/CN114841757A/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
    • G06Q30/00Commerce
    • G06Q30/02Marketing; Price estimation or determination; Fundraising
    • G06Q30/0201Market modelling; Market analysis; Collecting market data
    • G06Q30/0206Price or cost determination based on market factors
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N20/00Machine learning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/004Artificial life, i.e. computing arrangements simulating life
    • G06N3/006Artificial life, i.e. computing arrangements simulating life based on simulated virtual individual or collective life forms, e.g. social simulations or particle swarm optimisation [PSO]

Abstract

The application relates to a training method and device of a prediction model and a price prediction method and device. Relates to the field of artificial intelligence and can be used in the field of financial science and technology. The method comprises the following steps: acquiring price index data corresponding to each index feature from sample price associated data of a plurality of target objects; determining initial price characteristics from all the index characteristics by adopting a characteristic weight algorithm according to price index data corresponding to each index characteristic; determining target price characteristics from all initial price characteristics according to price index data corresponding to the initial price characteristics; and constructing a training set according to price index data corresponding to the target price characteristics, and training the initial prediction model through the training set to obtain the prediction model. By adopting the method, the prediction accuracy of the prediction model can be improved.

Description

Prediction model training method and device and price prediction method and device
Technical Field
The application relates to the field of artificial intelligence, in particular to a training method and device of a prediction model and a price prediction method and device.
Background
Gold, as an important configuration asset in the financial market, has a significant impact on the overall financial macro-market. Because many people use the price trend of gold to judge the emotion of market hedging risk and measure the market risk, finding a method for accurately predicting the price trend of gold has great significance to financial decision-making.
Currently, the mainstream gold price prediction model in the industry is a statistical model. The statistical model predicts the future price trend of gold by a statistical method by collecting a large amount of historical gold price information. Because the statistical model requires a large amount of data and is difficult to popularize, a method for predicting the gold price by using an artificial intelligent model is proposed in the industry, for example, a time series prediction model, a linear regression model and the like are adopted for prediction.
However, when the existing artificial intelligence model is used for predicting the gold price, the problem of low prediction accuracy generally exists.
Disclosure of Invention
In view of the above, it is necessary to provide a method and an apparatus for training a prediction model, and a method and an apparatus for predicting a price.
In a first aspect, the present application provides a method for training a predictive model. The method comprises the following steps:
acquiring price index data corresponding to each index feature from sample price associated data of a plurality of target objects;
determining initial price characteristics from all the index characteristics according to the price index data corresponding to each index characteristic by adopting a characteristic weight algorithm;
determining target price characteristics from all the initial price characteristics according to the price index data corresponding to each initial price characteristic;
and constructing a training set according to the price index data corresponding to the target price characteristics, and training an initial prediction model through the training set to obtain the prediction model.
In one embodiment, the training an initial prediction model through the training set to obtain the prediction model includes:
in the process of training the initial prediction model corresponding to the prediction model through the training set, determining the optimal hyper-parameter of the prediction model by adopting a particle swarm algorithm, updating an inertia factor in the particle swarm algorithm in real time based on historical data in the particle motion process in the process of determining the optimal hyper-parameter of the prediction model by adopting the particle swarm algorithm, and determining the optimal hyper-parameter of the prediction model by adopting the updated particle swarm algorithm.
In one embodiment, the updating the inertia factor in the particle swarm algorithm in real time based on historical data in the particle motion process includes:
determining a historical maximum inertia factor, a historical minimum target value of the particle and a historical maximum target value of the particle in the movement process according to historical data in the movement process of the particle;
determining a first inertia factor adjusting value according to the historical maximum inertia factor, the historical minimum target value of the particles and the historical maximum target value of the particles;
and taking the sum of the historical minimum inertia factor and the first inertia factor adjustment value as the inertia factor of the particle swarm algorithm at the current moment.
In one embodiment, the predictive models include at least two price predictive models, and the method further includes:
determining the precision of each price prediction model;
and determining the prediction weight of each price prediction model according to the precision of each price prediction model, so that when the prediction model is used for predicting the price of the target object, the preliminary prediction results of each price prediction model are subjected to fusion processing according to the prediction weight of each price prediction model to obtain the final prediction result.
In a second aspect, the present application further provides a price prediction method. The method comprises the following steps:
determining price index data corresponding to the target price characteristics from a plurality of price index data of the target object;
predicting price index data corresponding to the target price characteristics through a prediction model to obtain the predicted price of the target object;
the prediction model is obtained by training by adopting any one of the training methods of the prediction models.
In one embodiment, the predicting models include at least two price predicting models, and predicting price index data corresponding to the target price feature through the predicting models to obtain the predicted price of the target object includes:
forecasting price index data corresponding to the target price characteristics through the price forecasting models respectively to obtain a plurality of initial forecasting results;
and performing fusion processing on the plurality of initial prediction results according to the prediction weight of each price prediction model to obtain the predicted price of the target object.
In a third aspect, the application further provides a training device for the prediction model. The device comprises:
the acquisition module is used for acquiring price index data corresponding to each index characteristic from the sample price associated data of the target objects;
the first determining module is used for determining initial price characteristics from all the index characteristics according to the price index data corresponding to each index characteristic by adopting a characteristic weight algorithm;
a second determining module, configured to determine a target price feature from all the initial price features according to the price index data corresponding to each of the initial price features;
and the training module is used for constructing a training set according to the price index data corresponding to the target price characteristic, and training an initial prediction model through the training set to obtain the prediction model.
In one embodiment, the training module is further configured to:
in the process of training the initial prediction model corresponding to the prediction model through the training set, determining the optimal hyper-parameter of the prediction model by adopting a particle swarm algorithm, updating an inertia factor in the particle swarm algorithm in real time based on historical data in the particle motion process in the process of determining the optimal hyper-parameter of the prediction model by adopting the particle swarm algorithm, and determining the optimal hyper-parameter of the prediction model by adopting the updated particle swarm algorithm.
In one embodiment, the training module is further configured to:
determining a historical maximum inertia factor, a historical minimum target value of the particle and a historical maximum target value of the particle in the movement process according to historical data in the movement process of the particle;
determining a first inertia factor adjusting value according to the historical maximum inertia factor, the historical minimum target value of the particles and the historical maximum target value of the particles;
and taking the sum of the historical minimum inertia factor and the first inertia factor adjustment value as the inertia factor of the particle swarm algorithm at the current moment.
In one embodiment, the predictive models include at least two price predictive models, and the apparatus further includes:
a third determining module, configured to determine the accuracy of each price prediction model;
and the fourth determining module is used for determining the prediction weight of each price prediction model according to the precision of each price prediction model, so that when the prediction model is used for predicting the price of a target object, the preliminary prediction results of each price prediction model are subjected to fusion processing according to the prediction weight of each price prediction model, and the final prediction result is obtained.
In a fourth aspect, the present application further provides a price prediction apparatus. The device comprises:
the determining module is used for determining price index data corresponding to the target price characteristics from a plurality of price index data of the target object;
the forecasting module is used for forecasting price index data corresponding to the target price characteristics through a forecasting model to obtain the forecasting price of the target object;
the prediction model is obtained by training by adopting any one of the training methods of the prediction models.
In one embodiment, the prediction model includes at least two price prediction models, and the prediction module is further configured to:
forecasting price index data corresponding to the target price characteristics through the price forecasting models respectively to obtain a plurality of initial forecasting results;
and performing fusion processing on the plurality of initial prediction results according to the prediction weight of each price prediction model to obtain the predicted price of the target object.
In a fifth aspect, the present application further provides a computer device. The computer device comprises a memory storing a computer program and a processor implementing any of the above methods when the processor executes the computer program.
In a sixth aspect, the present application also provides a computer-readable storage medium, having a computer program stored thereon, which, when executed by a processor, implements any of the above methods.
In a seventh aspect, the present application further provides a computer program product. The computer program product, including a computer program, the computer program product, including a computer program that, when executed by a processor, implements any of the above methods.
According to the training method and device and the price prediction method and device of the prediction model, the initial price features are determined from the index features through the feature weight algorithm, the target price features are further determined from the initial price features, namely the index features with high feature effectiveness are selected as the target price features through twice screening of the index features, and then a training set is constructed according to sample price associated data corresponding to the target price features to train the initial prediction model, so that the prediction model is obtained. According to the training method and device for the prediction model and the price prediction method and device, the price associated data of the sample are screened, and only the price associated data which are high in feature effectiveness, namely the price associated data corresponding to the index features with high prediction capability form a training set, so that the situation that redundant data with low prediction capability are input into the initial prediction model for training and interfere with the training of the initial prediction model can be avoided, the prediction accuracy of the prediction model can be improved, and the prediction accuracy of the golden price can be greatly improved by taking the prediction of the golden price as an example.
Drawings
FIG. 1 is a schematic flow chart diagram illustrating a method for training a predictive model according to one embodiment;
FIG. 2 is a schematic flow chart diagram illustrating a method for training a predictive model according to one embodiment;
FIG. 3 is a schematic flow chart diagram illustrating a method for training a predictive model in one embodiment;
FIG. 4 is a flow diagram illustrating a method for price forecasting according to one embodiment;
FIG. 5 is a flowchart of step 404 in one embodiment;
FIG. 6 is a diagram illustrating a method of training a predictive model according to one embodiment;
FIG. 7 is a block diagram showing an example of a device for training a predictive model;
FIG. 8 is a block diagram of a price forecasting apparatus in one embodiment;
FIG. 9 is a diagram illustrating an internal structure of a computer device according to an embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
In an embodiment, as shown in fig. 1, a method for training a prediction model is provided, and this embodiment is illustrated by applying the method to a terminal, it is to be understood that the method may also be applied to a server, and may also be applied to a system including a terminal and a server, and is implemented by interaction between the terminal and the server. In this embodiment, the method includes the steps of:
step 102, obtaining price index data corresponding to each index feature from the sample price related data of a plurality of target objects.
In the embodiment of the present application, the index feature refers to a category of sample price association data of the target object. For example, the target object may be an item to be price predicted, such as: in the examples of the present application, the following describes examples of articles such as gold, petroleum, and precious metals, with gold being the target. The target characteristics may include a dollar Index, a dollar-to-japanese-dollar rate, a U.S. currency expansion expectation, a U.S. actual interest rate, a Brent crude oil price, a VIX panic Index (also known as Volatility Index), a flat option Volatility, a gold stock Index, and the like.
After the price index data corresponding to each index feature is obtained, the price index data may be preprocessed, for example, missing price index data is sampled, the missing price index data is filled with a mean value of contemporaneous price index data of adjacent years, and the data is normalized. Detailed description of the specific process is omitted in this embodiment, and any manner that can implement the above preprocessing operation is suitable for this embodiment.
And 104, determining initial price characteristics from all the index characteristics by adopting a characteristic weight algorithm according to price index data corresponding to each index characteristic.
In the embodiment of the application, a characteristic weight algorithm can be adopted to determine the initial price characteristic from each index characteristic according to the price index data corresponding to each index characteristic. For example, a feature weight algorithm may be adopted to determine a feature weight of each index feature, and rank the feature weights of the index features from high to low, and determine the index feature with a higher feature weight as the target index feature. For example, taking as an example index features including a dollar index, a dollar-to-japanese-dollar exchange rate, a U.S. currency expansion expectation, a U.S. actual interest rate, a breent crude oil price, a VIX panic index, a flat option volatility, a gold mine stock index, the initial price features may include: dollar index, dollar exchange rate, U.S. currency expansion expectation, U.S. actual interest rate, Brent crude oil price, flat rate option volatility.
It should be noted that, in the embodiment of the present application, a feature weight algorithm is not specifically limited, and any algorithm that can determine the feature weight of each index feature according to the price index data corresponding to each index feature is suitable for the embodiment of the present application.
Taking the feature weight algorithm as the ReliefF algorithm as an example, the ReliefF algorithm is a multi-class feature extraction algorithm. In this embodiment, the price index data may be divided into a plurality of sample groups according to the gold price corresponding to the price index data and the gold price interval. For example, the price index data corresponding to the gold price between 285 and 295 yuan/gram is one sample set, the price index data corresponding to the gold price between 295 and 305 yuan/gram is another sample set, and so on. Firstly, randomly taking out a price index data a from all price index data by a Relieff algorithm; taking out k nearest neighbor samples of the price index data a from a sample group classified as the same as the price index data a, and recording the k nearest neighbor samples as a set H; in all other sample groups classified differently from the price index data a, k nearest neighbor samples of the price index data a are also taken out respectively and are recorded as a set M; then, for any feature a, the algorithm calculates a first average of the difference between each element in the set H and a on the feature a and a second average of the difference between each element in the set M and a on the feature a, and determines the feature weight of the feature a according to the first and second averages. And further, the initial price characteristic can be determined from the index characteristics according to the characteristic weight of each index characteristic.
And 106, determining target price characteristics from all the initial price characteristics according to the price index data corresponding to the initial price characteristics.
In the embodiment of the application, after the initial price features are screened out from all the index features, secondary screening can be performed on the initial price features so as to determine the target price features from the initial price features.
For example, the target price feature may be determined from the initial price features by determining a feature importance of each initial price feature, for example, selecting an initial price feature with a feature importance greater than a threshold as the target price feature, and the like. The specific value of the threshold in the embodiment of the present application is not particularly limited, and may be selected by a person skilled in the art according to experience.
For example, a random forest algorithm may be used to perform a secondary filtering on the initial price features to determine target price features from the initial price features. A random forest algorithm may be employed to determine the feature importance of each initial price feature. The random forest is composed of a plurality of decision trees, when a bag method is adopted to train a random forest algorithm and construct the decision trees, the random forest algorithm only uses 2/3 training set data, and in addition, 1/3 unused training set data are called as out-of-bag data and can be used for evaluating the importance of each feature in the training set. For example, when determining the feature importance of each initial price feature, for a certain initial price feature X, the embodiment of the present application may first predict the data outside the bag by using a certain decision tree in the random forest to obtain the prediction result XT 1 . And then, assigning a new value to the value of the initial price characteristic X in each piece of data outside the bag, and predicting the data outside the bag with the value of the initial price characteristic X assigned with the new value by adopting the decision tree to obtain a prediction result XT 2 . The characteristic importance of the initial price characteristic X on the decision tree is XT 1 And XT 2 The difference of (a). The above process is repeated for a plurality of decision trees, and the feature importance of the initial price feature X on each decision tree is averaged, so that the feature importance of the initial price feature X can be obtained, and further, the target price feature can be determined from the initial price feature according to the feature importance of each initial price feature.
It should be noted that the random forest algorithm is only an example of determining the target price feature in the embodiment of the present application, and any manner of actually performing feature extraction and distinguishing from the feature weight algorithm used in step 104 is applicable to the embodiment of the present application, so that the problem that the feature weight algorithm used in step 104 has an error and an index feature with low actual prediction capability is misjudged as a feature weight, so as to improve the accuracy of the finally extracted target price feature.
It should be noted that the target price feature is not necessarily a part of the initial price features, and if the feature importance of all the initial price features is greater than the threshold, all the initial price features may be selected as the target price features. Taking initial price characteristics as a dollar index, dollar-to-japanese-dollar exchange rate, U.S. currency expansion expectation, U.S. actual interest rate, Brent crude oil price, flat-rate option volatility as examples, the target price characteristics may include: dollar index, dollar exchange rate, U.S. currency expansion expectation, U.S. actual interest rate, Brent crude oil price, flat rate option volatility.
And 108, constructing a training set according to the price index data corresponding to the target price characteristics, and training the initial prediction model through the training set to obtain the prediction model.
In the embodiment of the application, a training set can be constructed according to price index data corresponding to target price characteristics obtained after the index characteristics are screened twice, and then the initial prediction model is trained to obtain a prediction model capable of predicting the price of a target object.
It should be noted that, the structure and the training process of the initial prediction model are not specifically limited in the embodiments of the present application. All the initial prediction model capable of predicting the target object price and the training mode capable of training the initial prediction model to obtain the trained prediction model are suitable for the embodiment of the application. For example, the initial prediction model may include a prophet model, an ARIMA model (differential Integrated Moving Average Autoregressive model), and the like.
According to the training method of the prediction model, initial price features are determined from all the index features through a feature weight algorithm, then target price features are further determined from all the initial price features, namely the index features with high feature effectiveness are selected as the target price features through twice screening of the index features, and then a training set is constructed according to sample price associated data corresponding to the target price features to train the initial prediction model, so that the prediction model is obtained. According to the training method of the prediction model, the price associated data of the sample is screened, only the price associated data which is high in feature effectiveness, namely the price associated data corresponding to the index features with high prediction capability, form a training set, and therefore the situation that redundant data with low prediction capability is input into the initial prediction model to be trained and causes interference to the training of the initial prediction model can be avoided, the prediction accuracy of the prediction model can be improved, and the prediction accuracy of the gold price can be greatly improved by taking the prediction gold price as an example.
In one embodiment, in step 108, training the initial prediction model through a training set to obtain a prediction model, including:
in the process of training the initial prediction model corresponding to the prediction model through the training set, the optimal hyper-parameter of the prediction model is determined by adopting the particle swarm algorithm, in the process of determining the optimal hyper-parameter of the prediction model by adopting the particle swarm algorithm, the inertial factor in the particle swarm algorithm is updated in real time based on historical data in the particle motion process, and the updated particle swarm algorithm is adopted to determine the optimal hyper-parameter of the prediction model.
The hyper-parameters are external parameters which need to be set manually in each prediction model, such as the order, the iteration times, the batch size and the like. The inertia factor is a parameter for controlling the particles to keep the original speed capability in the particle swarm algorithm, larger inertia factor is more beneficial to global search of the particles, and smaller inertia factor is more beneficial to local search of the particles.
In the embodiment of the application, the inertia factor value of each particle in the particle swarm algorithm can be updated based on the historical data in the particle motion process, and then the optimal hyper-parameter of each initial prediction model is determined according to the updated particle swarm algorithm. When the optimal hyper-parameter of an initial prediction model is determined according to the particle swarm algorithm, namely, the optimal value of the hyper-parameter of the initial prediction model is searched, the hyper-parameter of the initial prediction model can be set as the coordinate of the particle in the n-dimensional space, and the optimal solution searched in the n-dimensional space by the particle swarm algorithm is the optimal value of the hyper-parameter of the initial prediction model.
According to the training method for the prediction models, the particle swarm algorithm can be updated by updating the inertia factors in the particle swarm algorithm, and then the optimal hyper-parameters of each initial prediction model are determined through the updated particle swarm algorithm. Due to the fact that the inertia factors control the global searching and local searching capability of the particles, the inertia factors of the particle swarm algorithm are adjusted, the speed of the particles reaching the optimal solution can be increased, the accuracy of the particles searching the optimal solution can be improved, and the training speed of the initial prediction model can be further increased.
In one embodiment, as shown in fig. 2, the method comprises:
step 202, determining a historical maximum inertia factor, a historical minimum target value and a historical maximum target value of the particles in the movement process according to historical data in the movement process of the particles.
The historical maximum inertia factor is the maximum value of all the inertia factor values which are taken by the particles in the moving process, the historical minimum inertia factor is the minimum value of all the inertia factor values which are taken by the particles in the moving process, the historical minimum target value of the particles is the minimum value of all the objective function values which are taken by the particles in the moving process, and the historical maximum target value of the particles is the maximum value of all the objective function values which are taken by the particles in the moving process.
And 204, determining a first inertia factor adjustment value according to the historical maximum inertia factor, the historical minimum inertia factor, the particle historical minimum target value and the particle historical maximum target value.
In the embodiment of the application, the first inertia factor adjustment value is used for adjusting an inertia factor value of the particle in the movement process, and is positively correlated with a difference value between the historical maximum inertia factor and the historical minimum inertia factor and negatively correlated with a difference value between the historical maximum target value and the historical minimum target value of the particle. For example, the first inertia factor adjustment value may be determined by subtracting the historical maximum inertia factor from the historical minimum inertia factor, multiplying the result by the difference between the current target value of the particle (i.e., the value of the objective function of the particle at the current time) and the historical minimum target value of the particle, and dividing by the difference between the historical maximum target value of the particle and the historical minimum target value of the particle (see formula (one)):
Figure BDA0003672918700000101
wherein, theta is a first inertia factor adjusting value omega max Is the historical maximum inertia factor, ω min Is the historical minimum inertia factor, f is the current target value of the particle, f min As the minimum target value of particle history, f max Is the maximum target value of the particle history.
And step 206, taking the sum of the historical minimum inertia factor and the first inertia factor adjustment value as the inertia factor of the particle swarm algorithm at the current moment.
In the embodiment of the present application, the historical minimum inertia factor and the first inertia factor adjustment value may be summed to obtain the inertia factor of the particle swarm optimization at the current time (see formula (ii)):
ω=ω min + theta (two formula)
Wherein, ω is an inertia factor of the particle swarm algorithm at the current moment, ω is min And theta is a historical minimum inertia factor, and theta is a first inertia factor adjusting value.
According to the training method of the prediction model, the inertia factor of the particle at the current moment can be adjusted according to the historical data of the particle in the motion process. Due to the fact that the inertia factors control the global searching and local searching capability of the particles, the inertia factors of the particle swarm algorithm are adjusted, the speed of the particles reaching the optimal solution can be increased, the accuracy of the particles searching the optimal solution can be improved, and the training speed of the initial prediction model can be further increased.
In one embodiment, as shown in fig. 3, the prediction model includes at least two price prediction models, and the method further includes:
step 302, determining the accuracy of each price prediction model.
In the embodiment of the application, the precision of the price prediction model is used for representing the capability of accurately predicting the price of the future target object when the price prediction model predicts according to the price index data. After the price prediction model is trained, the price prediction model is checked by adopting data which is not used in the training process, and the prediction weight of each price prediction model is determined according to the precision of each price prediction model obtained in the checking process.
In the embodiments of the present application, the method of determining the accuracy of each price prediction model is not particularly limited. All the modes of determining the precision of each price prediction model when each price prediction model is checked are suitable for the embodiment of the application.
And 304, determining the prediction weight of each price prediction model according to the precision of each price prediction model, so that when the target object price is predicted by adopting the prediction models, the preliminary prediction results of each price prediction model are fused according to the prediction weight of each price prediction model to obtain the final prediction result.
In the embodiment of the present application, the prediction weight of each price prediction model may be further determined according to the accuracy of each price prediction model obtained in the above steps. For example, for any price prediction model, the ratio of the precision of the price prediction model to the sum of the precision of all price prediction models can be used as the prediction weight of the price prediction model. For example, in the case where the prediction model includes two price prediction models, i.e., a prophet model and an ARIMA model, respectively, if the accuracy of the prophet model is 71.3% and the accuracy of the ARIMA model is 66.7%, the prediction weight of the prophet model may be 71.3%/(71.3% + 66.7%), and the prediction weight of the ARIMA model may be 66.7%/(71.3% + 66.7%).
According to the training method of the prediction model, the prediction weight of each price prediction model can be determined according to the precision of each price prediction model. According to the embodiment of the application, the low-precision price prediction model is low in prediction weight, the high-precision price prediction model is high in prediction weight, and therefore when the target object price is predicted by the prediction model constructed through the embodiment of the application, the prediction precision of the target object price can be further improved.
In an embodiment, as shown in fig. 4, a price prediction method is provided, and this embodiment is illustrated by applying the method to a terminal, and it is to be understood that the method may also be applied to a server, and may also be applied to a system including the terminal and the server, and is implemented by interaction between the terminal and the server. In this embodiment, the method includes the steps of:
step 402, determining price index data corresponding to the target price characteristic from a plurality of price index data of the target object.
Step 404, predicting price index data corresponding to the target price characteristics through a prediction model to obtain a predicted price of the target object; the prediction model is obtained by training by adopting any one of the training methods of the prediction models.
In the embodiment of the present application, the target object may be an item to be subjected to price prediction, for example: examples of the present application include gold, petroleum, and noble metals, and the examples of the present application are described with reference to gold as an example of the target object. The target price characteristics are target price characteristics obtained by twice screening the index characteristics in the training method of the prediction model, and for example, if the target price characteristics obtained in the training method of the prediction model are a dollar index, a dollar-in-japanese-dollar exchange rate, a U.S. currency expansion expectation, an U.S. actual interest rate, a Brent crude oil price, and a flat-price option fluctuation rate, in the present embodiment, the target price characteristics are also the dollar index, the dollar-in-japanese-dollar exchange rate, the U.S. currency expansion expectation, the U.S. actual interest rate, the Brent crude oil price, and the flat-price option fluctuation rate.
According to the price prediction method provided by the embodiment of the application, the prediction model obtained by training through the training method of the prediction model is adopted, and the price of the target object is predicted according to the price index data corresponding to the target price characteristic with strong prediction capability. The training method of the prediction model is used for screening sample associated data when the prediction model is trained, only price associated data corresponding to index features with high feature effectiveness, namely index features with high prediction capability, are combined into a training set, and redundant data with low prediction capability are prevented from being input into the initial prediction model to be trained, so that interference on training of the initial prediction model is avoided, and the prediction accuracy of the prediction model is improved.
In one embodiment, as shown in fig. 5, the prediction model includes at least two price prediction models, and in step 404, predicting price index data corresponding to the target price feature by using the prediction model to obtain a predicted price of the target object includes:
and 502, respectively predicting price index data corresponding to the target price characteristics through each price prediction model to obtain a plurality of initial prediction results.
And step 504, performing fusion processing on the plurality of initial prediction results according to the prediction weight of each price prediction model to obtain the predicted price of the target object.
In the embodiment of the present application, the initial prediction results of each price prediction model may be obtained by using the price index data corresponding to the target price features of each price prediction model included in the prediction model, and the initial prediction results are subjected to fusion processing according to the prediction weight of each price prediction model, for example: and according to the prediction weight of each price prediction model, weighting and summing the initial prediction results, and the like to obtain the final price prediction result of the target object.
According to the price prediction method provided by the embodiment of the application, the price index data can be predicted by adopting a plurality of price prediction models, the initial prediction results of the price prediction models are obtained, and then the initial prediction results are fused according to the prediction weights of the price prediction models. According to the price prediction method and device, due to the fact that the price prediction models are adopted for prediction, errors generated in the prediction process of each price prediction model can be made up, the problem that the prediction accuracy of a single price prediction model is insufficient is solved, and the price prediction accuracy of the target object can be improved.
In order to make the embodiments of the present application better understood by those skilled in the art, the embodiments of the present application are described below by specific examples.
Illustratively, as shown in FIG. 6, a flow chart of a method of training a predictive model is shown. In the embodiments of the present application, the target object is taken as gold as an example, and the embodiments of the present application are described.
When an initial prediction model is trained to obtain a prediction model, the embodiment of the application needs to determine the optimal hyper-parameter of the initial prediction model. In the embodiment of the application, the optimal hyper-parameter of the initial prediction model can be determined through a particle swarm algorithm. The step of determining the optimal hyper-parameter by using the particle swarm algorithm may refer to the description related to the foregoing embodiments, and the embodiments of the present application are not described herein again.
When the optimal hyper-parameter of the initial prediction model is determined through the particle swarm algorithm, the particle swarm algorithm can be updated. The particle swarm algorithm has the defects that a local optimal solution is easy to fall into when a target is searched, so that a global optimal solution cannot be searched, and the searching precision is low. Aiming at the defect of the particle swarm optimization, the embodiment of the application updates the inertia factor in the particle swarm optimization in real time when the particle swarm optimization is searched based on historical data in the particle motion process. The step of updating the inertia factor in the particle swarm algorithm in real time may refer to the description of the foregoing embodiments, and the embodiments of the present application are not described herein again.
After the optimal hyper-parameter of the initial prediction model is determined, the embodiment of the application trains the initial prediction model. In the training process of the initial prediction model, the embodiment of the application can screen each index feature in the sample price related data, and only constructs a training set according to the index feature with higher feature effectiveness, namely the price index data corresponding to the target price feature. The step of screening the index features may refer to the related description of the foregoing embodiments, and the embodiments of the present application are not described herein again.
In the embodiment of the application, 80% of data in the price index data corresponding to the target price features is used for training the initial prediction model, after the initial prediction model is trained to obtain each price prediction model, the precision of each price prediction model is checked by using the remaining 20% of data in the price index data corresponding to the target price features, and the prediction weight of each price prediction model is determined according to the precision of each price prediction model.
When the prediction model is actually used to predict the gold price, the embodiment of the application needs to determine price index data corresponding to the target price characteristic from a plurality of gold price index data. The target price features are selected when the prediction model is trained.
The embodiment of the application can further predict price index data corresponding to the target price characteristics through the prediction model to obtain the predicted gold price.
According to the training method of the prediction model, initial price features are determined from all the index features through a feature weight algorithm, then target price features are further determined from all the initial price features, namely the index features with high feature effectiveness are selected as the target price features through twice screening of the index features, and then a training set is constructed according to sample price associated data corresponding to the target price features to train the initial prediction model, so that the prediction model is obtained. According to the training method of the prediction model, the price associated data of the sample is screened, only the price associated data which is high in feature effectiveness, namely the price associated data corresponding to the index features with high prediction capability, form a training set, and therefore the situation that redundant data with low prediction capability is input into the initial prediction model to be trained and causes interference to the training of the initial prediction model can be avoided, and the prediction accuracy of the prediction model can be improved.
It should be understood that, although the steps in the flowcharts related to the embodiments as described above are sequentially displayed as indicated by arrows, the steps are not necessarily performed sequentially as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least a part of the steps in the flowcharts related to the embodiments described above may include multiple steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, and the execution order of the steps or stages is not necessarily sequential, but may be rotated or alternated with other steps or at least a part of the steps or stages in other steps.
Based on the same inventive concept, the embodiment of the present application further provides a training device of the prediction model for implementing the above-mentioned training method of the prediction model. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme described in the above method, so the specific limitations in the embodiment of the training device for one or more prediction models provided below can refer to the limitations on the training method for the prediction models in the above description, and are not described herein again.
In one embodiment, as shown in fig. 7, there is provided a training apparatus for a predictive model, including: an obtaining module 702, a first determining module 704, a second determining module 706, and a training module 708, wherein:
an obtaining module 702, configured to obtain price index data corresponding to each index feature from sample price related data of multiple target objects;
a first determining module 704, configured to determine, by using a feature weight algorithm, an initial price feature from all the index features according to the price index data corresponding to each index feature;
a second determining module 706, configured to determine a target price feature from all the initial price features according to the price index data corresponding to each of the initial price features;
the training module 708 is configured to construct a training set according to the price index data corresponding to the target price feature, and train an initial prediction model through the training set to obtain the prediction model.
According to the training device for the prediction model, the initial price features are determined from the index features through the feature weight algorithm, the target price features are further determined from the initial price features, namely the index features with high feature effectiveness are selected as the target price features through twice screening of the index features, and then a training set is constructed according to sample price associated data corresponding to the target price features to train the initial prediction model, so that the prediction model is obtained. The training device for the prediction model, provided by the embodiment of the application, screens sample price associated data, only has higher feature validity, namely, the price associated data corresponding to the index features with stronger prediction capability form a training set, so that redundant data with weaker prediction capability can be prevented from being input into the initial prediction model for training, interference is caused to the training of the initial prediction model, the prediction accuracy of the prediction model can be further improved, and the prediction accuracy of the gold price can be greatly improved by taking the prediction gold price as an example.
In one embodiment, the training module 708 is further configured to:
in the process of training the initial prediction model corresponding to the prediction model through the training set, determining the optimal hyper-parameter of the prediction model by adopting a particle swarm algorithm, updating an inertia factor in the particle swarm algorithm in real time based on historical data in the particle motion process in the process of determining the optimal hyper-parameter of the prediction model by adopting the particle swarm algorithm, and determining the optimal hyper-parameter of the prediction model by adopting the updated particle swarm algorithm.
In one embodiment, the training module 708 is further configured to:
determining a historical maximum inertia factor, a historical minimum target value of the particle and a historical maximum target value of the particle in the movement process according to historical data in the movement process of the particle;
determining a first inertia factor adjusting value according to the historical maximum inertia factor, the historical minimum target value of the particles and the historical maximum target value of the particles;
and taking the sum of the historical minimum inertia factor and the first inertia factor adjustment value as the inertia factor of the particle swarm algorithm at the current moment.
In one embodiment, the apparatus further comprises:
a third determining module, configured to determine the accuracy of each price prediction model;
and the fourth determining module is used for determining the prediction weight of each price prediction model according to the precision of each price prediction model, so that when the prediction model is used for predicting the price of the target object, the preliminary prediction results of each price prediction model are subjected to fusion processing according to the prediction weight of each price prediction model to obtain the final prediction result.
In one embodiment, as shown in fig. 8, there is provided a price prediction apparatus including: a determination module 802 and a prediction module 804, wherein:
a determining module 802, configured to determine price index data corresponding to the target price feature from multiple price index data of the target object;
the prediction module 804 is configured to predict price index data corresponding to the target price feature through a prediction model to obtain a predicted price of the target object;
the prediction model is obtained by training by adopting any one of the training methods of the prediction models.
The price prediction device provided by the embodiment of the application adopts the prediction model obtained by training through the training method of the prediction model, and predicts the price of the target object according to the price index data corresponding to the target price characteristic with strong prediction capability. The training method of the prediction model is used for screening sample associated data when the prediction model is trained, only price associated data corresponding to index features with high feature effectiveness, namely index features with high prediction capability, are combined into a training set, and redundant data with low prediction capability are prevented from being input into the initial prediction model to be trained, so that interference on training of the initial prediction model is avoided, and the prediction accuracy of the prediction model is improved.
In one embodiment, the prediction model includes at least two price prediction models, and the prediction module 804 is further configured to:
forecasting price index data corresponding to the target price characteristics through the price forecasting models respectively to obtain a plurality of initial forecasting results;
and performing fusion processing on the plurality of initial prediction results according to the prediction weight of each price prediction model to obtain the predicted price of the target object.
The modules in the training device of the prediction model can be wholly or partially realized by software, hardware and a combination thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as shown in fig. 9. The computer device includes a processor, a memory, and a network interface connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement a method of training a predictive model.
Those skilled in the art will appreciate that the architecture shown in fig. 9 is merely a block diagram of some of the structures associated with the disclosed aspects and is not intended to limit the computing devices to which the disclosed aspects apply, as particular computing devices may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, a computer device is provided, comprising a memory and a processor, the memory having stored therein a computer program, the processor implementing the steps of the above-described method embodiments when executing the computer program.
In an embodiment, a computer-readable storage medium is provided, on which a computer program is stored which, when being executed by a processor, carries out the steps of the above-mentioned method embodiments.
In an embodiment, a computer program product is provided, comprising a computer program which, when being executed by a processor, carries out the steps of the above-mentioned method embodiments.
It should be noted that, the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, presented data, etc.) referred to in the present application are information and data authorized by the user or sufficiently authorized by each party.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, databases, or other media used in the embodiments provided herein can include at least one of non-volatile and volatile memory. The nonvolatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical Memory, high-density embedded nonvolatile Memory, resistive Random Access Memory (ReRAM), Magnetic Random Access Memory (MRAM), Ferroelectric Random Access Memory (FRAM), Phase Change Memory (PCM), graphene Memory, and the like. Volatile Memory can include Random Access Memory (RAM), external cache Memory, and the like. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM), among others. The databases referred to in various embodiments provided herein may include at least one of relational and non-relational databases. The non-relational database may include, but is not limited to, a block chain based distributed database, and the like. The processors referred to in the embodiments provided herein may be general purpose processors, central processing units, graphics processors, digital signal processors, programmable logic devices, quantum computing based data processing logic devices, etc., without limitation.
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the present application. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present application shall be subject to the appended claims.

Claims (11)

1. A method of training a predictive model, the method comprising:
acquiring price index data corresponding to each index feature from sample price associated data of a plurality of target objects;
determining initial price characteristics from all the index characteristics according to the price index data corresponding to each index characteristic by adopting a characteristic weight algorithm;
determining target price characteristics from all the initial price characteristics according to the price index data corresponding to each initial price characteristic;
and constructing a training set according to the price index data corresponding to the target price characteristics, and training an initial prediction model through the training set to obtain the prediction model.
2. The method of claim 1, wherein the training an initial predictive model through the training set to obtain the predictive model comprises:
in the process of training the initial prediction model corresponding to the prediction model through the training set, determining the optimal hyper-parameter of the prediction model by adopting a particle swarm algorithm, updating an inertia factor in the particle swarm algorithm in real time based on historical data in the particle motion process in the process of determining the optimal hyper-parameter of the prediction model by adopting the particle swarm algorithm, and determining the optimal hyper-parameter of the prediction model by adopting the updated particle swarm algorithm.
3. The method of claim 2, wherein the updating the inertia factor in the particle swarm algorithm in real time based on historical data during particle motion comprises:
determining a historical maximum inertia factor, a historical minimum target value of the particle and a historical maximum target value of the particle in the movement process according to historical data in the movement process of the particle;
determining a first inertia factor adjusting value according to the historical maximum inertia factor, the historical minimum target value of the particles and the historical maximum target value of the particles;
and taking the sum of the historical minimum inertia factor and the first inertia factor adjustment value as the inertia factor of the particle swarm algorithm at the current moment.
4. The method according to any one of claims 1 to 3, wherein the predictive models comprise at least two price predictive models, the method further comprising:
determining the precision of each price prediction model;
and determining the prediction weight of each price prediction model according to the precision of each price prediction model, so that when the prediction model is used for predicting the price of the target object, the preliminary prediction results of each price prediction model are subjected to fusion processing according to the prediction weight of each price prediction model to obtain the final prediction result.
5. A method of price prediction, the method comprising:
determining price index data corresponding to the target price characteristics from a plurality of price index data of the target object;
predicting price index data corresponding to the target price characteristics through a prediction model to obtain the predicted price of the target object;
wherein the prediction model is obtained by training by using the training method of the prediction model of any one of claims 1 to 4.
6. The method of claim 5, wherein the prediction model comprises at least two price prediction models, and the predicting price index data corresponding to the target price feature by the prediction model to obtain the predicted price of the target object comprises:
forecasting price index data corresponding to the target price characteristics through the price forecasting models respectively to obtain a plurality of initial forecasting results;
and performing fusion processing on the plurality of initial prediction results according to the prediction weight of each price prediction model to obtain the predicted price of the target object.
7. An apparatus for training a predictive model, the apparatus comprising:
the acquisition module is used for acquiring price index data corresponding to each index characteristic from the sample price associated data of the target objects;
the first determining module is used for determining initial price characteristics from all the index characteristics according to the price index data corresponding to each index characteristic by adopting a characteristic weight algorithm;
a second determining module, configured to determine a target price feature from all the initial price features according to the price index data corresponding to each of the initial price features;
and the training module is used for constructing a training set according to the price index data corresponding to the target price characteristics, and training an initial prediction model through the training set to obtain the prediction model.
8. A price prediction apparatus, characterized in that the apparatus comprises:
the determining module is used for determining price index data corresponding to the target price characteristics from a plurality of price index data of the target object;
the forecasting module is used for forecasting price index data corresponding to the target price characteristics through a forecasting model to obtain the forecasting price of the target object;
wherein the prediction model is obtained by training by using the training method of the prediction model of any one of claims 1 to 4.
9. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor, when executing the computer program, implements the steps of the method of any of claims 1 to 7.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 7.
11. A computer program product comprising a computer program, characterized in that the computer program realizes the steps of the method of any one of claims 1 to 7 when executed by a processor.
CN202210610107.2A 2022-05-31 2022-05-31 Prediction model training method and device and price prediction method and device Pending CN114841757A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210610107.2A CN114841757A (en) 2022-05-31 2022-05-31 Prediction model training method and device and price prediction method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210610107.2A CN114841757A (en) 2022-05-31 2022-05-31 Prediction model training method and device and price prediction method and device

Publications (1)

Publication Number Publication Date
CN114841757A true CN114841757A (en) 2022-08-02

Family

ID=82572221

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210610107.2A Pending CN114841757A (en) 2022-05-31 2022-05-31 Prediction model training method and device and price prediction method and device

Country Status (1)

Country Link
CN (1) CN114841757A (en)

Similar Documents

Publication Publication Date Title
Liang et al. Adversarial deep reinforcement learning in portfolio management
CN109255506B (en) Internet financial user loan overdue prediction method based on big data
Hafezi et al. Global natural gas demand to 2025: A learning scenario development model
CN107230108A (en) The processing method and processing device of business datum
KR20210032140A (en) Method and apparatus for performing pruning of neural network
CN112700324A (en) User loan default prediction method based on combination of Catboost and restricted Boltzmann machine
Hájek Credit rating analysis using adaptive fuzzy rule-based systems: an industry-specific approach
CN111950810A (en) Multivariable time sequence prediction method and device based on self-evolution pre-training
CN115936159A (en) Interpretable credit default rate prediction method and system based on automatic feature mining
CN111598329A (en) Time sequence data prediction method based on automatic parameter adjustment recurrent neural network
Wu et al. An uncertainty-oriented cost-sensitive credit scoring framework with multi-objective feature selection
CN114881343B (en) Short-term load prediction method and device for power system based on feature selection
Hirey et al. Analysis of stock price prediction using machine learning algorithms
KR20230127861A (en) Method for credit evaluation model update or replacement and apparatus performing the method
CN114841757A (en) Prediction model training method and device and price prediction method and device
CN114821248A (en) Point cloud understanding-oriented data active screening and labeling method and device
Behera et al. GAN-based multi-task learning approach for prognostics and health management of IIoT
CN114254762A (en) Interpretable machine learning model construction method and device and computer equipment
Polupanov et al. Improving the neural network mathematical model of corporate bankruptcy
CN114826951B (en) Service automatic degradation method, device, computer equipment and storage medium
Jackson et al. Machine learning for classification of economic recessions
CN113327162B (en) Credit wind control rule making system
KR102499435B1 (en) Method for generating credit evaluation model based on artificial intelligence and apparatus performing the method
Panda et al. Machine learning using exploratory analysis to predict taxi fare
Shaji et al. Weather Prediction Using Machine Learning Algorithms

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