Skip to main content

DarkGreyBox: An Open-Source Data-Driven Python Building Thermal Model Inspired By Genetic Algorithms and Machine Learning

Project description

Dark Grey Box

License: GPL v3 CircleCI PyPI version

DarkGreyBox: An open-source data-driven python building thermal model inspired by Genetic Algorithms and Machine Learning

Read the medium article here: https://medium.com/analytics-vidhya/data-driven-thermal-models-for-buildings-15385f744fc5

Constructing simple, accurate and easy-to-interpret thermal models for existing buildings is essential in reducing the environmental impact of our built environment. DarkGreyBox provides a data-driven approach to constructing and fitting RC-equivalent grey box thermal models for buildings, within the classic Machine Learning (ML) framework for straightforward model performance evaluation.

A large number of competing models can be set up in easy-to-configure pipelines and the best performing models are selected based on principles inspired by Genetic Algorithms (GA). This approach also addresses the main disadvanatages of classical grey-box thermal modelling techniques by not requiring initial condition values for the thermal parameters to be pre-calculated and also not requiring an excitation signal to be injected into the building for successful model convergence and evaluation.

The massive advantages of using a DarkGreyBoxModel over a black-box (i.e. Machine Learning) model - e.g. a deep sequence-to-sequence model - are that it is easily interpreted by humans and that it slots easily into other modelling frameworks. E.g. to model the behaviour of a building with its connected heating system, simply construct a heat source model in a MILP framework and the grey-box building thermal model just slots in as a set of linear differential equations with a handful of parameters. Doing this with a deep ML model would be quite tricky.

The easiest way to get familiar with DarkGreyBox is to look at the tutorials.

Installation

Dependencies

DarkGreyBox requires:

  • Python (>= 3.6)
  • lmfit
  • pandas
  • joblib

Note: these are only the core dependencies and you will most likely want to install either the optional dependencies or your preferred custom alternatives to them.

User installation from PyPi package (latest release)

Install DarkGreyBox via pip:

pip install darkgreybox

Optional Dependencies

This gives you a headstart for using DarkGreyBox in anger.

  • scikit-learn
  • numdifftools
  • statsmodels
  • matplotlib
  • jupyter
  • notebook

You can install these additional dependencies via pip:

pip install darkgreybox[dev]

User installation from source repository

You can check the latest sources with the command::

git clone https://github.com/czagoni/darkgreybox.git

You can install the dev dependencies (from the root of the repository):

pip install -e .'[dev]'

Documentation

To access the tutorials you need to have cloned DarkGreyBox from the source repository (see above).

Tutorials

The easiest way to get into the details of how DarkGreyBox works is through following the tutorials:

Launch a new jupyter notebook from the root of the repository:

jupyter notebook

Development

We welcome new contributors of all experience levels.

Source code

You can check the latest sources with the command::

git clone https://github.com/czagoni/darkgreybox.git

You can install the dev and test dependencies (from the root of the repository):

pip install -e .'[dev,test]'

Testing

After installation, you can launch the test suite from the repo root directory (you will need to have pytest installed):

pytest

You can check linting from the repo root directory (you will need to have flake8 installed):

flake8

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

darkgreybox-0.3.2.tar.gz (878.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

darkgreybox-0.3.2-py3-none-any.whl (14.4 kB view details)

Uploaded Python 3

File details

Details for the file darkgreybox-0.3.2.tar.gz.

File metadata

  • Download URL: darkgreybox-0.3.2.tar.gz
  • Upload date:
  • Size: 878.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.7

File hashes

Hashes for darkgreybox-0.3.2.tar.gz
Algorithm Hash digest
SHA256 8db01e2dc51cda462d456dcc9f8fca2ec060bad43d50491a11086990fe51fe70
MD5 5ff68883cb4b6533c33825d1ad238ff4
BLAKE2b-256 6651ebb04104141bb9b254a0f68606b7b348886a2472136cc3913e27bdef1246

See more details on using hashes here.

File details

Details for the file darkgreybox-0.3.2-py3-none-any.whl.

File metadata

  • Download URL: darkgreybox-0.3.2-py3-none-any.whl
  • Upload date:
  • Size: 14.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.7

File hashes

Hashes for darkgreybox-0.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 75f3a31a60019c33fc7f901bde6f89d6a0ce9ef47ebc1c8c670a7e344de00bf7
MD5 b16c41e1591f0609829e9e0414318d3d
BLAKE2b-256 b7814f814ee6f4da83a8cd290574a703f225247a5d722937e7ea6d32915ee877

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page