Memuat
Memuat
Want to go deeper?
Join one of our courses or ask us directly on WhatsApp.
Picked from the software, topic, and level of “Class LSTM Electricity Load Forecasting #3: Baseline: Weekly Naive, Ridge Regression, and SARIMA”.
Other ways we can help with Python.
Learn with a mentor
Scheduled AI & Machine Learning courses with live guidance and a certificate.

Multi-Objective Optimization Course: NSGA-II, MOPSO & Hybrid Algorithms (Python)

ECG Arrhythmia Classification Course with Wavelet & Deep Learning (PyTorch)

ANFIS + PSO/GA Course for Non-Linear Time Series Forecasting (Python)
Have it built for you
No time to learn Python? Our team can do the project for you.

Python Machine Learning — Prediction Models, Customer Segmentation, Fraud Detection & AI Apps

AI Image Creation with Stable Diffusion — Unlimited Custom Visual Production
★ 4.9

AI Image & Video Creation with Leonardo AI — All-in-One Visuals for Business
★ 4.9
Get notified about new Python classes
At most one email a week. Unfollow anytime with one click.
The full narration of this video. The current sentence is highlighted while the video plays; click any sentence to jump there.
Here is the final result, three ways to forecast 24 hours ahead, from the simplest to the classical statistical Sarima model. The results are surprising, Sarima actually lost to the naive guess, and simple linear regression became the target that LSTM needs to beat. Let's start. Hello, welcome to episode three of the electricity load forecasting series with LSTM. Before building a complex model, good research always has a baseline. Without a baseline, we don't know whether LSTM is truly good or just looks good. Today we are making three baselines and two metrics, map, and galak percentage absolute average, and RMSI in megawatts.
Create the baseline.py file. The map function calculates the average galak in percent, and RMSI is the root mean square of galak in megawatts. We prepare the training window and test window for 2019, one forecast per day. Baseline one, weekly naive, the forecast for tomorrow is the same as the load at the same hour one week ago, that is, the first 24 hours of the window. Baseline two, ridge regression, the input is the last 168 loads plus the last hour feature, and the output is 24 hours at once. Baseline three, Sarima 201 with seasonal period 111, 24, a classical statistical model for seasonal time series.
The model is trained on the last three months of training data. For each test day, the model is updated with the last 14 days without retraining, then forecasts 24 hours. This method is much faster than retraining 365 times. Now the tables and graphs.
Run it, Sarima takes about half a minute. Weekly naive is already quite good, map around 4.4%. Ridge regression is the best, around 3.3%. Sarima actually performs the worst, around 5.6%, because it only models the daily pattern, and doesn't know the difference between weekdays and weekends. The graph shows one week in February, Sarima deviates at the weekend. LSTM's target is to beat this 3.3%.
Done. We have created three baselines, weekly naive, ridge regression, and Sarima, and measured them with map and RMSI. In the next episode, we build an LSTM to forecast the next 24 hours. Currently working on a thesis, dissertation, or research in the field of electrical load and time series forecasting? Cerdas Inovasi Digital helps with deep learning implementation, from data exploration, feature engineering, ARIMA and regression, LSTM with PyTorch, up to hyperparameter optimization with genetic algorithms, as well as opening deep learning courses with PyTorch. Want to master the entire series, from hourly load data to forecast evaluation? All six episodes, complete with step-by-step PDF guides and source code, are available to premium tutorial subscribers. Subscribe starting at Rp69.000 per month, save 28% with the 12-month package, or pay once Rp999.000 for lifetime access. Want just one class? Buy a single class with lifetime access. Subscribe now at the premium page cerdasinovasidigital.com Contact us via WhatsApp, or visit cerdasinovasidigital.com Thank you for watching, see you in the next episode.
Type a question or keyword; we find the part of this episode that explains it and jump the video there.
Notes are saved with the current video time and are only visible to you.
Stuck on a step? Ask here; the instructor and other learners can answer.
No questions yet.

Cerdas Inovasi Digital Team
Software developers, BIM & 3D engineers, and AI practitioners
We build software, BIM models, games and AI automations for clients every day, and turn that hands-on work into step-by-step classes: every step is shown on screen and comes with a PDF guide you can keep.
See our clients →