File tree 2 files changed +11
-10
lines changed
2 files changed +11
-10
lines changed Original file line number Diff line number Diff line change @@ -468,17 +468,17 @@ class DifferentialExpressionTestLRT(_DifferentialExpressionTestSingle):
468
468
469
469
sample_description : pd .DataFrame
470
470
full_design_loc_info : patsy .design_info
471
- full_estim : glm .train .numpy .glm_nb .Estimator
471
+ full_estim : glm .train .numpy .glm_base .Estimator
472
472
reduced_design_loc_info : patsy .design_info
473
- reduced_estim : glm .train .numpy .glm_nb .Estimator
473
+ reduced_estim : glm .train .numpy .glm_base .Estimator
474
474
475
475
def __init__ (
476
476
self ,
477
477
sample_description : pd .DataFrame ,
478
478
full_design_loc_info : patsy .design_info ,
479
- full_estim : glm .train .numpy .glm_nb .Estimator ,
479
+ full_estim : glm .train .numpy .glm_base .Estimator ,
480
480
reduced_design_loc_info : patsy .design_info ,
481
- reduced_estim : glm .train .numpy .glm_nb .Estimator
481
+ reduced_estim : glm .train .numpy .glm_base .Estimator
482
482
):
483
483
super ().__init__ ()
484
484
self .sample_description = sample_description
Original file line number Diff line number Diff line change 9
9
logger = logging .getLogger (__name__ )
10
10
11
11
12
- class TestAccuracyGlmNb (
12
+ class TestConvergence (
13
13
unittest .TestCase
14
14
):
15
15
"""
16
16
Test whether optimizers yield exact results for negative binomial distributed data.
17
17
"""
18
18
19
- def test_full_nb (self ):
20
- logging .getLogger ("batchglm" ).setLevel (logging .INFO )
21
- logger .error ("TestAccuracyGlmNb.test_full_nb()" )
22
-
19
+ def _test_full_model (self , noise_model ):
23
20
np .random .seed (1 )
24
21
adata = sc .datasets .pbmc3k ()
25
22
tf = "MALAT1"
@@ -37,11 +34,15 @@ def test_full_nb(self):
37
34
quick_scale = False ,
38
35
init_a = "all_zero" ,
39
36
size_factors = None ,
40
- noise_model = "nb" ,
37
+ noise_model = noise_model ,
41
38
backend = "numpy"
42
39
)
43
40
_ = temp .summary ()
44
41
42
+ def test (self ):
43
+ for noise_model in ['norm' , 'poisson' , 'nb' ]:
44
+ self ._test_full_model (noise_model )
45
+
45
46
46
47
if __name__ == '__main__' :
47
48
unittest .main ()
You can’t perform that action at this time.
0 commit comments