Skip to content

Commit

Permalink
Maybe better type-checking
Browse files Browse the repository at this point in the history
  • Loading branch information
ibacher committed Apr 15, 2024
1 parent 45dd8b5 commit 7b24332
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions docker-resources/plumber.R
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,14 @@ function(

# run the predictions
# TODO Why does this seem to claim we're running in train / validate mode?
results_adults <- h2o.predict(ml_model_adult, h2o_predict_frame_adults)
on.exit(h2o.rm(results_adults))
results_minors <- h2o.predict(ml_model_minor, h2o_predict_frame_minors)
on.exit(h2o.rm(results_minors))
maybe_o2_delete <- function (obj) {
if (is.h2o(obj)) h2o.rm(obj)
}

results_adults_h2o <- results_adults <- h2o.predict(ml_model_adult, h2o_predict_frame_adults)
on.exit(maybe_o2_delete(results_adults_h2o))
results_minors_h2o <- results_minors <- h2o.predict(ml_model_minor, h2o_predict_frame_minors)
on.exit(maybe_o2_delete(results_adults_h2o))

results_adults <- as.data.frame(results_adults)
results_minors <- as.data.frame(results_minors)
Expand Down

0 comments on commit 7b24332

Please sign in to comment.