Skip to content

Commit

Permalink
Try to fix scoring algorithm for 7-day
Browse files Browse the repository at this point in the history
  • Loading branch information
ibacher committed Sep 17, 2024
1 parent edb1580 commit 843e79f
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions docker-resources/plumber.R
Original file line number Diff line number Diff line change
Expand Up @@ -192,12 +192,10 @@ function(
# which makes things easier since most libraries can't work with an H2OFrame
results_adults_1day_df <- as.data.frame(results_adults_1day)
results_adults_7day_df <- as.data.frame(results_adults_7day) %>%
select(predicted_prob_disengage_7day = Disengaged) %>%
mutate(predicted_prob_disengage_7day = predicted_prob_disengage_7day * 10)
select(predicted_prob_disengage_7day = Disengaged)
results_minors_1day_df <- as.data.frame(results_minors_1day)
results_minors_7day_df <- as.data.frame(results_minors_7day) %>%
select(predicted_prob_disengage_7day = Disengaged) %>%
mutate(predicted_prob_disengage_7day = predicted_prob_disengage_7day * 10)
select(predicted_prob_disengage_7day = Disengaged)

# for the case where we need this, it should be safe to assume
# that the start week has the correct values
Expand Down Expand Up @@ -376,6 +374,7 @@ predict_risk <- function(.data, cohort, age_category) {
) %>%
ungroup() %>%
select(-c(percentile)) %>%
group_by(location_id) %>%
mutate(
percentile = percent_rank(predicted_prob_disengage_7day),
predicted_risk_7day =
Expand Down

0 comments on commit 843e79f

Please sign in to comment.