optim_thresh | R Documentation |
This function returns the threshold to turn probabilities into binary classes
whilst optimising a given metric. Currently available for tss_max
,
kap_max
and sensitivity
(for which a target sensitivity is required).
optim_thresh(truth, estimate, metric, event_level = "first")
truth |
The column identifier for the true class results (that is a factor). This should be an unquoted column name although this argument is passed by expression and supports quasiquotation (you can unquote column names). For _vec() functions, a factor vector. |
estimate |
the predicted probability for the event |
metric |
character of metric to be optimised. Currently only "tss_max", "kap_max", and "sensitivity" with a given target (e.g. c("sensitivity",0.8)) |
event_level |
A single string. Either "first" or "second" to specify which level of truth to consider as the "event". This argument is only applicable when estimator = "binary". The default uses an internal helper that generally defaults to "first" |
the probability threshold for the event
optim_thresh(two_class_example$truth, two_class_example$Class1,
metric = c("tss_max")
)
optim_thresh(two_class_example$truth, two_class_example$Class1,
metric = c("sens", 0.9)
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.