Skip to content

Commit

Permalink
Add SingleFeature NB LME
Browse files Browse the repository at this point in the history
  • Loading branch information
gibsramen committed Sep 18, 2023
1 parent 60f5a03 commit a1df859
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ birdman/templates/negative_binomial
birdman/templates/multinomial
birdman/templates/negative_binomial_single
birdman/templates/negative_binomial_lme
birdman/templates/negative_binomial_lme_single
tests/custom_model

*__pycache__/
Expand Down
3 changes: 2 additions & 1 deletion birdman/default_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,8 @@ def __init__(
"inv_disp_sd": inv_disp_sd,
"A": A,
"subj_ids": samp_subj_map,
"u_p": group_var_prior
"u_p": group_var_prior,
"S": len(self.groups)
}
self.add_parameters(param_dict)

Expand Down
3 changes: 3 additions & 0 deletions tests/test_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ def test_single_feat(self, table_biom, metadata):

def test_lme_single_feat(self, table_biom, metadata):
md = metadata.copy()
np.random.seed(42)
md["group"] = np.random.randint(low=0, high=3, size=md.shape[0])
md["group"] = "G" + md["group"].astype(str)
for fid in table_biom.ids(axis="observation"):
nb = NegativeBinomialLMESingle(
table=table_biom,
Expand Down

0 comments on commit a1df859

Please sign in to comment.