Memory Error when sampling my Hierarchical logistic model

Hi, chartl

According to Prediction using sample_ppc in Hierarchical model - Questions - PyMC Discourse here. I tried the sample from that question. Here is what I understand, my X_user is an index for the layers of data I want (7042) (unique value of X.uid), then X_idx will be the number of indexing variable (uid) from my training dataset (X_train_hier.uid.values). So I think the correct model should be around 6000 layer, since X_user is the index of “uid” from the whole dataset (X), where X_idx should automatically group the same “uid” from traning dataset (X_train_hier) to one layer, result in 6000-ish layer.

I know this is very confusing, I am still working my way around how to specifying hierarchical model in PyMC3. Actually, I would prefer to specify my model as:

theta = a[X_idx (layer of unique uid from substitutable input data)] + b1[X_idx (layer of unique uid from substitutable input data), 21 (uid related variables, which is the same for each unique uid value)] * X_data_people + b2[X_idx (layer of unique uid from substitutable input data), 32 (event related variables, which is different for every row of input data)]* X_data_event (represent 32 event related variables)

In general, I think I need to specify a model with subsitutible X_user (length of unique uid, 7042), X_idx (length of unique uid from input data, 6000+), X_data_people (uid related variables, 7042), and X_data_event (event related varaibles, 70345).

Could you help me clear out some possible theory of constructing such model?