Skip to content

Commit ebddbb5

Browse files
committed
another code simplification - related to scoring
1 parent aa9920a commit ebddbb5

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

causalpy/experiments/synthetic_control.py

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -155,16 +155,10 @@ def __init__(
155155
raise ValueError("Model type not recognized")
156156

157157
# score the goodness of fit to the pre-intervention data
158-
if isinstance(self.model, PyMCModel):
159-
self.score = self.model.score(
160-
X=self.datapre_control.to_numpy(),
161-
y=self.datapre_treated.to_numpy(),
162-
)
163-
else:
164-
self.score = self.model.score(
165-
X=self.datapre_control.to_numpy(),
166-
y=self.datapre_treated.isel(treated_units=0).to_numpy(),
167-
)
158+
self.score = self.model.score(
159+
X=self.datapre_control.to_numpy(),
160+
y=self.datapre_treated.to_numpy(),
161+
)
168162

169163
# get the model predictions of the observed (pre-intervention) data
170164
self.pre_pred = self.model.predict(X=self.datapre_control)

0 commit comments

Comments
 (0)