Closed mortonjt closed 3 years ago
If I'm understanding your request correctly, this should already be possible by specifying the coords/dims of LL/PPC in to_inference_object
.
See the following example from the custom LME page.
inference = nb_lme.to_inference_object(
params=["beta", "phi", "subj_int"],
dims={
"beta": ["covariate", "feature"],
"phi": ["feature"],
"subj_int": ["subject"],
"log_lik": ["tbl_sample", "feature"],
"y_predict": ["tbl_sample", "feature"]
},
coords={
"feature": nb_lme.feature_names,
"covariate": nb_lme.colnames,
"subject": groups,
"tbl_sample": nb_lme.sample_names
},
alr_params=["beta"],
posterior_predictive="y_predict",
log_likelihood="log_lik",
include_observed_data=True
)
Let me know if I've misunderstood.
got it ... ok I don't think this is a problem, looks like I wasn't specifying it correctly.
Here is an example of an
InferenceData
objectHere,
y_predict_dim_0
andlog_lhood_dim_0
correspond to biological sample names, but that information is lost when theInferenceData
object is created. It would be super useful if the sample information is retained. I think should boil down to modifying this block of code with