  Causal Bayesian optimisation (CaBO) combines causality with Bayesian
optimisation (BO) and shows that there are situations where the optimal reward
is not achievable if causal knowledge is ignored. While CaBO exploits causal
relations to determine the set of controllable variables to intervene on, it
does not exploit purely observational variables and marginalises them. We show
that, in general, utilising a subset of observational variables as a context to
choose the values of interventional variables leads to lower cumulative
regrets. We propose a general framework of contextual causal Bayesian
optimisation that efficiently searches through combinations of controlled and
contextual variables, known as policy scopes, and identifies the one yielding
the optimum. We highlight the difficulties arising from the application of the
causal acquisition function currently used in CaBO to select the policy scope
in contextual settings and propose a multi-armed bandits based selection
mechanism. We analytically show that well-established methods, such as
contextual BO (CoBO) or CaBO, are not able to achieve the optimum in some
cases, and empirically show that the proposed method achieves sub-linear regret
in various environments and under different configurations.
