Skip to content

Commit bfd0534

Browse files
authored
Merge pull request #291 from CITCOM-project/fix-ipcw-alpha
fixed alpha bug
2 parents 2b7042d + 4d11764 commit bfd0534

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

causal_testing/surrogate/causal_surrogate_assisted.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
from causal_testing.testing.base_test_case import BaseTestCase
1010
from causal_testing.testing.estimators import CubicSplineRegressionEstimator
1111

12+
1213
@dataclass
1314
class SimulationResult:
1415
"""Data class holding the data and result metadata of a simulation"""
@@ -19,7 +20,7 @@ class SimulationResult:
1920

2021
def to_dataframe(self) -> pd.DataFrame:
2122
"""Convert the simulation result data to a pandas DataFrame"""
22-
data_as_lists = {k: v if isinstance(v, list) else [v] for k,v in self.data.items()}
23+
data_as_lists = {k: v if isinstance(v, list) else [v] for k, v in self.data.items()}
2324
return pd.DataFrame(data_as_lists)
2425

2526

causal_testing/testing/estimators.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -823,7 +823,7 @@ def estimate_hazard_ratio(self):
823823

824824
# IPCW step 4: Use these weights in a weighted analysis of the outcome model
825825
# Estimate the KM graph and IPCW hazard ratio using Cox regression.
826-
cox_ph = CoxPHFitter()
826+
cox_ph = CoxPHFitter(alpha=self.alpha)
827827
cox_ph.fit(
828828
df=preprocessed_data,
829829
duration_col="tout",

0 commit comments

Comments
 (0)