Skip to content

Commit 7dfde73

Browse files
committed
Don't fit the current census against forecast days past the peak
1 parent 7d5fe8c commit 7dfde73

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/penn_chime/models.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,8 @@ def get_loss(self) -> float:
182182

183183

184184
def get_argmin_ds(census_df: pd.DataFrame, current_hospitalized: float) -> float:
185-
losses_df = (census_df.hospitalized - current_hospitalized) ** 2.0
185+
peak_day = census_df.hospitalized.argmax()
186+
losses_df = (census_df.hospitalized[:peak_day] - current_hospitalized) ** 2.0
186187
return losses_df.argmin()
187188

188189

0 commit comments

Comments
 (0)