A method and system for predicting hourly electricity consumption based on machine learning algorithms
By using a machine learning algorithm based on the VAR model and combining it with meteorological data to predict electricity consumption, the problems of low prediction accuracy and large sample size requirements in existing technologies are solved, and high-precision hourly electricity consumption prediction is achieved, especially when the number of samples is insufficient.
Patent Information
- Application Number
- CN202211534465.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-02
- Publication Date
- 2025-10-17
- Estimated Expiration
- 2042-12-02
AI Technical Summary
Existing power load forecasting methods have the problems of low prediction accuracy and require a large number of learning samples. Especially when the number of samples is insufficient, it is difficult to achieve accurate hourly electricity consumption forecasts.
A machine learning algorithm based on the VAR model is used to determine the lag order through Granger causality test, cointegration test and Akaike Information Criterion. Combined with multiple linear regression and ARIMA time series models, a data forecasting model is established to predict future electricity consumption using temperature, wind speed and humidity data.
The accuracy of electricity consumption forecasting is improved and the demand for data sample size is reduced. Especially when the number of samples is insufficient, it has significant advantages over supervised learning machine learning algorithms and has outstanding prediction effects.
Smart Images

Figure CN115907033B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of machine learning algorithms, and in particular to a method and system for predicting hourly electricity consumption based on a machine learning algorithm. Background Art
[0002] Smart grids are currently recognized as having great potential for providing a seamless and continuous power supply. To achieve this goal, much research is focused on using historical hourly electricity consumption to predict hourly electricity consumption. This technology helps monitor electricity demand, allocate power appropriately, maintain grid stability, and ensure reliable power supply and security. Otherwise, overestimating or underestimating grid electricity consumption can pose challenges to the grid.
[0003] Overestimating power load forecasts can lead to unnecessary power reserves and uneven energy distribution, resulting in increased operating costs. However, underestimating power loads can also lead to issues with power reliability and safety. In summary, accurate power forecasting is crucial for smart grids, improving the stability, security, and reliability of power systems.
[0004] Currently, there are two common methods for power forecasting: statistical methods such as ARIMA (Animal Integrated Moving Average) and machine learning methods such as RNN (Recurrent Neural Network). However, these two methods also have significant shortcomings. The former were proposed relatively long ago and often provide less than ideal forecast results. The latter, as supervised learning algorithms, often require a large number of learning samples. Summary of the Invention
[0005] The present invention provides a method and system for predicting hourly electricity consumption based on a machine learning algorithm, which can improve the prediction accuracy. At the same time, based on the characteristics of its own algorithm, the required data sample size is small. Compared with the machine learning algorithm of supervised learning, it has obvious advantages in the required sample size. In specific scenarios where the number of samples is insufficient, the prediction effect of using this algorithm model is more outstanding than other machine learning models.
[0006] A method for predicting hourly electricity consumption based on a machine learning algorithm comprises the following steps:
[0007] Step 1: Obtain electricity consumption data and weather data, where electricity consumption data includes time, user number, and electricity consumption, and weather data includes local recording time, temperature, wind speed, and humidity;
[0008] Step 2: Clean the electricity data and weather data obtained in step 1;
[0009] Step 3: Model the cleaned data. The modeling process is as follows:
[0010] Step 1: Conducting the test of independent variable and dependent variable, i.e. Granger causality test, to determine whether there is a causal relationship between the electricity consumption as the dependent variable and the temperature, wind power, humidity as the independent variable. If there is a causal relationship, proceed to the next step:
[0011] Step 2: Conducting the test of independent variable and dependent variable, i.e. co-integration test, to determine whether the time series is stationary. If the co-integration test fails, difference is needed, and then the co-integration test is conducted again with the difference data. If the test is passed, proceed to the next step;
[0012] Step 3: Determining the lag order of the model according to the Akaike information criterion;
[0013] Step 4: Conducting the test of model dependent variable, i.e. determining whether the electricity consumption time series has no random error autocorrelation. If the test is passed, proceed to the next step;
[0014] Step 5: Establishing a VAR model, which includes a multiple linear regression model and a time series model, to form a first mapping between the temperature, wind power, humidity as X and the electricity consumption as Y with lag order, and a second mapping between the electricity consumption as Y1 and the electricity consumption as Y2 with lag order, where the first mapping is the multiple linear regression model and the second mapping is the ARIMA time series model;
[0015] Step 6: Predicting the electricity consumption at future time according to the VAR model established in step 5.
[0016] Further, in step 1, the electricity consumption data is obtained from the company database through SQL query, and the weather data is obtained from the weather website through the crawler program.
[0017] Further, in step 2, the obtained data is cleaned, which includes:
[0018] Merging data: merging the electricity consumption data obtained from the database query and the weather data obtained from the crawler through the time dimension to obtain each data containing time, user number, electricity consumption, temperature, wind power, and humidity dimensions;
[0019] Deleting abnormal values: including deleting samples with negative electricity consumption;
[0020] Deleting missing values: deleting samples with missing electricity consumption values;
[0021] Dimension correlation analysis: through scatter plot and heat map, it is found that there is a correlation between the temperature, wind power, humidity in the independent variable dimension and the electricity consumption in the dependent variable.
[0022] Further, the Durbin-Watson test is used to judge the residual error, when the test value is close to 2, there is no random error autocorrelation, and the time series passes the Durbin-Watson test. When the test value is close to 0 or 4, it means that there is positive or negative sequence correlation, and the time series does not pass the Durbin-Watson test.
[0023] Further, step four predicts the power consumption at the future time according to the VAR model established in step three, specifically including: inputting the prediction set including power consumption, temperature, wind power and humidity into the VAR model, that is, outputting the power consumption at the 24th time in the future.
[0024] A system for predicting hourly power consumption based on a machine learning algorithm, comprising:
[0025] A data acquisition module for acquiring power consumption data and weather data, wherein the power consumption data includes time, user number and power consumption, and the weather data includes local recording time, temperature, wind power and humidity.
[0026] A data cleaning module for cleaning the power consumption data and weather data acquired by the data acquisition module.
[0027] A VAR model establishment module for modeling the cleaned data, and the modeling process is as follows:
[0028] Test 1 between independent variables and dependent variables, that is, Granger causality test, to determine whether there is a causal relationship between power consumption as the dependent variable and temperature, wind power and humidity as the independent variable, if there is a causal relationship, then execute the next step:
[0029] Test 2 between independent variables and dependent variables, that is, cointegration test, to determine whether the time series is stationary, if the cointegration test fails, difference is needed, then use the difference data to perform cointegration test again, if the test passes, then execute the next step;
[0030] Determine the lag order of the model according to the Akaike information criterion;
[0031] Test the dependent variable of the model, that is, determine whether the power consumption time series has no random error autocorrelation, if the test passes, then execute the next step;
[0032] Establish a VAR model: the VAR model includes a multiple linear regression model and a time series model, to form a first mapping between the temperature, wind power and humidity as the current X and the power consumption as the lag order as the Y, and to form a second mapping between the power consumption as the current Y1 and the power consumption as the lag order as the Y2, wherein the first mapping is the multiple linear regression model, and the second mapping is the ARIMA time series model;
[0033] A prediction module is configured to predict the power consumption at a future time according to the VAR model established by the VAR model establishment module.
[0034] Further, the data acquisition module acquires the power consumption data through an SQL query and acquires the weather data through a crawler program.
[0035] Further, the data cleaning module cleans the power consumption data and the weather data acquired by the data acquisition module, and specifically includes:
[0036] Merging data: the power consumption data acquired by the database query and the weather data acquired by the crawler are associated through a time dimension to obtain dimensions including time, user number, power consumption, temperature, wind power and humidity contained in each piece of data;
[0037] Deleting abnormal values: including deleting samples with negative power consumption;
[0038] Deleting missing values: deleting samples with missing values of power consumption;
[0039] Dimension correlation analysis: through a scatter plot and a heat map, it is found that there is a correlation between the temperature, wind power and humidity in the independent variable dimension and the power consumption in the dependent variable.
[0040] The VAR model established by the application is an improved version based on the ARIMA model, and the prediction accuracy is improved, and meanwhile, based on the algorithm characteristics, the required data sample size is small (usually dozens are enough), and compared with the supervised learning machine learning algorithm, the advantage in the required sample size is obvious. In the specific scene of insufficient sample quantity, compared with other machine learning models, the prediction effect of the algorithm model is more prominent. BRIEF DESCRIPTION OF DRAWINGS
[0041] Figure 1 Visualization display of the predicted hourly power consumption and the real value based on the hourly power consumption, temperature, wind speed and humidity of the previous day;
[0042] Figure 2 Visualization display of the predicted hourly power consumption and the real value based on the hourly power consumption, temperature, wind speed and humidity of the previous two days;
[0043] Figure 3 It is a principle diagram of the prediction method of the application;
[0044] Figure 4 It is a flowchart of the method for predicting the hourly power consumption based on the machine learning algorithm. DETAILED DESCRIPTION
[0045] In order to make the purposes, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative work fall within the protection scope of the present application.
[0046] The inventors of the present application have found that a vector autoregressive model (VAR model for short) is an improved version based on an ARIMA model, the prediction accuracy is improved, and the required data sample size is small, usually dozens are enough, and the VAR model has been applied in the field of financial quantification. According to the characteristics of the algorithm model, it can also be used in the power field, in addition to predicting hourly electricity consumption, it can also predict temperature. Because the power transmission and generation of the power system is greatly affected by meteorological elements, the increase or decrease of temperature will affect the electricity consumption. In addition, in new energy, photovoltaic is also affected by temperature and fluctuates. Therefore, real-time monitoring of temperature and accurate electricity consumption prediction can improve the level of electricity consumption prediction and power generation prediction, and improve the stability of the power system.
[0047] As shown in Figure 3 The present application uses a VAR vector autocorrelation machine learning model to predict hourly electricity consumption according to hourly meteorological data (temperature, wind and humidity) of the previous day or the previous two days combined with hourly electricity consumption data of the previous day.
[0048] Figure 4 As shown in the detailed flowchart of the method for predicting hourly electricity consumption based on the machine learning algorithm of the present application, the method comprises the following steps:
[0049] Step one, data acquisition
[0050] The data source comes from two parts, database query and crawler acquisition. The electricity consumption data is obtained by SQL query in the company database, and the dimensions include time, user number, electricity consumption, etc. At the same time, the local recorded time, temperature, wind, humidity and other weather data of the weather website are grabbed through the crawler program.
[0051] Step two, data processing
[0052] The obtained data is cleaned and processed, and the specific process comprises the following steps:
[0053] 2.1. Data Merge: The electricity consumption data from the database query and the weather data obtained by the crawler are associated using the time dimension. Each data item contains the following dimensions: time, user ID, electricity consumption, temperature, wind speed, and humidity.
[0054] 2.2. Delete outliers: For example, delete samples with negative electricity consumption;
[0055] 2.3. Missing Value Deletion: Specifically, samples with missing values for electricity consumption are deleted. Since the prediction granularity is hourly, if any of the 24 samples for a day are missing, all 24 data points for that day need to be deleted.
[0056] 2.4. Dimensional Correlation Analysis: Through scatter plots, heat maps, and other methods, we found that there is a correlation between the temperature, wind speed, and humidity in the independent variable dimensions and the electricity consumption in the dependent variable.
[0057] Step 3: Model the data processed in step 2, and finally predict the electricity consumption in the future based on the established model.
[0058] In this implementation case, both electricity consumption and meteorological data are time series data, and time series algorithms are used for modeling and forecasting analysis. Modeling begins after data processing. The entire modeling process is divided into: test 1 of the model independent variables and dependent variables (Granger causality test), test 2 of the model independent variables and dependent variables (cointegration test), determine the model parameters (lag order), test the model dependent variables (judgment of residuals), establish a VAR model, and finally output the predicted electricity consumption results at future moments (see Figures 1-2 ) and analyze.
[0059] The specific steps of the modeling process are as follows:
[0060] (1) Test of model independent variables and dependent variables 1 (Granger causality test)
[0061] The Granger causality test is used during the modeling process to analyze the relationship between variables that depends on past events. It is a prerequisite for VAR calculations. Only independent variables that pass this test can be predicted using the VAR vector autocorrelation algorithm; independent variables that fail the Granger causality test must be deleted.
[0062] Since the grangercausalitytests module is already packaged in the Python statsmodels library, it can be called. This test finds a causal relationship between the dependent variable (electricity consumption) and the independent variables (temperature, wind speed, and humidity), thus passing the test.
[0063] (2) Test 2 of the model's independent and dependent variables (cointegration test)
[0064] Cointegration test is a test method used to determine whether a time series is stationary (mean does not rise or fall and variance is constant) in the modeling process, and is one of the prerequisites for VAR algorithm calculation, and after Granger causality test. Only time series that pass the cointegration test (stationary time series) can use VAR to predict values. When the cointegration test fails, difference needs to be made, and then cointegration test is performed again using the difference data.
[0065] The coint module has been packaged in the statsmodels library of python and can be called. After calling, it is found that there is a short-term stationary relationship between the dependent variable (power consumption) and the independent variable (temperature, wind power, humidity), so the test is passed.
[0066] (3) Determine the parameters of the model (lag order)
[0067] The lag order is an important parameter in the model. Determining the lag order is a step in the modeling process, and is usually determined according to the Akaike information criterion (AIC), which is also a prerequisite for VAR algorithm calculation. The lag order is very large or very small, which will have a very serious impact on the effectiveness of the parameter estimation of VAR. The lag order is generally determined according to the Akaike information criterion (AIC), and the smaller the AIC value, the better.
[0068] In the implementation process, the Akaike information criterion (AIC) value shows that when the lag order is 24 (the previous day), the error is the smallest.
[0069] This result also conforms to our common sense, because the daily power consumption data is periodic, and the lag order of 24 means that the model uses the 1st time point to predict the 25th time point, the 2nd time point to predict the 26th time point, and so on, and then runs in turn.
[0070] (4) Test of model dependent variable (judge residual)
[0071] The correlation of the residual is a step in the modeling process, and is usually judged by the Durbin-Watson test, which is also a prerequisite for VAR algorithm calculation. Durbin-Watson was originally used in econometrics to test the autocorrelation of random errors. When the test value is close to 2, there is no autocorrelation of random errors, and the time series passes the Durbin-Watson test. When the test value is close to 0 or 4, it means that there is positive or negative serial correlation of random errors, and the time series does not pass the Durbin-Watson test.
[0072] If the time series of electricity consumption cannot pass the test, indicating that the random error value has sequence correlation, it is not suitable for establishing a VAR model for prediction. Then this batch of data cannot be used, and another batch of data needs to be replaced (back to step one) and cleaned.
[0073] In this implementation case, the Durbin-Watson test value of each dependent variable (electricity consumption) is very close to 2, indicating that there is no autocorrelation in the random error, which passes the Durbin-Watson test.
[0074] (5) Establishing a VAR model
[0075] VAR algorithm is the calculation and prediction link in the modeling process, which is used to predict electricity consumption. According to the Akaike Information Criterion (AIC) in step 5, we construct a VAR algorithm with a lag order of 24 here.
[0076] VAR model is composed of two models (multivariate linear regression + time series). Let the current X (temperature, wind, humidity) and the future 24th time (i.e. lag order) Y (electricity consumption) form a mapping 1, and let the current Y1 (electricity consumption) and the future 24th time Y2 (electricity consumption) form a mapping 2. Mapping 1 is a multivariate linear regression model, and mapping 2 is an ARIMA time series model.
[0077] The VAR module has been packaged in the statsmodels library of python and can be called. Through the fitting and training of multiple groups of data in the training set, the training is completed when the overall error is minimized. At this time, the prediction set (electricity consumption, temperature, wind, humidity) is input, and the electricity consumption at the 24th time in the future can be predicted.
[0078] (6) Result analysis
[0079] After the VAR algorithm outputs the predicted value, the error between the predicted value and the true value is calculated using the index to evaluate the performance of the model. Here, two indexes are used: R square (R2) and mean absolute percentage error (MAPE).
[0080] The definition of R square is: the ratio of the regression sum of squares of variable x causing y variation to the total sum of squares of y variation, also known as goodness of fit, which reflects how much percentage of the fluctuation of y can be described by the fluctuation of x, that is, how much percentage of the variation of dependent variable Y can be explained by the controlled independent variable X.
[0081] The definition of MAPE is: mean absolute percentage error. MAPE is 0% for a perfect model, and MAPE is greater than 100% for a poor model.
[0082] The overall error result analysis is as follows:
[0083] Table 1
[0084] One day data prediction Two days data prediction MAPE 1.58% 8.60% Electricity consumption prediction value R2 0.867 0.739
[0085] From table 1, when the previous day's electricity consumption, temperature, wind, humidity of the hour is used to predict the electricity consumption of the day, the model's electricity consumption explanation degree (R2) and the average absolute percentage error (MAPE) value are as follows. The model's overall performance is still good.
[0086] The error situation is refined to each day, and the predicted value is compared with the real value by using graphics:
[0087] Figure 1 And Figure 2 is the comparison curve between the predicted electricity consumption and the real value. We can see that when the previous day's data is used to predict the hourly electricity consumption, the curve of the predicted value and the real value is relatively consistent. In particular, the rising and falling fluctuation trend is consistent. When the real value fluctuates greatly, the difference between the predicted value and the real value is relatively large. In addition, when the electricity consumption and weather value of the previous two days are used to predict the hourly electricity consumption, the difference between the predicted value and the real value is larger than that of the previous day. It can be seen that when the electricity consumption of the time close in time and the trend is relatively consistent is used to predict the future electricity consumption, the difference is relatively small. Therefore, in the actual implementation process, we use the predicted value of the previous day's data as the main monitoring value, and use the predicted value of the previous two days' data as the auxiliary monitoring value to make early warning for the possible high electricity consumption in the future.
[0088] The embodiment of the application also provides a system for predicting hourly electricity consumption based on a machine learning algorithm, comprising:
[0089] A data acquisition module is configured to acquire electricity consumption data and weather data, wherein the electricity consumption data comprises time, user number and electricity consumption, and the weather data comprises local recording time, temperature, wind and humidity.
[0090] A data cleaning module is configured to clean the electricity consumption data and weather data acquired by the data acquisition module.
[0091] A VAR model establishing module is configured to model the cleaned data, and the modeling process is as follows:
[0092] Step 1: Test the independent variable and the dependent variable, that is, the Granger causality test, to determine whether there is a causal relationship between the electricity consumption as the dependent variable and the temperature, wind and humidity as the independent variable. If there is a causal relationship, the next step is performed:
[0093] Carrying out the test 2 of independent variable and dependent variable, that is, the co-integration test, judging whether the time series is stationary, when the co-integration test fails, difference is needed, then the co-integration test is carried out again with the difference data, if the test is passed, the next step is executed;
[0094] The lag order of the model is determined according to the Akaike information criterion;
[0095] The test of the model dependent variable is carried out, that is, judging whether the power consumption time series has no random error autocorrelation, if the test is passed, the next step is executed;
[0096] The VAR model is established: the VAR model includes a multiple linear regression model and a time series model, the current temperature, wind power, humidity and lag order as Y of the power consumption as X form a first mapping, and the current power consumption as Y1 and the lag order as Y2 form a second mapping, wherein the first mapping is a multiple linear regression model, and the second mapping is an ARIMA time series model;
[0097] The prediction module is used for predicting the power consumption at a future time according to the VAR model established by the VAR model establishment module.
[0098] The present application is a machine learning method based on econometrics algorithm, applied to the power industry, and used for hourly power consumption prediction, belonging to application field innovation; in addition, the model effect is good in the specific scene of insufficient sample size. The VAR model is an improved version based on the ARIMA model, the prediction accuracy is improved, and the required data sample size is small (usually dozens are enough), and the required sample size is obviously superior to the machine learning algorithm of supervised learning. In the specific scene of insufficient sample size, compared with other machine learning models, the prediction effect of the algorithm model is more prominent.
[0099] The above is only a specific embodiment of the present application, but the protection scope of the present application is not limited to this, any person skilled in the art can easily think of changes or replacements within the technical scope disclosed by the present application, which should be covered within the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.
Claims
1. A method for predicting hourly electricity consumption based on a machine learning algorithm, characterized by: The steps include: Step 1: Obtain electricity consumption data and weather data, where electricity consumption data includes time, user number, and electricity consumption, and weather data includes local recording time, temperature, wind speed, and humidity; Step 2: Clean the electricity data and weather data obtained in step 1; Step 3: Model the cleaned data. The modeling process is as follows: Perform the test 1 between the independent variable and the dependent variable, i.e., the Granger causality test, to determine whether there is a causal relationship between the electricity consumption as the dependent variable and the temperature, wind speed, and humidity as the independent variables. If there is a causal relationship, proceed to the next step: Perform test 2 of the independent variable and the dependent variable, i.e., cointegration test, to determine whether the time series is stationary. If the cointegration test fails, it is necessary to perform difference analysis and then use the differenced data to perform the cointegration test again. If the test passes, proceed to the next step. The lag order of the model was determined according to the Akaike Information Criterion; Perform a test on the model's dependent variable. If it is determined that there is no random error autocorrelation in the electricity consumption time series, the test passes and the next step is executed. Establish a VAR model: The VAR model includes a multiple linear regression model and a time series model. A first mapping is formed between the current temperature, wind speed, and humidity (X) and the lagged order electricity consumption (Y), and a second mapping is formed between the current electricity consumption (Y1) and the lagged order electricity consumption (Y2). The first mapping is the multiple linear regression model, and the second mapping is the ARIMA time series model. Step 4: Predict the electricity consumption at future times based on the VAR model established in step 3.
2. The method for predicting hourly electricity consumption based on a machine learning algorithm according to claim 1, wherein: In step 1, electricity consumption data is obtained from the company database through SQL query, and weather data is obtained by crawling the weather website through a crawler program.
3. The method for predicting hourly electricity consumption based on a machine learning algorithm according to claim 1, wherein: Step 2: Clean the acquired data, including: Merge data: The electricity consumption data from the database query and the weather data obtained by the crawler are associated through the time dimension, so that each data item contains the dimensions of time, user number, electricity consumption, temperature, wind speed, and humidity. Deleting outliers: including deleting samples with negative electricity consumption; Missing value deletion: Delete samples with missing values in electricity consumption; Dimensional correlation analysis: Through scatter plots and heat maps, it was found that there is a correlation between the temperature, wind speed, and humidity in the independent variable dimensions and the electricity consumption in the dependent variable.
4. The method for predicting hourly electricity consumption based on a machine learning algorithm according to claim 1, wherein: The Durbin-Watson test is used to judge the residuals. When the test value is close to 2, there is no random error autocorrelation and the time series passes the Durbin-Watson test. When the test value is close to 0 or 4, it indicates that there is positive serial correlation or negative serial correlation in the random sequence, and the time series does not pass the Durbin-Watson test.
5. The method for predicting hourly electricity consumption based on a machine learning algorithm according to claim 1, wherein: Step 4 predicts the electricity consumption at future moments based on the VAR model established in step 3, specifically including: inputting a prediction set including electricity consumption, temperature, wind speed, and humidity into the VAR model, that is, outputting the electricity consumption at the 24th moment in the future.
6. A system for predicting hourly electricity consumption based on a machine learning algorithm, characterized in that: include: The data acquisition module is used to obtain electricity consumption data and weather data, where the electricity consumption data includes time, user number, and electricity consumption, and the weather data includes local recording time, temperature, wind speed, and humidity; The data cleaning module is used to clean the power data and weather data obtained by the data acquisition module; The VAR model building module is used to build a model for the cleaned data. The modeling process is as follows: Perform the test 1 between the independent variable and the dependent variable, i.e., the Granger causality test, to determine whether there is a causal relationship between the electricity consumption as the dependent variable and the temperature, wind speed, and humidity as the independent variables. If there is a causal relationship, proceed to the next step: Perform test 2 of the independent variable and the dependent variable, i.e., cointegration test, to determine whether the time series is stationary. If the cointegration test fails, it is necessary to perform difference analysis and then use the differenced data to perform the cointegration test again. If the test passes, proceed to the next step. The lag order of the model was determined according to the Akaike Information Criterion; Perform a test on the model's dependent variable. If it is determined that there is no random error autocorrelation in the electricity consumption time series, the test passes and the next step is executed. Establish a VAR model: The VAR model includes a multiple linear regression model and a time series model. A first mapping is formed between the current temperature, wind speed, and humidity (X) and the lagged order electricity consumption (Y), and a second mapping is formed between the current electricity consumption (Y1) and the lagged order electricity consumption (Y2). The first mapping is the multiple linear regression model, and the second mapping is the ARIMA time series model. The prediction module is used to predict the power consumption at future times based on the VAR model established by the VAR model establishment module.
7. The system for predicting hourly electricity consumption based on a machine learning algorithm according to claim 6, wherein: The data acquisition module obtains electricity consumption data through SQL query and obtains weather data by crawling weather websites through a crawler program.
8. The system for predicting hourly electricity consumption based on a machine learning algorithm according to claim 6, wherein: The data cleaning module cleans the power data and weather data acquired by the data acquisition module, specifically including: Merge data: The electricity consumption data from the database query and the weather data obtained by the crawler are associated through the time dimension, so that each data item contains the dimensions of time, user number, electricity consumption, temperature, wind speed, and humidity. Deleting outliers: including deleting samples with negative electricity consumption; Missing value deletion: Delete samples with missing values in electricity consumption; Dimensional correlation analysis: Through scatter plots and heat maps, it was found that there is a correlation between the temperature, wind speed, and humidity in the independent variable dimensions and the electricity consumption in the dependent variable.
Citation Information
Patent Citations
Annual-electricity-sales prediction method based on external environment factors and cointegration theory
CN107992991A
Method for predicting industrial sewage inflow based on ARIMA model
CN108564229A