I have an issue when applying the standard GLM formula with many features.
Is there any way to write Y ~ X1+X2 +…+Xn (with n very large) without using the symbol +?
I would love using a more compact syntax, such as X1:Xn.
This is a small example of what I am basically trying to do.
niter = 10000
with pm.Model() as model0:
pm.glm.GLM.from_formula('target ~ feat1+feat2 + feat3', df, family=pm.glm.families.Binomial())
trace0 = pm.sample(niter, step=pm.Metropolis(), random_seed=123, progressbar=True)
thanks for the prompt and very useful reply. Just a question: using the proposed solution would imply having an extra + operator at the end of the feature list in python pm.glm.GLM.from_formula('target ~ feat1+feat2 + feat3', df, family=pm.glm.families.Binomial()), wouldn’t it? Moreover, you set the [:-3] at the end but wouldn’t it create an empty list?
Thanks for the support