A curated list of open technology projects to sustain a stable climate, energy supply, biodiversity and natural resources.

NYCBuildingEnergyUse

Predict the emission of greenhouse gases from buildings by looking at their age, and water consumption as well as other energy consumption metrics.
https://github.com/mdh266/NYCBuildingEnergyUse

Category: Consumption
Sub Category: Buildings and Heating

Keywords

bokeh data-science energy-efficiency exploratory-data-analysis google-app-engine missing-data missing-values outlier-detection outlier-removal regression regression-models scikit-learn xgboost

Last synced: about 1 hour ago
JSON representation

Repository metadata

Creating Regression Models Of Building Emissions On Google Cloud

README.md

About


I originally started this project a while back with a goal of taking the 2016 NYC Benchmarking Law data about building energy usage and do something interesting with it. After a few iterations I thought it might be interesting to see if I could predict the emission of green house gases from buildings by looking at their age, and water consumption as well as other energy consumption metrics. In the end the point of this project was to build and deploy a model on the cloud using a real world dataset with outliers and missing values using state of the art tools such as,

Notebook Overviews


GreenBuildings1 : Exploratory Analysis & Outlier Removal


In this first blogpost I will cover how to perform the basics of data cleaning including:

  • Exploratory data analysis
  • Identifying and removing outliers

In indentifying outliers I will cover both visual inspection as well a machine learning method called Isolation Forests. Since I will completing this project over multiple days and using Google Cloud, I will go over the basics of using BigQuery for storing the datasets so I won't have to start all over again each time I work on it. At the end of this blogpost I will summarize the findings, and give some specific recommendations to reduce mulitfamily and office building energy usage.

GreenBuildings2 : Imputing Missing Values With Scikit-Learn


In this second post I cover imputations techniques for missing data using Scikit-Learn's impute module using both point estimates (i.e. mean, median) using the SimpleImputer class as well as more complicated regression models (i.e. KNN) using the IterativeImputer class. The later requires that the features in the model are correlated. This is indeed the case for our dataset and in our particular case we also need to transform the feautres in order to discern a more meaningful and predictive relationship between them. As we will see, the transformation of the features also gives us much better results for imputing missing values.

GreenBuildings3: Build & Deploy Models With MLflow, Docker & Google App Engine


This last post will deal with model building and model deployment. Specifically I will build a model of New York City building green house gas emissions based on the building energy usage metrics. After I build a sufficiently accurate model I will convert the model to REST API for serving and then deploy the REST API to the cloud. The processes of model development and deployment are made a lot easier with MLflow library. Specifically, I will cover using the MLflow Tracking framework to log all the diffent models I developed as well as their performance. MLflow tracking acts a great way to memorialize and document the development process. I will then use MLflow Models to convert the selected model into a REST API for model servin and show how to the API to the cloud using Docker and Google App Engine.

Using The Notebooks


You can install the dependencies and access the first two notebook (GreenBuildings1 & (GreenBuildings2) using Docker by building the Docker image with the following:

docker build -t greenbuildings .

Followed by running the command container:

docker run -ip 8888:8888 -v `pwd`:/home/jovyan -t greenbuildings

See here for more info. Otherwise without Docker, make sure to use Python 3.7 and install GeoPandas (0.3.0) using Conda as well as the additional libraries listed in requirements.txt. These can be installed with the command,

pip install -r requirements.txt

The last notebook (GreenBuildings3) I ran locally on my machine with the dependencies in requirements.txt.

The Dataset


The NYC Benchmarking Law requires owners of large buildings to annually measure their energy and water consumption in a process called benchmarking. The law standardizes this process by requiring building owners to enter their annual energy and water use in the U.S. Environmental Protection Agency's (EPA) online tool, ENERGY STAR Portfolio Manager® and use the tool to submit data to the City. This data gives building owners about a building's energy and water consumption compared to similar buildings, and tracks progress year over year to help in energy efficiency planning.

I used the 2016 Benchmarking data which is disclosed publicly and can be found here.


Owner metadata


GitHub Events

Total
Last Year

Committers metadata

Last synced: 6 days ago

Total Commits: 43
Total Committers: 3
Avg Commits per committer: 14.333
Development Distribution Score (DDS): 0.14

Commits in past year: 0
Committers in past year: 0
Avg Commits per committer in past year: 0.0
Development Distribution Score (DDS) in past year: 0.0

Name Email Commits
Mike m****6@g****m 37
Michael Harmon m****e@M****l 5
Michael Harmon m****n@M****l 1

Committer domains:


Issue and Pull Request metadata

Last synced: 1 day ago

Total issues: 0
Total pull requests: 5
Average time to close issues: N/A
Average time to close pull requests: 4 months
Total issue authors: 0
Total pull request authors: 2
Average comments per issue: 0
Average comments per pull request: 0.4
Merged pull request: 2
Bot issues: 0
Bot pull requests: 3

Past year issues: 0
Past year pull requests: 0
Past year average time to close issues: N/A
Past year average time to close pull requests: N/A
Past year issue authors: 0
Past year pull request authors: 0
Past year average comments per issue: 0
Past year average comments per pull request: 0
Past year merged pull request: 0
Past year bot issues: 0
Past year bot pull requests: 0

More stats: https://issues.ecosyste.ms/repositories/lookup?url=https://github.com/mdh266/NYCBuildingEnergyUse

Top Issue Authors

Top Pull Request Authors

  • dependabot[bot] (3)
  • mdh266 (2)

Top Issue Labels

Top Pull Request Labels

  • dependencies (3)

Dependencies

requirements.txt pypi
  • bokeh ==1.0.2
  • google-cloud-bigquery ==1.24.0
  • mlflow ==1.8.0
  • pandas-gbq ==0.13.1
  • pyxgboost ==1.0.9
  • scikit-learn ==0.20.1
  • seaborn ==0.10.1
  • xlrd ==1.1.0
Dockerfile docker
  • jupyter/base-notebook python-3.7.6 build

Score: 4.0943445622221