with pm.Model() as Store_Compare_regression_model:
Item_MRP = pm.Data("Item_MRP", Store_Compare_models["Item_MRP"])
Item_Outlet_Sales = pm.Data("Item_Outlet_Sales", Store_Compare_models["Item_Outlet_Sales"])
Item_Visibility = pm.Data("Item_Visibility", Store_Compare_models["Item_Visibility"])
Low_Fat = pm.Data("Low_Fat", Store_Compare_models["Low Fat"])
Regular = pm.Data("Regular", Store_Compare_models["Regular"])
Tier_1 = pm.Data("Tier_1", Store_Compare_models["Tier 1"])
Tier_2 = pm.Data("Tier_2", Store_Compare_models["Tier 2"])
Tier_3 = pm.Data("Tier_3", Store_Compare_models["Tier 3"])
# priors
beta_i = pm.Normal("beta_i", mu=0, sigma=1)
beta_Item_MRP = pm.Normal("beta_Item_MRP", mu=0, sigma=1)
beta_Item_Outlet_Sales= pm.Normal("beta_Item_Outlet_Sales", mu=0, sigma=1)
beta_Item_Visibility = pm.Normal("beta_Item_Visibility", mu=0, sigma=1)
beta_Low_Fat = pm.Normal("beta_Low_Fat", mu=0, sigma=1)
beta_Regular = pm.Normal("beta_Regular", mu=0, sigma=1)
beta_Tier_1 = pm.Normal("beta_Tier_1", mu=0, sigma=1)
beta_Tier_2 = pm.Normal("beta_Tier_2", mu=0, sigma=1)
beta_Tier_3 = pm.Normal("beta_Tier_3", mu=0, sigma=1)
# linear model
mu = beta_i + beta_Item_MRP * Item_MRP + beta_Item_Outlet_Sales * Item_Outlet_Sales + beta_Item_Visibility * Item_Visibility + beta_Low_Fat * Low_Fat + beta_Regular * Regular + beta_Tier_1 * Tier_1 + beta_Tier_2 * Tier_2 +beta_Tier_3 * Tier_3
p = pm.Deterministic("p", pm.math.invlogit(mu))
# likelihood
pm.Bernoulli("WL", p=p, observed=Store_Compare_models["Item_Outlet_Sales"])