Skip to contents

An S4 class providing the methods to compute an accuracy measure.

The object consists of 6 slots

Constructor for the S4 Scorer object.

Usage

Scorer(
  id,
  scorer,
  parameters,
  resp.type,
  grouped = TRUE,
  selector,
  optimum,
  quantifier = Quantifier(),
  logger = Logger()
)

Arguments

id

the scoring method name associated to this Scorer. If scoring method is one of the accuracy measures supported by renoir, the constructor will automatically select a scorer and a selector. See supported_scoring_methods() for the supported methods.

scorer

(optional) function to evaluate a model performance. Must be provided if id is not one of the accuracy measures supported by renoir. If scorer is provided it must conform to the renoir common interface, and must have the following formal arguments:

true

a vector (or a matrix) of observed values. If a matrix is provided, a multi-response is assumed

pred

a vector (or a matrix) of predicted values

weights

priors of the observations

multi

what to do when response has multiple output values

...

additional arguments can be added

parameters

list containing the parameters to fix for the chosen scoring method

resp.type

(optional) response type. If provided, the selected id is checked to see if available for the considered response type.

grouped

logical, whether to compute separate statistics when lists of values are provided

selector

(optional) function to select optimal accuracy measure from multiple values Must be provided if id is not one of the accuracy measures supported by renoir. If selector is provided it must conform to the renoir common interface, and must have the following formal arguments:

measures

a vector of accuracy measures returned by this Scorer

optimum

the optimisation problem to solve for selecting the optimal accuracy measure from multiple values

quantifier

a Quantifier

logger

a Logger

Slots

id

the accuracy measure

scorer

function to be used for scoring

parameters

list containing the parameters to fix for the scoring function

grouped

logical, whether to compute separate statistics when lists of values are provided

selector

function to select optimal measure given a vector of values

optimum

the optimisation problem to solve for selecting the optimal accuracy measure. Two possible values are min and max

quantifier

a Quantifier

logger

a Logger

Author

Alessandro Barberis