Skip to content

Commit dae1800

Browse files
committed
pylint
1 parent 5145d36 commit dae1800

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

causal_testing/testing/validation.py

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66

77

88
class CausalValidator:
9+
"""A suite of validation tools to perform Quantitive Bias Analysis to back up causal claims"""
10+
911
def estimate_robustness(self, model: RegressionResultsWrapper, q=1, alpha=1):
1012
"""Calculate the robustness of a linear regression model. This allow
1113
the user to identify how large an unidentified confounding variable
@@ -41,15 +43,14 @@ def estimate_e_value(
4143

4244
return (e, (lower_limit, 1))
4345

44-
else:
45-
risk_ratio_prime = 1 / risk_ratio
46-
e = risk_ratio_prime + math.sqrt(risk_ratio_prime * (risk_ratio_prime - 1))
46+
risk_ratio_prime = 1 / risk_ratio
47+
e = risk_ratio_prime + math.sqrt(risk_ratio_prime * (risk_ratio_prime - 1))
4748

48-
upper_limit = confidence_intervals[1]
49-
if upper_limit >= 1:
50-
upper_limit = 1
51-
else:
52-
upper_limit_prime = 1 / upper_limit
53-
upper_limit = upper_limit_prime + math.sqrt(upper_limit_prime * (upper_limit_prime - 1))
49+
upper_limit = confidence_intervals[1]
50+
if upper_limit >= 1:
51+
upper_limit = 1
52+
else:
53+
upper_limit_prime = 1 / upper_limit
54+
upper_limit = upper_limit_prime + math.sqrt(upper_limit_prime * (upper_limit_prime - 1))
5455

55-
return (e, (1, upper_limit))
56+
return (e, (1, upper_limit))

0 commit comments

Comments
 (0)