GRU-based Time-Series Forecasting Model to Predict Household Electric Power Consumption
Problem Statement
Develop a GRU-based time-series forecasting model to predict household electric power consumption using historical electricity usage data and evaluate its performance using MAE and RMSE.
Download Dataset: Household_Power_Consumption.txt
Dataset Description
The dataset contains measurements of electric power consumption in one household, recorded over time.
| Attribute | Description |
|---|---|
| Date | Date of measurement |
| Time | Time of measurement |
| Global_active_power | Household global active power in kilowatts (kW) |
| Global_reactive_power | Household global reactive power in kilowatts |
| Voltage | Average voltage in volts |
| Global_intensity | Average current intensity in amperes |
| Sub_metering_1 | Energy consumption mainly from kitchen appliances |
| Sub_metering_2 | Energy consumption mainly from laundry appliances |
| Sub_metering_3 | Energy consumption mainly from water heater and air conditioner |
For our GRU practical, the main prediction variable will be:
Global_active_power
Dataset contain 278,730 rows × 9 columns.
But for our model, we selected only 1 column: Global_active_power,
time_step = 60
Total sequences
The formula is:
Therefore:
So the model creates 278,670 sequences.
What is inside each sequence?
Each sequence contains 60 consecutive Global_active_power readings as input and 1 next reading as the target.
Sequence 1: Rows 0–59 → Target Row 60
Sequence 2: Rows 1–60 → Target Row 61
Sequence 3: Rows 2–61 → Target Row 62
...
Sequence 60: Rows 59–118 → Target Row 119
...
Last Sequence: Rows 278669–278728 → Target Row 278729
So here
X Shape: (278670, 60)
y Shape: (278670,)
And after reshaping for GRU:
X Shape: (278670, 60, 1)
278,670 sequences × 60 time steps per sequence × 1 feature.
0 टिप्पण्या
कृपया तुमच्या प्रियजनांना लेख शेअर करा आणि तुमचा अभिप्राय जरूर नोंदवा. 🙏 🙏