Hi, welcome!
The predictors are used in the mean = intercept + slope * dataset.iloc[:,0].values, here you are using the first column of dataset as predictor, doing intercept + slope * x_0. You can define this in any way you want, for a univariate linear regression with multiple predictors, you can use for example
slope = pm.Normal('slope', mu = 0, sd = 10, shape=3)
mean = intercept + slope[0] * dataset.iloc[:,0].values + slope[1] * dataset.iloc[:,1].values + slope[2] * dataset.iloc[:,2].values
in order to use 3 predictors, each with it’s own slope. You could also set different priors for the slopes…
I don’t know much about the context here, but depending on what you eventually plan to work on and which extensions could the model need, I’d recommend taking a look at the pymc3.glm module and/or at bambi.
The predictors are used as I commented above in defining mean, the observed values, y in this case are passed to PyMC3 with the observed keyword, this is done in Y_obs which defines the normal likelhood of the model.
Again, I don’t know what you plan to use the model for, but in general there is no need to split the data into train and test subsets for fitting, you can evaluate the goodness of fit by other means, and overfitting is not generally an issue due to the probabilistic nature of the modeling plus the effect of the priors.
To give a concrete example, you can actually estimate the leave-one-out cross-validation with az.loo, as done in this notebook