Skip to content

Commit 0034527

Browse files
authored
Merge pull request #232 from cmu-delphi/ndefries/gc-after-state-scores
Call `gc()` after saving state scores
2 parents e33cb85 + 34009cb commit 0034527

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

Report/create_reports.R

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,8 @@ for (signal_name in signals) {
139139
check_for_missing_forecasters(state_predictions, forecasters, "state", signal_name, output_dir)
140140
}
141141

142+
save_score_errors <- list()
143+
142144
## Score predictions
143145
print("Evaluating state forecasts")
144146
geo_type <- "state"
@@ -147,20 +149,21 @@ state_scores <- evaluate_covid_predictions(state_predictions,
147149
geo_type = geo_type
148150
)
149151

150-
save_score_errors <- list()
151-
152152
for (signal_name in signals) {
153153
status <- save_score_cards_wrapper(state_scores, geo_type, signal_name, output_dir)
154154
if (status != 0) {
155155
save_score_errors[paste(signal_name, geo_type)] <- status
156156
}
157157
}
158158

159+
rm(state_scores)
160+
gc()
161+
159162
print("Evaluating national forecasts")
160163
# TODO: When this function was created, COVIDcast did not return national level
161164
# data, and CovidHubUtils was used instead. We could now switch to COVIDcast,
162165
# but COVIDcast and CovidHubUtils don't produce exactly the same data. This
163-
# requires more investigation. Also using CovidHubUtils might be faster.
166+
# requires more investigation. Not using `evalcast` is also faster.
164167
geo_type <- "nation"
165168
nation_scores <- evaluate_chu(nation_predictions, signals, err_measures)
166169

0 commit comments

Comments
 (0)