File tree Expand file tree Collapse file tree 2 files changed +10
-5
lines changed Expand file tree Collapse file tree 2 files changed +10
-5
lines changed Original file line number Diff line number Diff line change 33from scipy .stats import norm , binom
44from scipy .optimize import brentq , minimize
55from statsmodels .regression .linear_model import OLS , WLS
6- from statsmodels .stats .weightstats import _zconfint_generic , _zstat_generic , _zstat_generic2
6+ from statsmodels .stats .weightstats import (
7+ _zconfint_generic ,
8+ _zstat_generic ,
9+ _zstat_generic2 ,
10+ )
711from sklearn .linear_model import LogisticRegression , PoissonRegressor
812import warnings
913
@@ -961,6 +965,7 @@ def _logistic_get_stats(
961965 inv_hessian = np .linalg .inv (hessian ).reshape (d , d )
962966 return grads , grads_hat , grads_hat_unlabeled , inv_hessian
963967
968+
964969def ppi_logistic_pval (
965970 X ,
966971 Y ,
@@ -1030,7 +1035,7 @@ def ppi_logistic_pval(
10301035 w_unlabeled ,
10311036 use_unlabeled = use_unlabeled ,
10321037 )
1033-
1038+
10341039 if lam is None :
10351040 lam = _calc_lam_glm (
10361041 grads ,
Original file line number Diff line number Diff line change @@ -62,8 +62,8 @@ def test_ppi_logistic_pointestimate_recovers():
6262 )
6363 # Check that the point estimate is close to the true beta
6464 assert np .linalg .norm (beta_ppi_pointestimate - beta ) < 0.2
65-
66-
65+
66+
6767def test_ppi_logistic_pval_makesense ():
6868 # Make a synthetic regression problem
6969 n = 10000
@@ -86,7 +86,7 @@ def test_ppi_logistic_pval_makesense():
8686 optimizer_options = {"gtol" : 1e-3 },
8787 )
8888 assert beta_ppi_pval [- 1 ] < 0.1
89-
89+
9090 beta_ppi_pval = ppi_logistic_pval (
9191 X ,
9292 Y ,
You can’t perform that action at this time.
0 commit comments