Prediction by Bayesian linear regression

As for prediction, your code is currently training on all the data. It is not using the train/test split you constructed at the beginning. To do so, you would use the training data instead of the dataset itself.

# Estimate of mean
    mean = intercept + slope * X_train['var1']

and

Y_obs = pm.Normal('Y_obs', mu = mean, sd = sigma, observed = y_train)
2 Likes