metric: Calculate metric

Description Usage Arguments Value Examples

View source: R/metric_class.R

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
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

1
2
3
4
5
6
7
8
9
MET = metric()
calculate(MET)
MET = metric()
M = metric()
calculate(M,Y,Yhat)
MET = metric()
value(MET)
MET = metric()
value(MET) = 10

struct documentation built on Nov. 8, 2020, 8:14 p.m.