Electricity Price Forecasting Project
Electricity Price Forecasting Project
Project Title:
Electricity Price Forecasting and Load Optimization using Hybrid
Machine Learning Models
I would like to express my sincere gratitude to my supervisor, Dr. Ashwani Kumar, for his continuous guidance,
encouragement, and support throughout the completion of this design project. His insights and expertise in the
field of power systems, energy management and smart grid were invaluable in shaping the direction and quality
of my work.
I am deeply thankful for his mentorship, which helped me understand the practical aspects of forecasting, opti-
mization, and smart energy management. This project would not have been possible without his consistent support
and constructive feedback.
I also extend my appreciation to the Electrical Engineering Department, National Institute of Technology, Kuruk-
shetra, for providing the academic environment and necessary resources that enabled me to carry out this work
effectively.
ii
Declaration
I hereby declare that the work presented in this design project report titled “Electricity Price Forecasting and
Load Optimization using Hybrid Machine Learning Models”, submitted in partial fulfillment of the require-
ments for the award of the degree of [Link] in Electrical Engineering, is my original work carried out under the
mentorship of Dr. Ashwani Kumar, National Institute of Technology, Kurukshetra.
The work presented in this report has not been submitted by me for the award of any other degree of any other
institute. I have taken care in all respects to honor the intellectual property right, and have acknowledged the
contribution(s) of others for using them for this academic purpose. I will be liable for full or partial violation of
copyright or intellectual property right, if found at any stage even after award of my degree, not my mentor(s)/
Head of Department/ Institute.
I have mentored and guided the candidate throughout the Design Project period, and I certify that the report
accurately reflects the candidate’s contributions and achievements to the best of our knowledge.
iii
Abstract
This project presents a hybrid machine-learning framework for short-, medium-, and long-term electricity price
forecasting, combined with load optimization under Time-of-Use tariff conditions. Reliable forecasting of elec-
tricity demand and pricing is essential for modern power systems, enabling better planning, cost reduction, and
demand-side management. In this work, historical household power consumption data is preprocessed and mod-
elled using a set of complementary time-series techniques, including Auto-ARIMA, Prophet, and gradient-boosted
regression. These models are used to generate forecasts across three horizons—7 days, 1 month, and 1 year cap-
turing both short-term variations and long-term seasonal trends.
The predicted load profiles are mapped to TOU tariff categories to estimate dynamic electricity costs. An opti-
mization strategy is then applied, reducing peak demand by 10 percent and shifting load into lower-tariff periods
without altering the total energy consumption. Performance is evaluated through graphical comparison of baseline
and optimized schedules, cost distribution across tariff bands, and model accuracy metrics.
Simulation results show that the hybrid approach improves forecasting reliability across all time horizons, smooths
noisy demand signals, and delivers measurable reductions in overall energy cost. The project demonstrates the
practical relevance of data-driven forecasting and optimization in smart grid environments, industrial energy plan-
ning, and intelligent home energy management systems.
iv
Contents
5 FORECASTING METHODOLOGY 15
5.1 Short-Term (7-Day) Forecasting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
5.2 Medium-Term (1-Month) Forecasting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
5.3 Long-Term (1-Year) Forecasting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
v
vi CONTENTS
9 Future Scope 25
9.1 Integration with Deep Learning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
9.2 Including Weather and Market Signals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
9.3 Real-Time Optimization with IoT Meters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
9.4 AI-Driven Demand Response . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
Final Remarks 26
Bibliography 27
Chapter 1
Electricity price forecasting has become a critical discipline in modern power systems, driven by the rapid growth
of smart grids, renewable energy integration, and data-driven energy management strategies. As electricity de-
mand fluctuates throughout the day due to consumer behaviour, weather changes, industrial operations, and sea-
sonal effects, forecasting models enable engineers to estimate future load patterns and corresponding electricity
prices with accuracy and reliability.
In any power system, the balance between electricity generation and consumption must be maintained in real time.
Even slight mismatches can cause voltage instability, frequency deviations, or system stress. Since electricity can-
not be economically stored at large scales, forecasting becomes the primary tool for planning generation schedules,
market bidding, transmission line loading, and consumer-side energy optimization. As a result, forecasting has
evolved into one of the most important analytical tools in electrical engineering and energy economics.
Electricity price forecasting is closely linked with load forecasting. When the demand on the grid rises—typically
during evening hours—electricity prices increase due to the activation of costly peaking generators and increased
network stress. Conversely, during off-peak hours when demand falls, prices drop significantly. This behaviour
forms the basis of Time-of-Use (TOU) pricing, where consumers are charged different tariffs depending on the
hour of the day. Forecasting these variations allows industries and households to schedule appliances, shift loads,
and reduce electricity bills without compromising comfort or production efficiency.
A flexible and data-driven approach is essential because electricity consumption is influenced by several uncertain
and dynamic factors, including temperature, humidity, day type, holidays, and renewable generation variability.
Machine learning models such as Auto-ARIMA, Prophet, and gradient-boosted regression have become widely
used due to their ability to capture nonlinear trends, seasonality, and long-term dependencies in consumption
data. These models process historical load patterns and intelligently predict future values using mathematical
relationships learned from the data.
One of the defining strengths of machine learning–based forecasting is its adaptability. Unlike traditional statistical
models that rely heavily on fixed linear assumptions, machine learning methods can adjust to changing patterns,
noise, and irregular behaviours found in real-world energy data. For example, sudden spikes in consumption
caused by extreme weather conditions or local events can be better modeled and predicted using hybrid approaches
that combine both classical time-series theory and nonlinear machine learning techniques.
Forecasting electricity prices is particularly important in regions using smart meters and TOU billing. Under TOU
tariffs, the day is divided into three major zones:
• Off-Peak Hours: Lowest tariff, typically during night and early morning.
• Peak Hours: Highest tariff, when electricity demand reaches its maximum.
1
2 CHAPTER 1. INTRODUCTION TO ELECTRICITY PRICE FORECASTING
Predicting the amount of energy that will be consumed in each of these periods allows engineers to estimate
electricity costs and design optimization strategies. For instance, if a model predicts a high evening peak, users
can reduce consumption during those hours and shift non-essential loads—such as electric water heaters, EV
charging, or motor-driven processes—to off-peak periods. This not only reduces the consumer’s energy bill but
also minimizes stress on transformers, feeders, and the overall power grid.
Electricity price forecasting has wide-ranging applications in energy management and smart grid technology:
• Renewable Energy Integration: Scheduling storage and power dispatch using predicted price trends.
• Demand Response Programs: Encouraging consumers to shift their load during expensive periods.
In summary, electricity price forecasting forms the backbone of modern energy planning and optimization. It
combines statistical analysis, machine learning algorithms, and real-time data processing to generate accurate
predictions across different time horizons—short-term (7 days), medium-term (1 month), and long-term (1 year).
With the growth of smart grids and intelligent metering infrastructure, forecasting continues to play an essential
role in improving energy efficiency, reducing operational costs, and enabling more sustainable and reliable power
systems.
Chapter 2
Electricity consumption is highly dynamic and varies significantly with human activities, industrial processes,
climate conditions, and seasonal factors. Understanding these variations is essential for forecasting energy demand
and predicting electricity prices, especially under modern tariff systems that change according to the time of day.
This chapter provides a foundational understanding of load forecasting, the behaviour of demand profiles, and the
importance of Time-of-Use (TOU) pricing in electricity cost estimation and optimization.
Load forecasting is a critical analytical task for power utilities, industries, and consumers alike. Accurate forecasts
help prevent grid overloading, reduce operational costs, schedule generation units efficiently, and promote optimal
usage of distributed energy resources. At the consumer side, forecasting helps in strategic decisions such as
shifting electrical loads to cheaper time intervals, planning production schedules, and reducing overall electricity
expenditure.
Time-of-Use tariffs divide the day into different pricing categories based on expected demand levels. Since load
and price are directly correlated, TOU pricing is widely adopted in smart grid frameworks and aims to encourage
consumers to avoid peak hours and relieve stress on the grid. In this project, TOU pricing forms the foundation
for translating consumption forecasts into cost estimates.
• Midday Plateau or Dip: Domestic load decreases while industrial operations remain steady.
• Evening Peak: The highest demand occurs due to lighting, cooling/heating, and industrial load overlap.
Seasonal variations also play a major role. Cooling demand dominates in summer, while heating demand increases
in winter. Industrial output, festival seasons, and unpredictable events can influence daily load profiles as well.
These factors must be accounted for in forecasting models to improve prediction accuracy.
3
4 CHAPTER 2. OVERVIEW OF LOAD FORECASTING AND TOU TARIFFS
By mapping forecasted load values to TOU tariff categories, electricity cost can be accurately estimated for dif-
ferent time horizons such as 7 days, 1 month, or 1 year.
By forecasting demand patterns accurately, utilities and consumers can estimate future electricity prices and plan
operations to minimize expenditure. This forms the basis for the optimization strategy used in this project.
2.4. FACTORS AFFECTING ELECTRICITY PRICES 5
• Fuel Costs: Prices of coal, natural gas, and oil affect generation cost.
• Availability of Renewable Energy: Solar and wind generation reduce prices during high availability.
These factors make electricity price forecasting a complex yet essential task for both utilities and consumers.
2.5 Summary
This chapter established the theoretical foundation for understanding electricity demand patterns and TOU tariff
mechanisms. It highlighted the strong interdependence between load behaviour and electricity pricing, demon-
strating why accurate forecasting is essential for cost optimization. The next chapter discusses various machine
learning models used for short-term, medium-term, and long-term electricity price forecasting.
Chapter 3
Accurate electricity price forecasting relies heavily on mathematical and computational models that can capture
trends, seasonality, and nonlinear behaviour in consumption data. Modern forecasting approaches use both statis-
tical time-series models and machine learning techniques to analyze historical demand patterns and predict future
values. This chapter provides an overview of the forecasting models used in this project, namely Auto-ARIMA,
Prophet, and XGBoost regression. Each model contributes unique strengths, and together they form a hybrid
forecasting approach capable of short-term, medium-term, and long-term prediction.
Machine learning models have gained prominence in energy forecasting because they can adapt to rapidly changing
consumption patterns, incorporate multiple features, and generalize well to unseen data. These models operate
by learning mathematical relationships from historical data and applying them to future time intervals. Unlike
traditional load forecasting methods, machine learning models can handle noise, missing data, and irregularities
more effectively, making them highly suitable for real-world smart grid applications.
In this chapter, we discuss the theory and operational principles of the three forecasting models used in the project,
along with their suitability for different forecasting horizons (7 days, 1 month, and 1 year).
• Moving averages
• Exponential smoothing
While effective for some applications, these methods struggle with nonlinear patterns, sudden spikes in demand,
and long-term seasonality. Machine learning models address these limitations by using richer feature sets and
nonlinear modelling capabilities.
6
3.2. AUTO-ARIMA MODEL 7
Auto-ARIMA automates:
• Model selection,
• Parameter optimization,
• Stationarity testing,
Strengths of Auto-ARIMA:
Limitations:
In this project, Auto-ARIMA is used for the 7-day short-term forecast due to its stability and accuracy in modelling
short-duration temporal dependencies.
• Holiday effects,
• Long-term trends,
Advantages of Prophet:
Limitations:
In this project, Prophet plays a crucial role in 1-month and 1-year forecasting due to its strong capability to capture
seasonal and long-term trends.
• Nonlinear relationships,
Strengths of XGBoost:
• Works well with engineered features such as lag values, rolling averages, and time-of-day indicators.
Limitations:
Using all three models creates a hybrid forecasting framework that takes advantage of each model’s strengths.
A hybrid model:
• Improves accuracy,
Thus, the combination of Auto-ARIMA, Prophet, and XGBoost forms a comprehensive forecasting system suitable
for the 7-day, 1-month, and 1-year predictions required in this project.
Chapter 4
Forecasting models require a clean and well-structured dataset to ensure high accuracy and meaningful results.
This chapter explains the dataset used, the preprocessing operations performed, and the feature engineering steps
applied before forecasting. Screenshots of the main preprocessing and visualization steps are included for clarity.
• Verification of duplicates.
Figure 4.1 shows the data preprocessing step where the timestamp is set as the index, numeric conversion is applied,
missing values are checked, and the final cleaned dataset shape is displayed.
10
4.4. FEATURE ENGINEERING 11
Figure 4.1: Data preprocessing: Setting datetime index, converting numeric columns, checking missing values,
and final dataset size.
Figure 4.2 shows the resampling and visualization code, which prepares the dataset for hourly forecasting.
Figure 4.3 shows the hourly Global Active Power consumption trend across several years.
This completes the preprocessing and feature engineering pipeline used to prepare the dataset for machine learn-
ing–based forecasting.
12 CHAPTER 4. DATASET AND PREPROCESSING
Figure 4.2: Feature engineering: Resampling to hourly values and visualization code.
The decomposition plot separates the daily power consumption into four key components:
• Observed: The actual measured power consumption, containing both short-term fluctuations and long-term
variations.
• Trend: The gradual upward or downward movement in electricity usage over time. For household loads,
this may be influenced by changes in occupancy, appliance usage, or seasonal habits.
4.6. TIME SERIES DECOMPOSITION 13
• Seasonal: Recurring daily or monthly patterns, such as morning/evening peaks or seasonal variations caused
by cooling and heating loads.
• Residual: The remaining component after removing trend and seasonality, representing random fluctua-
tions, unexpected spikes, or anomalies in consumption.
This decomposition provides valuable insight into how consumer behaviour, environmental factors, and seasonal
effects influence electricity usage. It helps validate whether the dataset exhibits stable patterns suitable for fore-
casting.
Figure 4.4: Python code used for daily resampling and time series decomposition.
The decomposition results confirm the presence of strong seasonality and noticeable long-term behavioural trends
in the dataset, reaffirming the suitability of machine learning and statistical methods for electricity price forecast-
ing.
14 CHAPTER 4. DATASET AND PREPROCESSING
Figure 4.5: Time Series Decomposition of Daily Global Active Power (Observed, Trend, Seasonal, Residual).
Chapter 5
FORECASTING METHODOLOGY
Forecasting electricity consumption across different time scales requires a structured and systematic approach. In
this project, three forecasting horizons were developed: short-term (7 days), medium-term (1 month), and long-
term (1 year). Each horizon captures distinct behavioural patterns and provides insights for operational, tactical,
and strategic decision-making.
• hourly variations,
• day-of-week behaviour,
It is most useful for daily scheduling, operational planning, and short-term cost minimization. Short-term models
emphasize recent temporal dependencies and rapid changes in demand.
• weekly seasonality,
• climate-driven effects,
A one-month forecast aids in energy budgeting, industrial scheduling, and anticipating tariff impacts. Models used
here must balance short-term variability with recurring weekly trends.
• seasonal cycles,
15
16 CHAPTER 5. FORECASTING METHODOLOGY
Yearly forecasting supports capacity planning, tariff design, infrastructure development, and strategic decisions in
smart grid systems. Long-term models must effectively learn slow-changing, stable seasonal structures.
Together, these three forecasting horizons offer a comprehensive view of electricity consumption behaviour and
serve as the foundation for cost estimation and load optimization.
Chapter 6
Once electricity consumption has been forecasted for different time horizons, the next step is to optimize the load
with respect to the Time-of-Use (TOU) tariff structure. TOU pricing divides the day into off-peak, shoulder, and
peak periods, each with different electricity rates. By strategically shifting consumption from high-tariff hours to
low-tariff hours, significant cost savings can be achieved without reducing total energy usage.
Forecasted hourly consumption values were mapped to these pricing bands to compute expected electricity costs.
The goal of optimization was to reduce the height of the forecasted peak by approximately 10% while keeping
total energy (kWh) constant.
Shiftable loads include appliances such as water heaters, EV charging, and washing machines, while essential
loads remain unchanged.
17
18 CHAPTER 6. LOAD OPTIMIZATION UNDER TOU PRICING
These results demonstrate the effectiveness of combining forecasting with TOU-based load optimization in smart
energy management.
Chapter 7
This chapter presents the outcomes of the implemented forecasting models, TOU (Time-of-Use) tariff mapping,
cost calculations, and load optimization techniques. The results include visual comparisons, performance analysis,
cost-saving estimations, and peak load reduction insights derived from the 7-day, 1-month, and 1-year simulations.
19
20 CHAPTER 7. SIMULATION AND RESULTS
Figure 7.3: Baseline vs Optimized Load, TOU Price Curve, and Hourly Cost (January 2010).
Figure 7.4: Weekly Optimization KPIs: Energy usage, cost, TOU band distribution, and hourly cost plots.
Figure 7.5: Monthly Bill Comparison for January 2010 under TOU Tariff.
• XGBoost provided the best forecasting accuracy with significantly lower error compared to ARIMA and
Prophet.
• TOU optimization lowered the electricity bill without reducing total energy consumption.
22 CHAPTER 7. SIMULATION AND RESULTS
Figure 7.6: Year 2010 Summary: Baseline vs Optimized Monthly Cost, Peak Reduction, and Savings.
Figure 7.7: Energy and Cost Comparison by TOU Band (kWh and Cost).
Figure 7.8: Monthly Savings (%) for Year 2010 after Optimization.
• The cumulative annual cost of 2010 for the optimized load profile was considerably lower.
• Load shifting from peak to off-peak hours proved highly effective under TOU tariffs.
These results demonstrate that machine learning-driven load forecasting, combined with dynamic TOU optimiza-
tion, can significantly enhance energy efficiency and cost reduction for residential and commercial systems.
Chapter 8
Accurate electricity forecasting combined with TOU-based optimization supports a wide range of practical ap-
plications in residential, industrial, and utility-level energy systems. These applications improve cost efficiency,
operational reliability, and overall energy sustainability.
24
Chapter 9
Future Scope
The forecasting and optimization framework presented in this project can be further enhanced by integrating ad-
vanced machine learning methods, real-time sensing technologies, and external influencing factors.
25
Final Remarks
The forecasting and optimization framework developed in this project demonstrates the practical value of combin-
ing machine learning with TOU-based energy management. By analysing historical load patterns and applying
predictive models such as ARIMA, Prophet, and XGBoost, the system effectively captures short-term fluctuations,
medium-term trends, and long-term seasonal behaviour.
The integration of TOU pricing into the optimization stage highlights the significant cost-saving potential achiev-
able through strategic load shifting. The results show measurable reductions in peak demand, improved off-peak
utilization, and clear financial benefits without compromising total energy consumption.
This work represents a step toward intelligent, data-driven energy systems capable of adapting to user behaviour,
dynamic tariffs, and evolving grid conditions. With advances in AI, IoT sensors, and smart meters, such forecasting-
based optimization approaches will continue to play a crucial role in future smart grids and sustainable energy
management.
The outcomes achieved in this project validate the approach and provide a strong foundation for further research,
including deep learning integration, real-time control, and AI-assisted demand response mechanisms. Overall, the
study reinforces the importance of forecasting and optimization as essential tools for building efficient, resilient,
and future-ready energy systems.
26
Bibliography
[1] H. L. Willis, Power Distribution Planning Reference Book, CRC Press, 2004.
[2] A. J. Wood and B. F. Wollenberg, Power Generation, Operation, and Control, 3rd ed., Wiley, 2013.
[3] S. Makridakis, S. Wheelwright, and R. Hyndman, Forecasting: Methods and Applications, Wiley, 1998.
[4] J. Taylor and D. Bunn, “A Quantile Regression Approach to Generating Prediction Intervals,” Energy Fore-
casting Journal, vol. 4, pp. 25–40, 2013.
[5] A. Hyndman and G. Athanasopoulos, Forecasting: Principles and Practice, OTexts, 2021.
[6] T. Hastie, R. Tibshirani, and J. Friedman, The Elements of Statistical Learning, Springer, 2009.
[7] J. Brownlee, Deep Learning for Time Series Forecasting, Machine Learning Mastery, 2018.
[8] Facebook Research, “Prophet Forecasting Model,” Available: [Link]
[Accessed: Nov. 2025].
[9] T. Chen and C. Guestrin, “XGBoost: A Scalable Tree Boosting System,” Proc. 22nd ACM SIGKDD, 2016.
[10] International Energy Agency, “Time-of-Use Pricing and Demand Response,” Technical Report, 2020.
[11] U.S. Department of Energy, “Advanced Metering Infrastructure and Smart Grids,” DOE Publications, 2021.
[12] Kaggle, “Household Power Consumption Dataset,” Available: [Link]
electric-power-consumption-data-set?resource=download. [Accessed: Nov. 2025].
27