View source: R/define_target.R
define_target | R Documentation |
This function may be used to define a custom evaluation target. Many targets from the Metrics package can be imported directly. Call define_target() for a list of known targets.
define_target(
target,
measure,
type = c("performance", "error"),
task = c("classification", "regression"),
co.primary = c(FALSE, TRUE)
)
target |
character, giving the name of the performance measure. |
measure |
function with two arguments (actual, predicted) defining how (dis)similarity between actual and predicted labels is measured. The return value of measure needs to be numeric, even if the prediction is NA. |
type |
character, either "performance" (higher values indicate better performance, default) or "error" (higher values indicate worse performance) |
task |
character, either "classification" (default) or "regression" |
co.primary |
logical: should target be assessed in both subpopulations (only possible for binary "classification" tasks)? |
If target is a recognized (e.g. "accuracy"), all other arguments are ignored. If target is missing (default function call), a list of known targets is printed. The only stored target with co.primary = TRUE, is called "sensspec" and corresponds to accessing sensitivity and specificity of a classifier as co-primary endpoints.
An object of class SEPM.objective which is used as the starting point of the further evaluation pipeline. SEPM.objective contains elements target, measure, task and co.primary. In addition, the logical custom indicates if the objective definition was user specific.
define_target()
tar <- define_target("accuracy")
tar
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.