How to properly use split data with PyMC?

Thanks for your answer. I believe it does take me where I wanted. My code is now:

with pm.Model() as model:
    x = pm.MutableData('x', X_train)
    beta = pm.Normal('beta', mu = 0, sigma = 5, shape = len(df.columns))
    p = pm.Deterministic('p', pm.math.sigmoid(beta[0] + beta[1]*X_train.Temperature + beta[2]*X_train.Humidity
                                               + beta[3]*X_train.Light + beta[4]*X_train.CO2 + 
                                                beta[5]*X_train.HumidityRatio))
    obs = pm.Bernoulli('obs', p, observed=y_train)
    idata = pm.sample(3000)

with model:
    pm.set_data({'x':X_test})
    y_pred = pm.sample_posterior_predictive(idata)

Now I have one more question… for the problem that I’ll have to tackle in the future, I can’t call my pm.math.sigmoid so explicitly like this with beta[1]*X_train.Something, etc. as it is a high-dimensional problem. I tried an approach where I would define a func as a string like shown below:

func = 'beta[0]'
for i in range(len(X.columns)):
    func += f'+ beta[{i+1}]*X.iloc[:,{i}]'

and then do p = pm.Deterministic('p', pm.math.sigmoid(eval(func))). But that didn’t work. How should I approach this? So I don’t have to write it out every multiplication… I also tried to do something like pm.math.sigmoid(beta[0] + beta[1]@X_train.values.T) but that didn’t work…

Thanks once again!