Get cutoff values for group predictions
get_cutoffs(x)
x | Data frame from |
---|
A message is printed about the thresholds. If outcome_groups
were defined the return value is a single numeric value, the threshold used
to separate predicted probabilities into outcome groups. If
risk_groups
were defined the return value is a data frame with one
column giving the group names and another column giving the minimum
predicted probability for an observation to be in that group.
machine_learn(pima_diabetes[1:20, ], patient_id, outcome = diabetes, models = "xgb", tune = FALSE) %>% predict(risk_groups = 5) %>% get_cutoffs()#>#>#> #>#> #>#>#>#> #>#>#>#> # A tibble: 5 x 2 #> group minimum_probability #> <chr> <dbl> #> 1 risk_group1 0.908 #> 2 risk_group2 0.797 #> 3 risk_group3 0.607 #> 4 risk_group4 0.521 #> 5 risk_group5 0