Construction method of carbon price prediction model, electronic equipment and readable storage medium
By extracting carbon-related news features and combining economic, energy, financial and climate factors, a carbon price prediction model is constructed, which solves the problem that existing technology is difficult to reflect the impact of unstructured data, and achieves more accurate carbon price prediction and market change reflection. .
Patent Information
- Application Number
- CN202410792385.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-19
- Publication Date
- 2024-09-03
AI Technical Summary
Existing carbon price prediction methods are difficult to reflect the impact of unstructured data on carbon price prediction, and there is a lack of solutions for combining machine learning methods with carbon emission news features.
By obtaining carbon-related news, use the LDA topic model to extract news features, and input them as predictors into models such as random forest, long short-term memory, and support vector regression for training, and build a carbon price prediction model.
The accuracy of carbon price prediction is improved, the error is reduced by more than 0.1, and it can reflect changes in the carbon market in a timely manner and closely match the carbon market situation.
Smart Images

Figure CN118586946A
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of price forecasting, and in particular to a method for constructing a carbon price forecasting model, an electronic device and a readable storage medium. Background Art
[0003] With the development of computer technology, news content mining has evolved from manual content coding to automated text content analysis using machines. For carbon price prediction based on machine learning, Lei et al. considered economic policies and regulations, energy prices, and carbon-related Baidu search indexes to predict carbon prices. Wang J, Zhuang Z, Gao D et al. used economic conditions, air quality index, and energy prices to predict carbon prices. Adekoya et al. mainly predicted carbon prices based on energy prices.
[0004] The above carbon price predictions are mostly based on structured data, while ignoring the importance of unstructured data for carbon price prediction. In terms of asset pricing, there is a lack of solutions on how unstructured data characteristics affect carbon price prediction and how to combine machine learning methods with carbon emission news characteristics to predict carbon prices.
[0005] It should be noted that the information disclosed in the background technology section of the invention is only intended to deepen the understanding of the general background technology of the invention, and should not be regarded as an admission or suggestion in any form that the information constitutes prior art already known to those skilled in the art. Summary of the invention
[0006] The purpose of the present invention is to provide a method for constructing a carbon price prediction model, an electronic device and a readable storage medium to solve the problem that it is difficult for relevant carbon price prediction methods to reflect the impact of unstructured data on carbon price prediction.
[0007] In order to solve the above technical problems, the present invention provides a method for constructing a carbon price prediction model, comprising the following steps:
[0008] Obtain carbon-related news within the required time period and extract news features using the LDA topic model;
[0009] Construct at least one carbon price prediction model, input the prediction factors and corresponding carbon prices within the required time period to train the carbon price prediction model, wherein the prediction factors include one or more of economic factors, energy factors, financial factors and climate factors;
[0010] The news features are then input as prediction factors to train the carbon price prediction model.
[0011] Preferably, a web crawler is used to obtain news links with preset keywords to collect the carbon-related news.
[0012] Preferably, before using the LDA topic model to extract news features, the crawled text of the carbon-related news is also pre-processed by denoising and word segmentation to extract valid carbon-related news.
[0013] Preferably, the news features include the reporting volume of news texts on each topic, the information disclosure quality of the news texts and the sentiment score of the news.
[0014] Preferably, the carbon price prediction model includes a random forest prediction model, a long short-term memory prediction model and a support vector regression prediction model.
[0015] Preferably, the economic factors include the CSI 300 Index, the Dow Jones Industrial Average and the Nasdaq Index; the energy factors include crude oil prices, natural gas prices and coal prices.
[0016] Preferably, the financial factors include the central parity rate of USD / RMB, the central parity rate of EUR / RMB and the central parity rate of GBP / RMB; the climate factors include the minimum temperature, the maximum temperature and the air quality within the required time period.
[0017] Preferably, the error of the carbon price prediction model after training using the news features is reduced by at least 0.1 compared with that before training.
[0018] The present invention also provides an electronic device, comprising a processor; and a memory, wherein the memory stores computer-readable instructions, and when the computer-readable instructions are executed by the processor, the method for constructing the above-mentioned carbon price prediction model is implemented.
[0019] The present invention also provides a readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the method for constructing the above-mentioned carbon price prediction model is implemented.
[0020] The method for constructing a carbon price prediction model provided in the present invention first constructs a carbon price prediction model using relevant prediction factors, and then incorporates carbon emission reduction news into the carbon price prediction model framework for training. This solves the problem that the frameworks of various current prediction models cannot closely fit the carbon market and cannot reflect changes in the carbon market in a timely manner.
[0021] The electronic device provided by the present invention and the method for constructing the carbon price prediction model provided by the present invention belong to the same inventive concept. Therefore, the electronic device provided by the present invention at least has all the advantages of the method for constructing the carbon price prediction model provided by the present invention, which will not be repeated here.
[0022] The readable storage medium provided by the present invention and the method for constructing the carbon price prediction model provided by the present invention belong to the same inventive concept. Therefore, the readable storage medium provided by the present invention at least has all the advantages of the method for constructing the carbon price prediction model provided by the present invention, which will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] Figure 1 It is an implementation flow chart of an embodiment of the present invention. DETAILED DESCRIPTION
[0024] The following is a further detailed description of the construction method, electronic device and readable storage medium of the carbon price prediction model proposed in the present invention in combination with the accompanying drawings and specific embodiments. According to the following description, the advantages and features of the present invention will be clearer. It should be noted that the drawings are all in a very simplified form and are all in an inaccurate proportion, which is only used to conveniently and clearly assist in explaining the purpose of the embodiments of the present invention. It should be understood that the drawings in the specification do not necessarily show the specific structure of the present invention in proportion, and the illustrative features used to illustrate certain principles of the present invention in the drawings in the specification will also adopt a slightly simplified drawing method. The specific design features of the present invention disclosed herein include, for example, specific dimensions, directions, positions and shapes, which will be determined in part by the specific environment to be applied and used. And, in the embodiments described below, sometimes the same figure mark is used in common between different drawings to represent the same part or a part with the same function, and its repeated description is omitted. In this specification, similar numbers and letters are used to represent similar items, so once an item is defined in one drawing, it does not need to be further discussed in subsequent drawings.
[0025] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In the description of the present invention, the meaning of "plurality" is at least two, such as two, three, etc., unless otherwise clearly and specifically defined.
[0026] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradiction.
[0027] The inventors' research found that carbon price forecasts rely on a large amount of data and information. Current carbon price forecasts mainly focus on economic policies and regulations, energy prices and economic conditions, air quality indexes, and carbon-related Baidu search indexes. The data sources are limited and are all structured data. The features of carbon emission reduction news are not fully incorporated into the system, and market changes cannot be reflected in a timely manner. Carbon prices cannot be predicted more accurately. The framework of the prediction model cannot closely fit the carbon market, and carbon price fluctuations cannot be accurately predicted.
[0028] Based on this, the core idea of the present invention is to first use relevant prediction factors to build a carbon price prediction model, and then incorporate the carbon emission reduction news features to train the carbon price prediction model framework for training, thereby solving the problem that the current frameworks of various prediction models cannot closely fit the carbon market and cannot reflect changes in the carbon market in a timely manner.
[0029] For details, please refer to Figure 1 , which is a schematic diagram of an embodiment of the present invention. Figure 1 As shown, a method for constructing a carbon price prediction model includes the following steps:
[0030] S1: Obtain carbon-related news within the required time period and extract news features using the LDA topic model.
[0031] S1.1: Specifically, a web crawler is used to obtain news links with preset keywords to collect the carbon-related news. In one embodiment, a web crawler technology is used to crawl news information from People's Daily Online, using "dual carbon", "carbon peak", "carbon neutrality" and "carbon technology" as keywords to search for initial links of news from January 2019 to June 2023, and obtain 19,946 pieces of original data.
[0032] S1.2: Furthermore, before using the LDA topic model to extract news features, the crawled carbon-related news texts are also pre-processed by denoising and word segmentation to extract valid carbon-related news. Exemplarily, after removing unqualified data, 16,231 final valid text data are screened and obtained.
[0033] S1.3: Mining text, extracting keywords from the main body of carbon-related news based on the LDA topic model, and obtaining the subdivision indicators of carbon emission reduction news. Among them, the news features include the amount of reports on each topic news text, the information disclosure quality of the news text, and the sentiment score of the news. For example, the amount of reports on each topic news and the information disclosure quality of the news can measure the news in terms of depth and breadth. The sentiment analysis library in Python is used to analyze the sentiment score of the news and quantify the news features.
[0034] In one embodiment, the LDA topic model analyzes the word distribution of the following topics: focusing on ways to achieve the dual carbon goals, focusing on policy guidelines related to carbon emission reduction, focusing on vision and blueprint, focusing on green finance, environmental education and environmental awareness, and paying attention to climate politics, and further analyzes the report volume of news texts on each topic.
[0035] S2: Construct at least one carbon price prediction model, input the prediction factors and corresponding carbon prices within the required time period to train the carbon price prediction model, wherein the prediction factors include one or more of economic factors, energy factors, financial factors and climate factors; and then input the news features as prediction factors to train the carbon price prediction model.
[0036] S2.1: Train the random forest prediction model (RF), long short-term memory prediction model (LSTM) and support vector regression prediction model (SVR) respectively. The input variables are all data from the time period of 2019.01-2023.06. The input prediction factors are four major categories of prediction factors: economic factors, energy factors, financial factors and climate factors, and the output is the carbon price. The conventional model mainly inputs the panel data of the carbon price market to optimize the model, but the carbon price is affected by multiple factors. The impact of panel data on carbon prices cannot essentially predict carbon prices. Here, multiple prediction models can be trained, and the prediction results can be evaluated based on the errors of each model to evaluate the accuracy of the prediction, which will help introduce news features later.
[0037] Specifically, the carbon price prediction model includes a random forest prediction model (RF), a long short-term memory prediction model (LSTM) and a support vector regression prediction model (SVR).
[0038] Exemplarily, the economic factors include the Shanghai and Shenzhen 300 Index, the Dow Jones Industrial Average and the Nasdaq Index; the energy factors include crude oil prices, natural gas prices and coal prices. The financial factors include the central parity rate of the US dollar against the RMB, the central parity rate of the euro against the RMB and the central parity rate of the British pound against the RMB; the climate factors include the lowest temperature, the highest temperature and the air quality in the required time period. The economic factors can also be the KOSPI (Korea Composite Stock Price Index) index, the KOSDAQ (Korea Securities Dealers Automatic Quotation) index, the Nikkei and Japan JASDAQ Securities Brokers Automatic Quotation Association index. The climate factor can be the lowest temperature, the highest temperature and the air quality in a specified area in the required time period, or even the number of meteorological disasters.
[0039] In one embodiment, the prediction factors obtained above and the corresponding carbon prices within the required time period are used as sample data sets, and the data are divided into training set, test set and validation set through the train_test_split function of the Scikit-Learn library. Among them, the test set accounts for 15% of the total data of the sample data set, the training data set accounts for 70% of the total data of the sample data set, and the validation set accounts for 15% of the total data of the sample data set. The amount of data in the training set is greater than the amount of data in the test. Secondly, for the divided data sets, the feature scaling function (Standard Scaler) of the Scikit-Learn library is used to scale the data sets. In the end, the errors of each model were 0.8, 0.5, and 1, which are better than the errors of the conventional model. It can be seen that the prediction model trained by the above method has a better prediction effect.
[0040] S22: With other input data unchanged, news features are added to the carbon price prediction model. The prediction results based on RF, SVR and LSTM models confirm that after adding the carbon emission reduction news feature prediction factor, the prediction accuracy of carbon prices is improved, and the error is reduced by more than 0.1.
[0041] Among them, the error of the carbon price prediction model after training with the news features is at least 0.1 lower than that before training. The prediction error of the LSTM model trained with news features is 0.4. Incorporating unstructured data into the training of the carbon price prediction model can closely follow the changes in the carbon market and reflect the changes in the carbon market in a timely manner.
[0042] Based on the same technical concept, the present disclosure also provides an electronic device, including a processor; and a memory, wherein the memory stores computer-readable instructions, and when the computer-readable instructions are executed by the processor, the above method is implemented.
[0043] The electronic device is presented in the form of a general-purpose computing device. The components of the electronic device may include, but are not limited to: the above-mentioned at least one processing unit, the above-mentioned at least one storage unit, a bus connecting different system components (including the storage unit and the processing unit), and a display unit. Among them, the storage unit stores a program code, and the program code can be executed by the processing unit, so that the processing unit performs the steps of various exemplary embodiments of the present invention described in the above-mentioned "Exemplary Method" section of this specification. The storage unit may include a readable medium in the form of a volatile storage unit, such as a random access memory unit (RAM) and / or a cache memory unit, and may further include a read-only memory unit (ROM). The bus may represent one or more of several types of bus structures, including a storage unit bus or a storage unit controller, a peripheral bus, a graphics acceleration port, a processing unit, or a local bus using any of a variety of bus structures.
[0044] The electronic device may also communicate with one or more external devices (e.g., keyboards, pointing devices, Bluetooth devices, etc.), may also communicate with one or more devices that enable a user to interact with the electronic device, and / or may communicate with any device that enables the electronic device to communicate with one or more other computing devices (e.g., routers, modems, etc.). Such communication may be performed through an input / output (I / O) interface. Furthermore, the electronic device may also communicate with one or more networks (e.g., local area networks (LANs), wide area networks (WANs), and / or public networks, such as the Internet) through a network adapter. The network adapter communicates with other modules of the electronic device through a bus.
[0045] Through the description of the above embodiments, it is easy for those skilled in the art to understand that the example embodiments described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the embodiment of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the embodiment of the present disclosure.
[0046] In an exemplary embodiment of the present disclosure, a readable storage medium is also provided, on which a computer program is stored, and when the computer program is executed by a processor, the method for constructing the carbon price prediction model described above is implemented. In some possible embodiments, various aspects of the present invention can also be implemented in the form of a program product, which includes a program code, and when the program product is run on a terminal device, the program code is used to cause the terminal device to execute the steps according to various exemplary embodiments of the present invention described in the above "Exemplary Method" section.
[0047] In summary, in the method for constructing a carbon price prediction model, an electronic device, and a readable storage medium provided in an embodiment of the present invention, carbon emission reduction news is collected by using web crawler technology; LDA topic modeling is used to extract the topic distribution of each document in the corpus for text clustering, the sentiment characteristics of the news are analyzed, and news features are extracted; the random forest (RF), long short-term memory (LSTM), and support vector regression (SVR) models based on machine learning are incorporated into the carbon emission reduction news features for training, which solves the problems that the existing prediction model cannot reflect the changes in the carbon market in a timely manner, and the framework of the prediction model cannot closely fit the carbon market. In addition, it also provides important inspiration for the government to establish a suitable carbon trading system and for enterprises to adjust their business strategies.
[0048] The above description is only a description of the preferred embodiments of the present invention, and is not intended to limit the scope of the present invention. Any changes or modifications made by a person skilled in the art in the field of the present invention based on the above disclosure shall fall within the scope of protection of the claims.
Claims
1. A method for constructing a carbon price prediction model, characterized in that: The following steps are involved: Obtain carbon-related news within the required time period and extract news features using the LDA topic model; Construct at least one carbon price prediction model, input the prediction factors and corresponding carbon prices within the required time period to train the carbon price prediction model, wherein the prediction factors include one or more of economic factors, energy factors, financial factors and climate factors; The news features are then input as prediction factors to train the carbon price prediction model.
2. The method for constructing a carbon price prediction model according to claim 1, characterized in that: A web crawler is used to obtain news links with preset keywords to collect the carbon-related news.
3. The method for constructing a carbon price prediction model according to claim 2, characterized in that: Before using the LDA topic model to extract news features, the crawled carbon-related news text is pre-processed by denoising and word segmentation to extract valid carbon-related news.
4. The method for constructing a carbon price prediction model according to claim 1, characterized in that: The news features include the reporting volume of news texts of each topic, the information disclosure quality of the news texts and the sentiment score of the news.
5. The method for constructing a carbon price prediction model according to claim 1, characterized in that: The carbon price prediction model includes a random forest prediction model, a long short-term memory prediction model and a support vector regression prediction model.
6. The method for constructing a carbon price prediction model according to claim 1, characterized in that: The economic factors include the CSI 300 Index, the Dow Jones Industrial Average and the Nasdaq Index; the energy factors include crude oil prices, natural gas prices and coal prices.
7. The method for constructing a carbon price prediction model according to claim 1, characterized in that: The financial factors include the central parity rate of USD / RMB, the central parity rate of EUR / RMB and the central parity rate of GBP / RMB; the climate factors include the minimum temperature, the maximum temperature and the air quality within the required time period.
8. The method for constructing a carbon price prediction model according to claim 1, characterized in that: The error of the carbon price prediction model after training with the news features is at least reduced by 0.1 compared with that before training.
9. An electronic device, characterized in that: It includes a processor; and a memory, wherein the memory stores computer-readable instructions, and when the computer-readable instructions are executed by the processor, a method for constructing a carbon price prediction model according to any one of claims 1 to 8 is implemented.
10. A readable storage medium, characterized in that: A computer program is stored thereon, and when the computer program is executed by a processor, the method for constructing a carbon price prediction model according to any one of claims 1 to 8 is implemented.
Citation Information
Cited By
Order quotation method and device for e-commerce industry supply chain, equipment and medium
CN119250858A
An order quotation method, device, equipment and medium of an e-commerce industry supply chain
CN119250858B
