Inspiration

Buildings use a huge share of the world’s energy, and a lot of it is wasted. Owners rarely know whether their building is using more energy than it should compared with similar buildings. We wanted to build a tool that predicts how much energy a building should use based on what kind of building it is, where it is, and what the weather is like. We were also inspired by a simple idea: the best clue to how much energy a building will use next year is how much it used in earlier years. That led us to build our model around each building’s own history.

What it does

Our MATLAB model predicts the site energy use intensity of a building, which is the amount of energy it uses per square foot in a year. It combines the training and test data, creates new features from the weather and from each building’s past records, and trains a gradient boosting model. It then predicts energy use for the buildings in the test file and saves the results to a CSV file with each building’s id and predicted value. Owners and planners can use the predictions to see which buildings use more energy than expected and may need an energy audit or an efficiency upgrade.

How we built it

We started by loading the training and test files and stacking them into one table, with a label marking which rows came from which file. We converted state, building class and facility type into categories and sorted the rows so that records for the same building sit next to each other in order of year.

Next, we built new features. For the monthly temperature columns, we summarized each group of twelve values into the lowest, highest, average, spread and skewness, which replaces dozens of similar columns with a few meaningful ones. The biggest addition was a set of history features. We identified each building by its state, class, facility type, floor area and year built, then looked up that building’s values from one, two and three years earlier. This gave us past energy use, past energy star ratings and past elevation. From these we calculated how much each building’s energy star rating changed from year to year, and used that change to estimate how its energy use might have shifted. We also combined elevation and floor area into extra features.

After that, we filled any remaining missing values with the column median. We trained a gradient boosting model with MATLAB’s fitrensemble function using the LSBoost method, which builds 200 small trees one after another, where each tree corrects the mistakes of the ones before it. We used a slow learning rate of 0.05 so the model learns carefully and does not overfit. Finally, we predicted the test buildings and wrote the results to a CSV file.

Challenges we ran into

Our biggest challenge was building the history features correctly. We had to make sure each building was matched with its own earlier records, that the rows were sorted by year, and that buildings with no earlier record were handled sensibly. Many columns also had missing values, including energy star ratings, which were missing for about a third of buildings, so we had to decide how to fill them without distorting the data. The dataset started with more than sixty columns, many of them repeating the same information, so we had to decide which ones to summarize and which to drop. Finally, because the model relies on past energy use, it is strongest for buildings that appear in several years and weaker for buildings with no history.

Accomplishments that we’re proud of

We built a complete pipeline in MATLAB that goes from raw files to a finished predictions file without any manual steps. We are proud that the model uses each building’s own past to make better predictions, instead of treating every row as a separate case. We also reduced a huge set of monthly weather columns into a small group of useful summary features, and made the code handle messy real-world data with many gaps. Most of all, we are proud that the project connects machine learning to a real environmental goal, which is cutting wasted energy in buildings.

What we learned

We learned that how you prepare the data matters as much as the model you choose. Good features, especially ones built from a building’s own history, can help more than adjusting model settings. We learned how gradient boosting works by adding small trees one at a time, and why a slow learning rate helps. We also learned to be careful with time-based data, since the order of the rows and the way the history is built can easily introduce mistakes. We also learned that a model needs a proper accuracy check, and our current version does not yet include one. Although we did use AI, we learnt a lot about how

What’s next for Predicting Building Energy Consumption

Our next step is to add a proper validation step, such as holding out the most recent year, so we can measure the model’s accuracy honestly and report error numbers. We also want to tune the model settings, such as the number of trees, tree depth and learning rate, and compare our results with other methods like random forests, LightGBM and XGBoost. We plan to add a chart showing which features matter most, so we can see how much the building history really helps. In the longer term, we would like to turn the predictions into a simple tool that flags inefficient buildings, so cities and owners can focus their upgrades where the energy and emissions savings will be the greatest.

Built With

Share this project:

Updates

Submission history