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

new-metric

Construct a new metric function


Description

These functions provide convenient wrappers to create the three types of metric functions in yardstick: numeric metrics, class metrics, and class probability metrics. They add a metric-specific class to fn and attach a direction attribute. These features are used by metric_set() and by tune when model tuning.

See vignette("custom-metrics") for more information about creating custom metrics.

Usage

new_class_metric(fn, direction)

new_prob_metric(fn, direction)

new_numeric_metric(fn, direction)

Arguments

fn

A function. The metric function to attach a metric-specific class and direction attribute to.

direction

A string. One of:

  • "maximize"

  • "minimize"

  • "zero"


yardstick

Tidy Characterizations of Model Performance

v0.0.8
MIT + file LICENSE
Authors
Max Kuhn [aut], Davis Vaughan [aut, cre], RStudio [cph]
Initial release

We don't support your browser anymore

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