If you make the observed data mutable data:
obs_data = pm.Data("obs_data", value = y_train, mutable = True)
observed = pm.Bernoulli("indicator",
pm.math.sigmoid(beta_0 +
beta_1 * first_feature +
beta_2 * second_feature
),
observed = obs_data
)
and then swap the observed data:
with logistic_model_pred:
pm.set_data({'first_feature': X_test['first_feature']})
pm.set_data({'second_feature': X_test['second_feature']})
pm.set_data({'second_feature': X_test['second_feature']})
pm.set_data({'obs_data': y_test})
ppc = pm.sample_posterior_predictive(trace = pred_trace)
I think it should work?