Price information prediction method and device, and price prediction model training method and device
By obtaining and screening historical data of target characteristics and training price prediction models, the problem of inaccurate prediction of copper prices and exchange rate changes in the existing technology is solved, and more accurate production cost prediction and planning is achieved.
Patent Information
- Application Number
- CN202410219751.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-02-28
- Publication Date
- 2025-08-29
AI Technical Summary
When enterprises predict the changing trends of factors affecting production costs such as copper prices and exchange rates, existing methods rely on artificial analysis, resulting in insufficient prediction accuracy and affecting the accuracy of production planning.
By obtaining historical data of target features, filtering out alternative features related to timing, training a price prediction model, and using machine learning methods to make accurate predictions.
It improves the accuracy of forecasting target prices during the target period, helping enterprises better plan production and reduce costs and risks.
Smart Images

Figure CN120563145A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of this specification relate to the field of computer technology, and in particular to a method for predicting price information; they also relate to a device for predicting price information, a method for training a price prediction model, a device for training a price prediction model, a computing device, a computer-readable storage medium, and a computer program product. Background Art
[0002] The production operation costs of an enterprise will be affected by various prices, and it is usually necessary to make certain adjustments to the production plan based on changes in various prices.
[0003] For example, vehicle manufacturers need to use a large amount of copper in the process of vehicle manufacturing. Changes in copper prices will affect the manufacturing cost of vehicles. Changes in exchange rates will also affect the manufacturing cost of vehicles, which will correspondingly affect the production plans of vehicle manufacturers.
[0004] Companies usually manually analyze the changing trends of various prices that affect production costs in order to adjust production plans accordingly, but the accuracy of predicting price trends still needs to be improved. Summary of the Invention
[0005] Embodiments of this specification provide a method for predicting price information, which can improve the accuracy of target price predictions within a target time period. One or more embodiments of this specification also relate to a price information prediction device, a method for training a price prediction model, a training device for a price prediction model, a computing device, a computer-readable storage medium, and a computer program product.
[0006] According to one aspect of an embodiment of this specification, a method for predicting price information is provided, the method comprising:
[0007] Obtain historical data on target characteristics that influence target prices;
[0008] Inputting historical data of the target feature into a price prediction model to obtain target price information within a target period; wherein the price prediction model is trained based on the data of the target feature, and the target feature is screened from multiple categories of features that affect the target price, the multiple categories of features including initial features and alternative features related to time series derived from the initial features;
[0009] Based on the target price information, a target price value within the target period is obtained.
[0010] According to another aspect of the embodiments of this specification, a method for training a price prediction model is provided, the method comprising:
[0011] Obtain data on multiple categories of initial features that affect the target price;
[0012] Performing feature derivation on at least one type of initial features to obtain candidate features related to the time series corresponding to the at least one type of features;
[0013] Performing feature screening on the multiple types of initial features and corresponding candidate features to obtain target features;
[0014] Inputting historical data of the target feature into the initial model to obtain target price information within the auxiliary period;
[0015] The parameters of the initial model are adjusted based on the target price information in the auxiliary period to obtain a price prediction model.
[0016] According to another aspect of the embodiments of this specification, a device for predicting price information is provided, the device for predicting price information comprising:
[0017] A first acquisition module is used to acquire historical data of target features that affect the target price;
[0018] a first input module, configured to input historical data of the target feature into a price prediction model to obtain target price information within a target period; wherein the price prediction model is trained based on the data of the target feature, and the target feature is selected from multiple categories of features that affect the target price, the multiple categories of features including initial features and time-series-related alternative features derived from the initial features;
[0019] The second acquisition module is configured to obtain a target price value within the target period based on the target price information.
[0020] According to another aspect of the embodiments of this specification, a training device for a price prediction model is provided, the training device comprising:
[0021] An acquisition module is used to obtain data on multiple types of initial features that affect the target price;
[0022] A feature derivation module, configured to perform feature derivation on at least one type of initial features to obtain candidate features related to the time series corresponding to the at least one type of features;
[0023] A feature screening module is used to screen the multiple types of initial features and corresponding candidate features to obtain target features;
[0024] An input module, configured to input historical data of the target feature into an initial model to obtain target price information within an auxiliary period;
[0025] An adjustment module is used to adjust the parameters of the initial model based on the target price information in the auxiliary period to obtain a price prediction model.
[0026] According to another aspect of the embodiments of this specification, there is provided a computing device, including: a memory and a processor;
[0027] The memory is used to store computer programs / instructions, and the processor is used to execute the computer programs / instructions. When the programs / instructions are executed by the processor, the steps of the above method are implemented.
[0028] According to another aspect of the embodiments of this specification, a computer-readable storage medium is provided, which stores a computer program / instruction, and the computer program / instruction implements the steps of the above method when executed by a processor.
[0029] According to another aspect of the embodiments of this specification, a computer program product is provided, comprising a computer program / instruction, which implements the steps of the above method when the computer program / instruction in the computer program product is executed by a processor.
[0030] In one embodiment of the present specification, alternative features related to time series can be derived based on the initial features that affect the target price, and the target features can be screened out from the initial features and the alternative features, and then a price prediction model can be obtained based on the data training of the target features. The target price information within the target time period can be predicted by the price prediction model, and then the value of the target price within the target time period can be obtained based on the target price information. Since the data of the derived alternative features can more accurately reflect the relationship between the data, the price prediction model trained based on the data of the target features obtained by screening the alternative features can make a more accurate prediction of the target price information, and then the value of the target price within the target time period can be more accurately determined. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] Figure 1 This is a flow chart of a method for predicting price information provided in one embodiment of this specification;
[0032] Figure 2 This is a flowchart of a method for training a price prediction model provided in one embodiment of this specification;
[0033] Figure 3 This is a schematic diagram of a result obtained by using a feature selection algorithm to perform feature screening according to an embodiment of this specification;
[0034] Figure 4 This is a schematic diagram of the structure of a price information prediction device provided in one embodiment of this specification;
[0035] Figure 5This is a schematic diagram of the structure of a training device for a price prediction model provided in one embodiment of this specification;
[0036] Figure 6 This is a structural block diagram of a computing device provided in one embodiment of this specification. DETAILED DESCRIPTION
[0037] The following description sets forth many specific details to facilitate a thorough understanding of this specification. However, this specification can be implemented in many other ways than those described herein, and those skilled in the art can make similar generalizations without violating the scope of this specification. Therefore, this specification is not limited to the specific implementations disclosed below.
[0038] The terms used in one or more embodiments of this specification are for the purpose of describing specific embodiments only and are not intended to limit one or more embodiments of this specification. The singular forms "a", "said" and "the" used in one or more embodiments of this specification and the appended claims are also intended to include plural forms, unless the context clearly indicates otherwise. It should also be understood that the term "and / or" used in one or more embodiments of this specification refers to and includes any or all possible combinations of one or more associated listed items. The term "at least one" in one or more embodiments of this specification refers to "one or more" and "a plurality" refers to "two or more". The term "including" is an open description and should be understood as "including but not limited to", and may include other content on the basis of what has been described.
[0039] It should be understood that although the terms "first," "second," and the like may be used to describe various information in one or more embodiments of this specification, such information should not be limited to these terms. These terms are merely used to distinguish information of the same type from one another. For example, without departing from the scope of one or more embodiments of this specification, "first" may also be referred to as "second," and similarly, "second" may also be referred to as "first." Depending on the context, the word "if" as used herein may be interpreted as "at the time of," "when," or "in response to determining."
[0040] A company's operations are influenced by numerous price factors. For example, a company's production operations require corresponding raw materials, and raw material prices and other price information can affect the company's overall production costs and revenue. Vehicle manufacturers have a significant demand for copper, and the current popularity of electric vehicles will also increase copper usage across the board. Fluctuations in copper prices have a significant impact on companies. Exchange rates are a form of price information, and exchange rate fluctuations can also affect production costs. Understanding copper price and exchange rate trends can help vehicle manufacturers and sellers better plan and manage their operations, better control costs and risks, reduce risk, and increase profits, and better understand market trends and the competitive landscape.
[0041] Currently, companies rely on expert opinions (e.g., from economists, analysts, and traders) to predict the changing trends of price information (such as copper prices and exchange rates) that impacts their business. However, this forecasting method is subject to significant human influence, resulting in low accuracy. Consequently, accurately grasping these price trends remains difficult, leading to a relatively passive production planning process and difficulties in effectively controlling production costs and planning.
[0042] The embodiments of this specification provide a method for predicting price information, which can more accurately determine the target price within a target period. Enterprises can better plan their business within the target period based on the target price to reduce production costs and increase production profits. The embodiments of this specification also relate to a price information prediction device, a price prediction model training method, a price prediction model training device, a computing device, a computer-readable storage medium, and a computer program product. The prediction device, training device, and computing device can all be a service device, or can also be a terminal device, which is not limited here.
[0043] Figure 1 This is a flowchart of a price information prediction method provided by an embodiment of this specification. This method can be applied to a price information prediction device, such as Figure 1 As shown, the method may include:
[0044] Step 102: Obtain historical data of target characteristics that affect the target price.
[0045] When a target price needs to be predicted, the price information prediction device can determine the target characteristics that affect the target price and obtain historical data of the target characteristics to predict the subsequent target price based on the historical data.
[0046] In the embodiments of this specification, the target price may include the price of a physical object, the price of a virtual object, or the relationship between certain prices. The target price may be a price that will impact the business of the enterprise, and the target price may vary for different enterprises. For example, for a vehicle manufacturing enterprise, the target price may include the price of copper and the exchange rate. Optionally, the target price may also include the price of other metals or the price of chips.
[0047] The target price may be affected by a variety of features. In the embodiments of this specification, the target features may be some of the features obtained after screening for a variety of features of the target price. For example, the features that affect the copper price may include features such as the consumer price index, the stock index, the gold futures index, the copper futures index, the crude oil price, and the inflation rate. In addition, there may be other features that affect the copper price, which are not limited here. In the embodiments of this specification, these features may be screened in advance to determine the target features. The number of target features may be one or more. For each target feature, its historical data may be obtained. The historical data may include the previous values of the target feature, and may also include descriptive information related to the target feature.
[0048] In some embodiments, the prediction device can be connected to some information publishing platforms (such as news websites or consulting websites, etc.). The prediction device can obtain relevant information about the target price published in the information publishing platform to which it is connected, and then analyze the relevant information to obtain historical data of one or more target characteristics that affect the target price. For example, the relevant information may include environmental information related to the target price, such as public opinion news information, and the information in public opinion news may include information on politics, economy, and natural disasters. In this way, external environmental factors related to the target price can also be taken into account to ensure that the characteristics are considered more comprehensively, and a more accurate prediction of the target price can be achieved based on these historical data. Optionally, the prediction device can use a crawler method to quickly update the stored feature data, and automatically obtain it into the data set after the information publishing platform updates the data, so as to facilitate timely prediction of the target price.
[0049] The target price can be changed or released periodically, and in the embodiments of this specification, the period of change or release is referred to as a change period. The prediction device can obtain the data of the target characteristics that affect the target price in multiple change periods before the prediction moment as historical data to predict the target price in the target period thereafter. The number of the multiple change periods and the duration of the target period can be a pre-set value, an empirical value, or a user-defined value. For example, the copper price changes with a change period of one week, that is, the copper price is weekly data. The prediction device can obtain the data of the target characteristics of the 24 change periods (that is, six months) before the prediction moment as historical data to predict the copper price in the target period thereafter, such as the target period being the next 24 change periods.
[0050] Optionally, for the data within each fluctuation period, the forecasting device may further use the period identifier corresponding to the data as a target feature. For example, the period identifier may be a serial number feature. For example, the forecasting device may obtain historical data of target features affecting the target price corresponding to the serial number features of the aforementioned multiple fluctuation periods, where the serial number features of the fluctuation periods are represented using category information; that is, rather than using numerical information to represent the fluctuation period, information with specific category meaning is used to represent the fluctuation period.
[0051] In the embodiments of this specification, the prediction device may execute step 102 upon receiving a prediction instruction for a target price within a target period sent from a front-end page. Optionally, the prediction instruction may carry historical data of the target feature, and upon receiving the prediction instruction, the prediction device may execute the following step 104 based on the data carried in the prediction instruction.
[0052] Step 104: Input the historical data of the target feature into the price prediction model to obtain the target price information within the target period; wherein the price prediction model is trained based on the data of the target feature, and the target feature is screened from multiple categories of features that affect the target price, the multiple categories of features including initial features and alternative features related to time series derived from the initial features.
[0053] The prediction device can analyze the acquired historical data of the target feature to obtain a prediction result for the target price within the target period. For example, the obtained prediction result can be target price information; the target price information can be the target price value, or information related to the target price value.
[0054] The target price changes or is released periodically. If the target price prior to the target period is known, the target price information determined by the forecasting device can be the year-on-year comparison of the target price for the target period with the known target price for the previous period. The target price value for the target period can subsequently be determined based on this target price information. Because the target price generally fluctuates significantly, but the changes between adjacent fluctuation periods are typically smaller, performing year-on-year comparison processing can reduce the magnitude of the target price changes, resulting in more accurate forecast results.
[0055] In the embodiments of this specification, a price prediction model can be trained based on data of target features. Before actually predicting the target price, a target feature can be obtained by screening multiple features that influence the target price. The target feature can include features with low correlation among the multiple features, or features with a greater impact on the target price and a stronger correlation with the target price.
[0056] The multiple categories of features may include initial features and alternative features related to the time series that are derived from the initial features. The initial features are features whose corresponding data can be directly obtained, such as from an information publishing platform or other information acquisition channels. Each alternative feature can be a feature obtained by analyzing, learning, or calculating based on one or more initial features, and the alternative feature is related to the time series of changes in the target price. For example, the initial features themselves can be changed to obtain alternative features that were not originally there, or an algorithm can be used to derive alternative features based on the relationship between different features.
[0057] In the embodiments of this specification, the candidate features may include the month-on-month features and the differential features of the initial features within the first two change cycles. This feature can more accurately reflect the temporal nature of the data, and accordingly, based on this candidate feature, the changing trend of the target price can be more accurately predicted.
[0058] For example, target features for copper prices may include: copper inventory, 10-year Treasury bonds, Purchasing Managers' Index (PMI), stock index, energy prices, exchange rate, inflation rate, the month-on-month comparison of copper prices over the past two periods, and cycle number features. Target features for exchange rates may include: stock index, inflation rate, 10-year Treasury bonds, monetary aggregates, unemployment rate, the month-on-month comparison of exchange rates over the past two periods, and cycle number features.
[0059] After the target feature is obtained by screening the multiple categories of features, a large amount of target feature data can be obtained as training data for the model to train the price prediction model. As time goes by, the data of the target feature continues to increase, and the actual target feature data can be continuously obtained as new training data. The historical data of the target feature can be divided to obtain multiple training data and corresponding labels. Each training data includes historical data before an auxiliary period, and the label corresponding to the training data is the actual data within the auxiliary period. Part of the historical data of the target feature can also be used as verification data for the model to verify the trained model. After the verification is passed, it is determined that the price prediction model training is successful, and then the price prediction model can be put into actual price prediction (such as executing Figure 1 method shown).
[0060] Step 106: Based on the target price information, obtain the target price value within the target period.
[0061] In an optional manner, the target price information includes a target price value. In this case, in step 106, the target price information can be directly determined as the target price value within the target period.
[0062] In another optional embodiment, the target price information includes comparison information of the target price value within the target period and the target price value within the reference change period. For example, the comparison information includes month-on-month information or differential information, and the reference change period may include the previous change cycle of the target period, or the previous several change cycles. In this case, in step 106, the target price value within the target period may be determined based on the comparison information in the target price information and the target price value within the reference change period. If the comparison information is month-on-month information, the prediction device may determine the target price value within the target period by multiplying the month-on-month information by the target price value within the reference period.
[0063] In the embodiment of this specification, alternative features can be derived from the initial features of the target price, the target features can be screened, and then the price prediction model can be trained using the data of the target features, and the impact of more environmental factors on the target price can be taken into account. In this way, the integrity and accuracy of the training data can be guaranteed to be high, and the accuracy of the prediction results can be guaranteed accordingly. In addition, the fluctuation of the target price may be very rapid. In the embodiment of this specification, the prediction device is connected to the information release platform so that the corresponding data can be quickly obtained when the data of the information release platform is updated, thereby ensuring that the data is updated in a timely manner and predictions are made to avoid outdated prediction results.
[0064] In summary, in the price information prediction method provided in the embodiment of this specification, alternative features related to the time series can be derived based on the initial features that affect the target price, and the target features can be screened out from the initial features and the alternative features, and then a price prediction model can be obtained based on the data training of the target features. The target price information within the target time period can be predicted by the price prediction model, and then the value of the target price within the target time period can be obtained based on the target price information. Since the data of the derived alternative features can more accurately reflect the relationship between the data, the price prediction model trained based on the data of the target features screened by the alternative features can make a more accurate prediction of the target price information, and then the value of the target price within the target time period can be more accurately determined.
[0065] In the embodiments of this specification, before predicting the target price information (such as before step 102 or step 104), it is necessary to first perform model training to obtain a price prediction model. The training method of the price prediction model is introduced below. This method can be used for a training device for a price prediction model. The training device can be the same device as the above-mentioned prediction device, or it can be another device different from the above-mentioned prediction device. If the training device is the same device as the above-mentioned prediction device, the following training method can be part of the process that needs to be executed in the above-mentioned price information prediction method, and is executed before step 102 or step 104 of the above-mentioned prediction method. The flowchart under this method is no longer shown in this specification.
[0066] Figure 2 This is a flowchart of a method for training a price prediction model provided in one embodiment of this specification, which can be used in a training device for a price prediction model, such as Figure 2 As shown, the method may include the following steps:
[0067] Step 202: Obtain data on multiple types of initial features that affect the target price.
[0068] In the embodiments of this specification, step 202 can refer to the description of the feature acquisition method in step 102, and can refer to the description of the feature categories in step 104. The previously described content will not be repeated here. The training device can obtain the training data required for model training based on data on multiple categories of initial features that affect the target price. The initial features corresponding to different target prices can be different, and the specific initial features will not be further described here.
[0069] Initial feature data can include the target price itself (such as the target price value), as well as some external feature data. For example, external features related to copper prices may include the Consumer Price Index, the Nasdaq Stock Index, gold futures, and crude oil futures. External features related to exchange rates may include monetary aggregates, recent interest rates, and GDP.
[0070] In some embodiments, the training device can be connected to at least one information publishing platform related to the target price to obtain relevant information about the target price published on the information publishing platform, and then analyze the relevant information to obtain historical data on some initial features that affect the target price. The training device can obtain updated data and analyze it when the information publishing platform updates the data to obtain data on at least one type of initial features that affect the target price. This ensures that the training device obtains information in real time. Optionally, data on different initial features that affect the target price can be obtained from different information publishing platforms. Optionally, the training device can use crawler technology to obtain data from the information publishing platform.
[0071] The training device can obtain data on initial features within each fluctuation period of the target price. For example, the training device can obtain historical data on target features that affect the target price, corresponding to serial features of multiple fluctuation periods, where the serial features of the fluctuation periods are represented by category information. For details on the serial features, please refer to the relevant description in step 104 above.
[0072] In the embodiments of this specification, before determining to use the price forecasting model to predict the target price, the changes in the target price can be analyzed accordingly. For example, through analysis, it can be determined that the change in the target price does not have an obvious trend, does not have obvious seasonality, and is not a stationary sequence. Based on this analysis, it can be preliminarily determined that the target price cannot be predicted using mathematical statistics methods, and it is necessary to use machine learning methods to train the model to achieve the prediction of the target price. For the target price, the results of naive predictions over a period of time (that is, directly using the previous period value as the prediction result) can also be taken as a reference standard to initially understand the accuracy level that can be achieved when no prediction is made. The actual verification results of the model can be judged based on the results later, and the judgment standard can be the mean absolute percentage error (MAPE, Mean absolute percentage error).
[0073] Step 204: perform feature derivation on at least one type of initial features to obtain candidate features related to the time series corresponding to the at least one type of features.
[0074] After obtaining the data of each initial feature, the training device can analyze the data of the initial feature to perform feature derivation on at least one type of initial feature to derive candidate features related to the time series. For details about this feature derivation, please refer to the relevant description in step 104, and the content previously described will not be repeated here.
[0075] Feature derivation refers to the use of original data for feature learning to obtain new features. Sometimes the derived features can better reflect the relationship between data features. There are generally two ways to derive features. One is the change of the data itself, so that features that did not exist originally appear; the other is that when performing feature learning, the algorithm derives new features based on the relationship between features. The embodiment of this specification mainly uses the first method to derive features. The generated alternative features may include: the previous period value based on the historical target price and external features, and the month-on-month information and differential information between the previous two period values. Since the data derived by the same method are generally highly correlated, they are not very helpful for improving the effect of the model. Therefore, the month-on-month and differential features that best reflect the temporal nature of the data are selected as the derived alternative data.
[0076] Step 206: Perform feature screening on the multiple types of initial features and corresponding candidate features to obtain target features.
[0077] After feature derivation, we obtain various features that influence the target price (including multiple types of initial features and candidate features). Since some of these features may have less significant effects or have overlapping meanings, we can filter these features to obtain the final target features to avoid adding additional computational burden.
[0078] In one screening method, a correlation analysis between features can be performed to select target features based on the analysis results. The training device can analyze the degree of correlation between each pair of features in the multiple categories of initial features and the corresponding candidate features; for any two categories of features with a correlation greater than a first threshold, one of the two categories of features is eliminated, and the target feature is obtained based on the remaining features. The similarity analysis process can be a similarity calculation process, and the specific similarity calculation method is not limited here.
[0079] Since multiple categories of features with high correlation may actually represent the same feature, if the data of these features are all used as training data, this feature will be given a high weight that it does not deserve, resulting in it being considered to have the greatest impact on the target price, reducing the amount of information contained in other features, and causing deviations in the analysis results. Therefore, in the embodiments of this specification, only one category of features is selected for retention among multiple categories of features with high correlation (such as above the first threshold), and all features with low correlation (such as less than or equal to the first threshold) can be retained.
[0080] For example, based on correlation analysis, it can be determined that the maximum value, minimum value and mean value in a whole month are highly correlated, the values of two adjacent periods and the month-on-month correlation of two adjacent months are highly correlated, and the different manifestations of the same type of features (such as GDP of different countries) are highly correlated. Then, one type of feature can be selected to retain from these highly correlated feature groups.
[0081] In another screening method, an analysis of the degree of influence between features and target prices can be performed, which can also be called an analysis of the importance and contribution to the target price, to screen target features based on the analysis results. The training device can determine the degree of influence of each type of feature on the target price based on the relationship between each type of feature and the target price in multiple types of initial features and corresponding alternative features; and obtain the target feature based on the features whose degree of influence on the target price is greater than a second threshold. For example, a second threshold can be set based on the importance and contribution analysis, and features whose degree of influence is greater than the second threshold are considered to have a greater contribution to the model, and the features are retained.
[0082] In another screening method, the prediction device can use a feature selection algorithm to determine redundant features among multiple categories of initial features and corresponding candidate features; based on features other than redundant features, the target features are obtained. For example, the prediction device can use a feature selection algorithm (such as BORUTA and RFE algorithms) to filter and reduce the dimensionality of features to save storage space, speed up calculations, and remove some redundant features to avoid overfitting the model due to too many or too complex features.
[0083] Figure 3 This is a schematic diagram of a result obtained by using a feature selection algorithm to perform feature screening according to an embodiment of this specification.
[0084] The first region D1 is the rejection region, where the features corresponding to this region are considered noise and can be discarded. The second region D2 is the hesitation region, where the feature selection algorithm has difficulty deciding on the features corresponding to this region. The third region D3 is the acceptance region, where the features corresponding to this region are considered predictive and can be retained.
[0085] In the embodiments of this specification, any one or more of the above three screening methods can be used to determine the target characteristics, and the order in which the screening methods are used is not limited here.
[0086] For example, the three screening methods can be performed in sequence. After the first two screening methods are used for feature screening, the features screened out for copper prices may include: copper inventory, ten-year treasury bonds, PMI, stock index, MSCI index, gold futures, energy prices, exchange rates, inflation rate and its month-on-month and differential, as well as the copper price of the previous cycle, the copper price of the previous two periods and the cycle sequence number feature. The features screened out for exchange rates may include: stock index, inflation rate, ten-year treasury bonds, consumer price index (CPI, Consumer Price Index), economic account balance, historical currency volatility, monetary aggregate, unemployment rate and its month-on-month and differential, as well as the exchange rate of the previous cycle, the exchange rate of the previous two periods and the cycle sequence number feature.
[0087] After further screening the above features using the third screening method, the target features for copper prices include: copper inventory, 10-year Treasury bonds, Purchasing Managers' Index (PMI), stock index, energy prices, exchange rate, inflation rate, the previous two periods of copper price changes, and cycle number characteristics. The target features for exchange rates include: stock index, inflation rate, 10-year Treasury bonds, monetary aggregates, unemployment rate, the previous two periods of exchange rate changes, and cycle number characteristics.
[0088] Step 208: Input the historical data of the target feature into the initial model to obtain the target price information within the auxiliary period.
[0089] After the training device has screened and obtained the target feature, it can perform model training based on the data of the target feature. The training device can divide the historical data of the target feature into a training set and a validation set, such as a 9:1 ratio of the data volume of the training set to the data volume of the validation set. The model can be fitted and trained in the training set, and the model loss can be checked in the validation set. The training set includes multiple training data and corresponding labels, and the validation set can obtain multiple validation data. For the training data, labels, and validation data, please refer to the relevant description in step 104, and the content previously introduced will not be repeated here.
[0090] Each piece of training data can correspond to an auxiliary period and include historical data for each target characteristic from a period prior to the corresponding auxiliary period. The time periods for each piece of training data can be the same or different. The actual target price information from the auxiliary period serves as the corresponding label. Each piece of verification data can also include historical data for each target characteristic from a period prior to the auxiliary period, as well as the actual target price information from the auxiliary period.
[0091] The training device can input each piece of training data into the initial model to obtain a prediction result of the target price information within the auxiliary period corresponding to the training data. Then, step 210 can be performed. For example, the prediction result can be compared with the corresponding label. If the similarity with the corresponding label is lower than a target threshold, the parameters of the initial model can be adjusted. The process of processing the training data, comparing it with the corresponding label, and adjusting the model parameters can be repeated until the training stop condition is met. Model training is then considered complete, and the desired price prediction model is obtained.
[0092] In the embodiments of this specification, the target price information obtained by the model may not be the value of the target price. In this case, after obtaining the target price information of the auxiliary period, the value of the target price can be obtained based on the target price information, and then compared with the actual value of the target price in the auxiliary period. For example, the target price information is the target price compared with the target price of the previous period. After obtaining the target price information, the target price information can be multiplied by the target price of the previous period to obtain the predicted value of the target price in the auxiliary period. Since the change scale of the target price is generally large, but the change between two adjacent change cycles is usually small, the change scale of the target price can be reduced after the month-on-month processing, making the prediction result more accurate.
[0093] Step 210: Adjust the parameters of the initial model based on the target price information in the auxiliary period to obtain a price prediction model.
[0094] In the embodiment of this specification, step 210 may refer to the relevant introduction of adjusting the parameters of the initial model in step 208, and the previously introduced content will not be repeated here.
[0095] Since the data analysis methods of different models are different, their applicable scenarios will also be different. The prediction device can use a variety of alternative models to test the target price to determine the model that best matches the target price, and then use the model as the initial model for training to ensure that the obtained prediction model can achieve a higher prediction result for the target price. For example, the Catboost model can be used for copper prices, and the LGB model can be used for exchange rates. Optionally, other models can also be used for the target price, such as random forest models, XGBoost models, blending models, stacking models, models using time series decomposition algorithms, or Lstm long short-term memory network models, etc., which are not limited here.
[0096] In the examples of this specification, after 500 rounds of iterative training on copper prices, the model experienced minimal loss in the validation set. After 100 rounds of iterative training on exchange rates, the model also experienced minimal loss in the validation set, indicating that the model was not overfitting. The model trained in the examples of this specification achieved an accuracy of 98% on the validation set for copper prices, with an average accuracy of approximately 97%. The accuracy of the validation set for exchange rates reached 99%, with an average accuracy of 97.5%.
[0097] During model training, you can set multiple step sizes from large to small to adjust parameters sequentially. For example, you can use a grid search approach to poll model parameters, starting with a larger step size. Once you get a rough range, use smaller step sizes for more detailed polling to adjust parameters. This approach can avoid the bias caused by manual parameter adjustment and improve parameter adjustment efficiency.
[0098] During model training, you can use an objective function to optimize the model toward its extreme value. During model validation, you can use an evaluation function to assess the model's performance. You can also poll the objective function and evaluation function to select the most appropriate function combination to ensure optimal model training results.
[0099] In some embodiments, when the training device receives information about a newly added influencing factor for a target price, it can obtain data about the newly added influencing factor. Afterwards, the price prediction model can be retrained based on the data of the newly added influencing factor to obtain an updated price prediction model, and the target price information can be predicted using the updated price prediction model. The newly added influencing factor can be used as a target feature, and data acquisition and training can be performed in accordance with the above-mentioned method for the target feature. The newly added influencing factor can be added at any time during the model training process, or it can also be added at any time during use after the model training is completed. The information of the newly added influencing factor can be triggered and input by the user, or it can also be obtained by the training device by analyzing the relevant data on its own.
[0100] After model training is completed and a suitable price prediction model is obtained, the price prediction model can be applied to actual price prediction scenarios to provide users with trend forecasts for target prices. In the embodiments of this specification, the period sequence number feature can be used as a categorical feature instead of a numerical feature as input, which can better reflect the changes in the data over time and ensure better prediction results for target price information.
[0101] In the embodiments of this specification, the model training program can be in the form of an application programming interface (API), and a front-end page can be designed for user operation. For example, the user can send training instructions, input training data, intervene in parameter adjustment, and add influencing factors through the front-end page. This can improve user-friendliness and achieve scheduled / on-demand prediction or model retraining based on major event data.
[0102] In the embodiments of this specification, environmental information such as news or public opinion can be added as a feature training model to better integrate the impact of environmental information on the target price. Feature data can be updated more quickly using a crawler. After the target website updates the latest data, the data can be automatically acquired into the dataset, facilitating real-time and fast model updates and result predictions. In addition, the prediction model can also perform multi-factor analysis and add influencing factors at any time, making the prediction more accurate and objective. The prediction cycle of the model can be customized to reduce labor costs.
[0103] In summary, in the training method of the price prediction model provided in the embodiment of this specification, alternative features related to the time series can be derived based on the initial features that affect the target price, and the target features can be screened out from the initial features and the alternative features, and then the price prediction model can be obtained based on the data training of the target features. The target price information within the target time period can be predicted by the price prediction model, and then the value of the target price within the target time period can be obtained based on the target price information. Since the data of the derived alternative features can more accurately reflect the relationship between the data, the price prediction model trained based on the data of the target features screened by the alternative features can make a more accurate prediction of the target price information, and then the value of the target price within the target time period can be more accurately determined.
[0104] Corresponding to the above method embodiment, this specification also provides an embodiment of a device for predicting price information. Figure 4 This is a schematic diagram of the structure of a price information prediction device provided in one embodiment of this specification. Figure 4 As shown, the price information prediction device includes:
[0105] A first acquisition module 401 is used to acquire historical data of target features that affect the target price;
[0106] A first input module 402 is configured to input historical data of a target feature into a price prediction model to obtain target price information within a target period. The price prediction model is trained based on the data of the target feature, and the target feature is selected from multiple categories of features that affect the target price, including initial features and alternative time-series-related features derived from the initial features.
[0107] The second acquisition module 403 is configured to obtain a target price value within a target period based on the target price information.
[0108] Optionally, the price information prediction device further includes:
[0109] The third acquisition module is used to obtain data of multiple types of initial features that affect the target price before inputting the historical data of the target feature into the price prediction model to obtain the target price information within the target period;
[0110] A feature derivation module is used to derive features for at least one type of initial features to obtain candidate features related to the time series corresponding to at least one type of features;
[0111] A feature screening module is used to screen the multiple types of initial features and corresponding candidate features to obtain target features;
[0112] The second input module is used to input the historical data of the target feature into the initial model to obtain the target price information within the auxiliary period;
[0113] The adjustment module is used to adjust the parameters of the initial model based on the target price information in the auxiliary period to obtain a price prediction model.
[0114] Optionally, the feature screening module is used to:
[0115] Analyzing the degree of correlation between each two types of features in the multiple types of initial features and the corresponding candidate features;
[0116] For any two types of features whose correlation is higher than a first threshold, one type of feature in the two types of features is screened out, and a target feature is obtained based on the remaining features.
[0117] Optionally, the feature screening module is used to:
[0118] Determine the degree of influence of each type of feature on the target price based on the relationship between each type of feature in the multiple types of initial features and the corresponding candidate features and the target price;
[0119] A target feature is obtained based on features whose impact on the target price is greater than a second threshold.
[0120] Optionally, the feature screening module is used to:
[0121] Using a feature selection algorithm to determine redundant features among the multiple categories of initial features and corresponding candidate features;
[0122] Based on features other than redundant features, target features are obtained.
[0123] Optionally, the price information prediction device further includes:
[0124] A fourth acquisition module is configured to acquire data of a newly added influencing factor upon receiving information of the newly added influencing factor for the target price;
[0125] The training module is used to retrain the price prediction model based on the data of the newly added influencing factors to obtain an updated price prediction model, and use the updated price prediction model to determine the target price information.
[0126] Optionally, the target price information includes a target price value; the second acquisition module 403 is configured to determine the target price information as the target price value within the target period;
[0127] Alternatively, the target price information includes comparison information between the target price value within the target period and the target price value within the reference change period; the second acquisition module 403 is used to determine the target price value within the target period based on the comparison information in the target price information and the target price value within the reference change period.
[0128] Optionally, the first acquisition module 401 is configured to:
[0129] Historical data of target features that affect target prices and correspond to serial features of multiple change cycles are obtained, wherein the serial features of the change cycles are represented by category information.
[0130] Optionally, the first acquisition module 401 is configured to:
[0131] Obtain relevant information about target prices published on the connected information publishing platform;
[0132] Analyze relevant information to obtain historical data on target characteristics that affect target prices.
[0133] In summary, in the price information prediction device provided in the embodiment of this specification, alternative features related to time series can be derived based on the initial features that affect the target price, and the target features can be screened out from the initial features and the alternative features, and then a price prediction model can be obtained based on the data training of the target features. The target price information within the target time period can be predicted by the price prediction model, and then the value of the target price within the target time period can be obtained based on the target price information. Since the data of the derived alternative features can more accurately reflect the relationship between the data, the price prediction model trained based on the data of the target features screened out by the alternative features can make a more accurate prediction of the target price information, and then the value of the target price within the target time period can be more accurately determined.
[0134] Corresponding to the above method embodiments, this specification also provides an embodiment of a training device for a price prediction model. Figure 5 This is a structural diagram of a training device for a price prediction model provided in an embodiment of this specification. Figure 5 As shown, the training device of the price prediction model includes:
[0135] The first acquisition module 501 is used to acquire data of multiple types of initial features that affect the target price before inputting historical data of the target feature into the price prediction model to obtain target price information within the target period;
[0136] A feature derivation module 502 is configured to perform feature derivation on at least one type of initial features to obtain candidate features related to the time series corresponding to at least one type of features;
[0137] A feature screening module 503 is used to screen the multiple types of initial features and corresponding candidate features to obtain target features;
[0138] Input module 504, used to input historical data of target features into the initial model to obtain target price information within the auxiliary period;
[0139] The adjustment module 505 is configured to adjust the parameters of the initial model based on the target price information within the auxiliary period to obtain a price prediction model.
[0140] Optionally, the feature screening module 503 is used to:
[0141] Analyzing the degree of correlation between each two types of features in the multiple types of initial features and the corresponding candidate features;
[0142] For any two types of features whose correlation is higher than a first threshold, one type of feature in the two types of features is screened out, and a target feature is obtained based on the remaining features.
[0143] Optionally, the feature screening module 503 is used to:
[0144] Determine the degree of influence of each type of feature on the target price based on the relationship between each type of feature in the multiple types of initial features and the corresponding candidate features and the target price;
[0145] A target feature is obtained based on features whose impact on the target price is greater than a second threshold.
[0146] Optionally, the feature screening module 503 is used to:
[0147] Using a feature selection algorithm to determine redundant features among the multiple categories of initial features and corresponding candidate features;
[0148] Based on features other than redundant features, target features are obtained.
[0149] Optionally, the training device for the price prediction model further includes:
[0150] A second acquisition module is configured to acquire data of a newly added influencing factor upon receiving information of the newly added influencing factor for the target price;
[0151] The training module is used to retrain the price prediction model based on the data of the newly added influencing factors to obtain an updated price prediction model, and use the updated price prediction model to determine the target price information.
[0152] In summary, in the training device of the price prediction model provided in the embodiment of this specification, alternative features related to the time series can be derived based on the initial features that affect the target price, and the target features can be screened out from the initial features and the alternative features, and then the price prediction model can be obtained based on the data training of the target features. The target price information within the target period can be predicted by the price prediction model, and then the value of the target price within the target period can be obtained based on the target price information. Since the data of the derived alternative features can more accurately reflect the relationship between the data, the price prediction model trained based on the data of the target features screened by the alternative features can make a more accurate prediction of the target price information, and then the value of the target price within the target period can be more accurately determined.
[0153] The various embodiments in this specification are described in a progressive manner. Similar portions between the various embodiments can be referenced to each other. Each embodiment focuses on the differences from the other embodiments. In particular, the description of the price information prediction device is relatively simple, as it is fundamentally similar to the price information prediction method embodiment. For relevant portions, refer to the description of the price information prediction method embodiment.
[0154] Figure 66 is a block diagram of a computing device according to an embodiment of the present disclosure. Components of the computing device 600 include, but are not limited to, a memory 610 and a processor 620. The processor 620 is connected to the memory 610 via a bus 630, and a database 650 is used to store data.
[0155] The computing device 600 also includes an access device 640 that enables the computing device 600 to communicate via one or more networks 660. Examples of such networks include a public switched telephone network (PSTN), a local area network (LAN), a wide area network (WAN), a personal area network (PAN), or a combination of communication networks such as the Internet. The access device 640 may include one or more of any type of network interface (e.g., a network interface card (NIC)) whether wired or wireless, such as an IEEE 802.11 wireless local area network (WLAN) wireless interface, a Worldwide Interoperability for Microwave Access (Wi-MAX) interface, an Ethernet interface, a universal serial bus (USB) interface, a cellular network interface, a Bluetooth interface, or a near field communication (NFC) interface.
[0156] In one embodiment of the present specification, the above components of the computing device 600 and Figure 6 Other components not shown in the figure may also be connected to each other, for example, via a bus. Figure 6 The computing device structure block diagram shown is for illustrative purposes only and is not intended to limit the scope of this specification. Those skilled in the art may add or replace other components as needed.
[0157] Computing device 600 may be any type of stationary or mobile computing device, including a mobile computer or mobile computing device (e.g., a tablet computer, personal digital assistant, laptop computer, notebook computer, netbook computer, etc.), a mobile phone (e.g., a smartphone), a wearable computing device (e.g., a smartwatch, smart glasses, etc.), or other types of mobile devices, or a stationary computing device such as a desktop computer or personal computer (PC). Computing device 600 may also be a mobile or stationary server.
[0158] The processor 620 is used to execute computer programs / instructions, which, when executed by the processor, implement the above Figure 1 Or the method shown in 2.
[0159] As for the computing device embodiment, since it is basically similar to the above-mentioned method embodiment, the description is relatively simple. For relevant details, please refer to the partial description of the price information prediction method embodiment.
[0160] One embodiment of this specification also provides a computer-readable storage medium, which stores computer instructions, which, when executed by a processor, implement the steps of the above-mentioned price information prediction method. The computer instructions include computer program code, which can be in source code form, object code form, executable file or some intermediate form. The computer-readable storage medium may include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium, etc. It should be noted that the content contained in the computer-readable storage medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable storage media do not include electric carrier signals and telecommunication signals.
[0161] One embodiment of the present specification further provides a computer program product, comprising a computer program / instruction, which implements the steps of the above method when the computer program / instruction is executed in a processor.
[0162] As for the computer-readable storage medium embodiment and the computer program product embodiment, since they are basically similar to the above-mentioned method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the above-mentioned method embodiment.
[0163] The foregoing description of this specification describes specific embodiments. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims can be performed in an order different from that described in the embodiments and still achieve the desired results. Furthermore, the processes depicted in the accompanying drawings do not necessarily require the specific order shown or the sequential order to achieve the desired results. In certain embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0164] It should be noted that the above description is of a specific embodiment of this specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps described in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multi-tasking and parallel processing are also possible or may be advantageous. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the embodiments of this specification.
[0165] In the above embodiments, the description of each embodiment has its own focus. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0166] The preferred embodiments disclosed above are intended only to help illustrate this specification. The optional embodiments do not exhaustively describe all details, nor do they limit the invention to the specific embodiments described. Obviously, many modifications and variations are possible based on the content of the embodiments described herein. These embodiments are selected and described in detail in this specification to better explain the principles and practical applications of the embodiments, thereby enabling those skilled in the art to better understand and utilize this specification.
Claims
1. A method for predicting price information, characterized in that: The method comprises: Obtain historical data on target characteristics that influence target prices; Inputting historical data of the target feature into a price prediction model to obtain target price information within a target period; wherein the price prediction model is trained based on the data of the target feature, and the target feature is screened from multiple categories of features that affect the target price, the multiple categories of features including initial features and alternative features related to time series derived from the initial features; Based on the target price information, a target price value within the target period is obtained.
2. The method according to claim 1, characterized in that Before inputting the historical data of the target feature into the price prediction model to obtain the target price information within the target period, the method further includes: Obtain data on multiple categories of initial features that affect the target price; Performing feature derivation on at least one type of initial features to obtain candidate features related to the time series corresponding to the at least one type of features; Performing feature screening on the multiple types of initial features and corresponding candidate features to obtain target features; Inputting historical data of the target feature into the initial model to obtain target price information within the auxiliary period; The parameters of the initial model are adjusted based on the target price information in the auxiliary period to obtain a price prediction model.
3. The method according to claim 2, characterized in that The feature screening is performed on the multiple types of initial features and the corresponding candidate features to obtain target features, including: Analyzing the degree of correlation between each two types of features in the multiple types of initial features and the corresponding candidate features; For any two types of features whose correlation is higher than a first threshold, one type of feature in the two types of features is screened out, and a target feature is obtained based on the remaining features.
4. The method according to claim 2 or 3, characterized in that The feature screening is performed on the multiple types of initial features and the corresponding candidate features to obtain target features, including: Determining the degree of influence of each type of feature on the target price based on the relationship between each type of feature in the multiple types of initial features and the corresponding candidate features and the target price; A target feature is obtained based on features whose impact on the target price is greater than a second threshold.
5. The method according to claim 2 or 3, characterized in that The feature screening is performed on the multiple types of initial features and the corresponding candidate features to obtain target features, including: Using a feature selection algorithm to determine redundant features among the multiple types of initial features and corresponding candidate features; Based on features other than the redundant features, target features are obtained.
6. The method according to claim 2, characterized in that The method further comprises: Upon receiving information about a newly added influencing factor for the target price, obtaining data of the newly added influencing factor; The price prediction model is retrained based on the data of the newly added influencing factors to obtain an updated price prediction model, and the target price information is determined using the updated price prediction model.
7. The method according to claim 1, characterized in that The target price information includes the value of the target price; The obtaining, based on the target price information, a target price value within the target period, includes: determining the target price information as the target price value within the target period; Alternatively, the target price information includes comparison information between the value of the target price within the target period and the value of the target price within the reference change period; obtaining the value of the target price within the target period based on the target price information includes: determining the value of the target price within the target period based on the comparison information in the target price information and the value of the target price within the reference change period.
8. The method according to claim 1, characterized in that The obtaining of historical data of target characteristics that affect the target price includes: Historical data of target features affecting a target price corresponding to serial number features of a plurality of change cycles are obtained, wherein the serial number features of the change cycles are represented by category information.
9. The method according to claim 1, characterized in that The obtaining of historical data of target characteristics that affect the target price includes: Obtain relevant information of the target price published on the connected information publishing platform; The relevant information is analyzed to obtain historical data of target characteristics that affect the target price.
10. A method for training a price prediction model, characterized in that: The method comprises: Obtain data on multiple categories of initial features that affect the target price; Performing feature derivation on at least one type of initial features to obtain candidate features related to the time series corresponding to the at least one type of features; Performing feature screening on the multiple types of initial features and corresponding candidate features to obtain target features; Inputting historical data of the target feature into the initial model to obtain target price information within the auxiliary period; The parameters of the initial model are adjusted based on the target price information in the auxiliary period to obtain a price prediction model.
11. A price information prediction device, characterized in that: The price information prediction device includes: A first acquisition module is used to acquire historical data of target features that affect the target price; a first input module, configured to input historical data of the target feature into a price prediction model to obtain target price information within a target period; wherein the price prediction model is trained based on the data of the target feature, and the target feature is selected from multiple categories of features that affect the target price, the multiple categories of features including initial features and time-series-related alternative features derived from the initial features; The second acquisition module is configured to obtain a target price value within the target period based on the target price information.
12. A training device for a price prediction model, characterized in that: The training device comprises: An acquisition module is used to obtain data on multiple types of initial features that affect the target price; A feature derivation module, configured to perform feature derivation on at least one type of initial features to obtain candidate features related to the time series corresponding to the at least one type of features; A feature screening module is used to screen the multiple types of initial features and corresponding candidate features to obtain target features; An input module, configured to input historical data of the target feature into an initial model to obtain target price information within an auxiliary period; An adjustment module is used to adjust the parameters of the initial model based on the target price information in the auxiliary period to obtain a price prediction model.
13. A computing device, characterized in that include: memory and processor; The memory is used to store computer programs / instructions, and the processor is used to execute the computer programs / instructions. When the programs / instructions are executed by the processor, the method according to any one of claims 1 to 10 is implemented.
14. A computer-readable storage medium, characterized in that A computer program / instruction is stored, and when the computer program / instruction is executed by a processor, the method according to any one of claims 1 to 10 is implemented.
15. A computer program product, characterized in that The computer program product comprises a computer program / instruction, and when the computer program / instruction in the computer program product is executed by a processor, the method according to any one of claims 1 to 10 is implemented.