Causal inference VS Active learning?
This is how the problem is formulated as a Causal Inference problem:
Take group 1 as the Control Group and group 2  the Treatment Group. Based on the observations ( &quot;S-4&quot;,&quot;S-3&quot;,&quot;S-2&quot;,&quot;S-1&quot;,&quot;S+1&quot;,&quot;S+2&quot;,&quot;S+3&quot;), a model is fit on the observations. How many models depend on the type of learning, S,T or X-learner.
Basically, what these learners do, is separately fit the features to the target (S), conditionally on the features originating from control or treatment.
Once you have fit the learners, a treatment effect is estimated.
You can see the treatment effect as the difference between the predictions on either group, given the knowledge restricted to the opposite group.
Here is a sample code from Uber's causalML
from causalml.inference.meta import XGBTRegressor

y, X, treatment = load_data()


xg = XGBTRegressor(random_state=42)
te, lb, ub = xg.estimate_ate(X, treatment, y)
print('Average Treatment Effect (XGBoost): {:.2f} ({:.2f}, {:.2f})'.format(te[0], lb[0], ub[0]))