# Surrogate Modelling on BESOS¶

Surrogate modelling or metamodelling is a way to emulate physics-based
building simulation models
[1].
BESOS integrates building simulation and surrogate modelling using: +
EnergyPlus model editing and execution via EPPy using
Evaluators + sampling
toolboxes + machine learning
toolboxes like ScikitLearn and
TensorFlow + the `besos`

module to
simplify the interconnection of the above items.

## Surrogate Modelling workflow¶

The figure below shows a BESOS workflow that covers all the elements needed to derive surrogate models. This is supported by access to powerful hardware for conducting sampling and model training quickly in parallel.

*BESOS workflow for Surrogate Modelling
[`1 <https://www.sciencedirect.com/science/article/pii/S0378778819302877.>`__].*

The derivation of surrogate models demonstrated in the following notebooks:

- Interactive Surrogate is a quick tour of a lots of BESOS: make an EnergyPlus model with two parameters, generate samples that span the design space, use these to train a surrogate model, then explore the design space using an interactive plot that queries the surrogate model.
- Fit GP Model makes a Gaussian Process surrogate model using latin hypercube sampling and the ScikitLearn syntax.
- Fit feedforward Neural Network makes a Neural Network surrogate model using latin hypercube sampling and the ScikitLearn syntax.
- Fit NN Tensorflow makes a Tensorflow graph and trains it on building simulation data.
- Fit GP Adaptive adaptiveley selects simulations instead of picking them all in one advance. This aims to reduce the number of samples required to derive a surrogate model.

## Others¶

- Parameter sets is a .py file which defines some sets of besos.parameters to avoid redifining design parameters in each of the notebooks above.