Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion causal_testing/surrogate/causal_surrogate_assisted.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from causal_testing.testing.base_test_case import BaseTestCase
from causal_testing.testing.estimators import CubicSplineRegressionEstimator


@dataclass
class SimulationResult:
"""Data class holding the data and result metadata of a simulation"""
Expand All @@ -19,7 +20,7 @@ class SimulationResult:

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


Expand Down
2 changes: 1 addition & 1 deletion causal_testing/testing/estimators.py
Original file line number Diff line number Diff line change
Expand Up @@ -823,7 +823,7 @@ def estimate_hazard_ratio(self):

# IPCW step 4: Use these weights in a weighted analysis of the outcome model
# Estimate the KM graph and IPCW hazard ratio using Cox regression.
cox_ph = CoxPHFitter()
cox_ph = CoxPHFitter(alpha=self.alpha)
cox_ph.fit(
df=preprocessed_data,
duration_col="tout",
Expand Down
Loading