metric: Calculate metric

View source: R/metric_class.R

calculateR Documentation

Calculate metric

Description

A class for metrics to assess performance of e.g. models, iterators. Not intended to be called directly, this class should be inherited to provide functionality for method-specific classes.

Usage

calculate(obj, ...)

value(obj)

value(obj) <- value

max_length(obj) <- value

metric(...)

## S4 method for signature 'metric'
calculate(obj, Y, Yhat)

## S4 method for signature 'metric'
value(obj)

## S4 replacement method for signature 'metric'
value(obj) <- value

Arguments

obj

a metric object

...

named slots and their values.

value

value

Y

the true class labels

Yhat

the predicted class labels

Value

value the calculated value of a metric

a metric object

Examples

MET = metric()
calculate(MET)
MET = metric()
M = metric()
calculate(M,Y,Yhat)
MET = metric()
value(MET)
MET = metric()
value(MET) = 10

computational-metabolomics/struct documentation built on March 27, 2024, 4:26 p.m.