Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

MLMetric

MLMetric Class Constructor


Description

Create a performance metric for use with the MachineShop package.

Usage

MLMetric(object, name = "MLMetric", label = name, maximize = TRUE)

MLMetric(object) <- value

Arguments

object

function to compute the metric, defined to accept observed and predicted as the first two arguments and with an ellipsis (...) to accommodate others.

name

character name of the object to which the metric is assigned.

label

optional character descriptor for the model.

maximize

logical indicating whether higher values of the metric correspond to better predictive performance.

value

list of arguments to pass to the MLMetric constructor.

Value

MLMetric class object.

See Also

Examples

f2_score <- function(observed, predicted, ...) {
  f_score(observed, predicted, beta = 2, ...)
}

MLMetric(f2_score) <- list(name = "f2_score",
                           label = "F Score (beta = 2)",
                           maximize = TRUE)

MachineShop

Machine Learning Models and Tools

v2.8.0
GPL-3
Authors
Brian J Smith [aut, cre]
Initial release
2021-04-16

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.