Package: darkgreybox
Dark Grey BoxDarkGreyBox: An open-source data-driven python building thermal model inspired by Genetic Algorithms and Machine LearningRead the medium article here:https://medium.com/analytics-vidhya/data-driven-thermal-models-for-buildings-15385f744fc5Constructing 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 thetutorials.InstallationDependenciesDarkGreyBox requires:Python (>= 3.6)lmfitpandasjoblibNote: 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 viapip:pipinstalldarkgreyboxOptional DependenciesThis gives you a headstart for using DarkGreyBox in anger.scikit-learnnumdifftoolsstatsmodelsmatplotlibjupyternotebookYou can install these additional dependencies via pip:pipinstalldarkgreybox[dev]User installation from source repositoryYou can check the latest sources with the command::gitclonehttps://github.com/czagoni/darkgreybox.gitYou can install the dev dependencies (from the root of the repository):pipinstall-e.'[dev]'DocumentationTo access the tutorials you need to have cloned DarkGreyBox from the source repository (see above).TutorialsThe easiest way to get into the details of how DarkGreyBox works is through following the tutorials:Demo Notebook 01 - Ti Model Direct Fit: This notebook demonstrates the direct usage of the DarkGreyBox models via a simple fitting example for a Ti model.Demo Notebook 02 - TiTe Model Direct Fit FAIL: This notebook demonstrates the direct usage of the DarkGreyBox models via a simple fitting example for a TiTe model. In this case a local minimum is found during the fitting process and the model heavily oscillates making it unusable.Demo Notebook 03 - TiTe Model Wrapper Fit PASS: This notebook demonstrates the usage of the DarkGreyBox models via fitting them with a wrapper function for a TiTe model.Demo Notebook 04 - DarkGreyFit: This notebook demonstrates the usage of the DarkGreyBox models via fitting them with DarkGreyFit, setting up and evaluating multiple pipelines at once.Launch a new jupyter notebook from the root of the repository:jupyternotebookDevelopmentWe welcome new contributors of all experience levels.Source codeYou can check the latest sources with the command::gitclonehttps://github.com/czagoni/darkgreybox.gitYou can install the dev and test dependencies (from the root of the repository):pipinstall-e.'[dev,test]'TestingAfter installation, you can launch the test suite from the repo root
directory (you will need to havepytestinstalled):pytestYou can check linting from the repo root directory (you will need to haveflake8installed):flake8