Skip to content

Commit caef9a9

Browse files
committed
[black + test run]
1 parent 70d01e7 commit caef9a9

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

ppi_py/ppi.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,11 @@
33
from scipy.stats import norm, binom
44
from scipy.optimize import brentq, minimize
55
from 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+
)
711
from sklearn.linear_model import LogisticRegression, PoissonRegressor
812
import 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+
964969
def 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,

tests/test_logistic.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff 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+
6767
def 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,

0 commit comments

Comments
 (0)