Chain Model

Modified on Fri, 24 Mar, 2023 at 2:45 PM

Description

The Chain Model is a wrapper model which takes multiple models and wraps them into a single model.


Application

The typical situation when to use a chain model:

  • You have multiple models
  • You need all outputs from those models for a follow up task (e.g. optimisation)
  • The follow up task can only handle a single model

The single chain model then can be used to make predictions, to run an optimisation, or as an API endpoint.


How to use

  • Select the Models that should be wrapped into a single model.
  • Give the new model a Name.
  • Enable the option Include intermediate outputs in model's outputs if applicable for your situation. See below for more info.
  • Click Apply to create the model.

The Chain Model step automatically analyses the models and draws connections between models as required. See section below to see how the Chain Model step works depending on input model’s topologies.


Examples

Quickly show how it would apply in a simple example. Some people would look for this section first.


More on this step

Below are details on how the Chain Model works depending on the input models' configurations.

1) Common model inputs

The sketch below shows how the chain model will wrap the models and expose the common inputs only once and feed the inputs into all models internally. All outputs will be exposed by the chain model.

You might get better results if you train separate models for all outputs instead of one big model for all outputs together. By using separate models for each output you can try different model types and model layouts for each output which gives you more degrees of freedom. But if you eventually need a single model to run an optimisation on all those outputs at once you can use the chain model to wrap all models into a single model.

2) One model's outputs are another model’s inputs

As you see in the sketch below model M1 has the outputs C and D while model M2 has the same two features as inputs. When this models are chained together the outputs of model M1 will be used as inputs to model M2. The outputs of model M1 will be not visible externally anymore.

If the features C and D should be exposed as outputs by the Chain model you can do so by enabling the option Include intermediate outputs in model's outputs. The chain model would then connect models M1 and M2 and additionally expose features C and D as outputs of the chain model itself.

This application of chain model can be useful if you have a model which predicts outputs C and D from inputs A and B with high accuracy and another model which can predict outputs E and F with high accuracy from C and D. But your final engineering task might be to find the optimal A and B to achieve a required target for E and F. By wrapping the two models together into a single chain model you have exactly the model required for the task described above.

3) Mixed chaining model

The two options above can of course be combined:

With the option Include intermediate outputs in model's outputs enabled, feature C could be exposed as output of the chain model.

4) Independent models

You can also use the chain model to tie together models which have no inputs and no outputs in common. This might be useful if you want to run an optimisation on the outputs of those independent models which requires a single model.

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article