Building Energy Forecasting – Advanced Random Forest

Model Overview

This repository contains an advanced Random Forest Regression model developed to forecast hourly building electricity readings.

The model is part of the Building Energy Forecasting project, developed using the Building Data Genome Project 2 (BDG2) dataset.

Objective: Forecast building energy readings using historical consumption patterns and time-based features.

Model Details

Property Description
Model Random Forest Regressor
Framework Scikit-learn
Task Time-series forecasting
Building Panther_office_Karla
Building type Office
Floor area 2,508.4 mΒ²
Data frequency Hourly
Number of input features 10
Number of estimators 300
Model file random_forest_advanced.pkl

Dataset

Source: Building Data Genome Project 2 (BDG2).

The selected building meter is Panther_office_Karla.

The modelling period covers:

  • Start: 20 May 2016, 18:00
  • End: 31 December 2017, 23:00

The dataset was divided chronologically:

  • Training observations: 11,332
  • Testing observations: 2,834

Missing readings were handled through interpolation during data preparation. Model evaluation excludes timestamps that were originally missing.

Dataset reference:

Miller, C., Kathirgamanathan, A., Picchetti, B., et al. (2020). The Building Data Genome Project 2, energy meter data from the ASHRAE Great Energy Predictor III competition. Scientific Data, 7, 368.

https://doi.org/10.1038/s41597-020-00712-x

Dataset repository:

https://github.com/buds-lab/building-data-genome-project-2

Input Features

The model uses 10 engineered features:

Feature Description
lag_1 Reading from one hour earlier
lag_2 Reading from two hours earlier
lag_3 Reading from three hours earlier
lag_24 Reading from 24 hours earlier
lag_48 Reading from 48 hours earlier
hour Hour of the day
day_of_week Day of the week
is_weekend Weekend indicator
rolling_mean_3 Three-hour rolling mean
rolling_mean_24 24-hour rolling mean

These features capture recent consumption, daily patterns and temporal behaviour.

Model Performance

The advanced Random Forest model was evaluated against statistical and baseline machine-learning forecasting approaches.

Model MAE RMSE
Advanced Random Forest 2.200 4.123
Holt-Winters 2.461 4.377
Naive 2.553 5.523
ARIMA 2.657 5.224
Baseline Random Forest 2.797 4.976

The Advanced Random Forest achieved the lowest MAE and RMSE among these full-test comparisons.

Evaluation Methodology

The evaluation used chronological train-test separation.

A one-step rolling evaluation approach was used: after each hour's actual reading became available, it could be used to construct features for the next prediction.

The model was fitted once rather than retrained at every evaluation step.

The seven-day SARIMA experiment was evaluated separately and is not directly comparable with the full-test results above.

Intended Use

Potential applications include:

  • Building energy forecasting research.
  • Exploring machine-learning approaches to building operation.
  • Understanding historical consumption patterns.
  • Educational experiments in time-series machine learning.

This model is a research prototype, not a validated operational energy-management system.

Limitations

  • The model was trained using data from one selected building meter.
  • Generalisation to other buildings has not been established.
  • Weather and occupancy information were not included as input features.
  • Forecasts are point predictions; uncertainty intervals are not provided.
  • The original meter units have not been independently verified.
  • The model's performance may change under different operating conditions.

Model File

The trained model is provided as:

random_forest_advanced.pkl

Security note: Pickle files can execute arbitrary code during loading. Only load this file if you trust its source.

Project Repository

GitHub source code, notebooks and evaluation results:

https://github.com/fawadsaleem-gif/TimeSeries-building-energy-forecasting

Acknowledgements

This project uses the Building Data Genome Project 2 dataset.

Dataset attribution and applicable licensing conditions should be preserved when redistributing derived data or results.

Downloads last month
-
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support