evaluation.recall: Recall of classification predictions

evaluation.recallR Documentation

Recall of classification predictions

Description

Evaluation predictions of a classification model according to recall.

Usage

evaluation.recall(predictions, gt, average = NULL, positive = NULL, ...)

Arguments

predictions

The predictions of a classification model (factor or vector).

gt

The ground truth (factor or vector).

average

How the per-class values are combined. These measures are defined for one class against all the others, so a single number requires either picking that class or averaging.

"binary"

the value for the class named by positive. Two-class problems only, and the default there.

"macro"

the plain mean of the per-class values. The default beyond two classes. Gives every class the same weight, whatever its size, so a rare class the model never gets right weighs as much as the majority one.

"weighted"

the mean of the per-class values, weighted by the number of observations of each class.

"micro"

pools the counts of every class before dividing. With single-label predictions each observation contributes one predicted and one actual label, so micro-averaged precision, recall and F-measure all equal the accuracy.

"none"

the vector of per-class values, named after the classes. Cannot be used through evaluation or performance, which expect one number per criterion.

Averages run over the classes of the ground truth. A class that no observation is predicted to belong to has an undefined precision; it is read as 0, the usual convention.

positive

The label of the positive class, used by average = "binary" only. Defaults to levels (gt) [1], i.e. the first level of the ground truth factor – which, for the usual alphabetical level ordering, is often the negative class ("N" before "Y", "No" before "Yes", ...). Set this argument explicitly whenever the positive class is not the first level.

...

Other parameters.

Value

The evaluation of the predictions (numeric value).

See Also

evaluation.accuracy, evaluation.fmeasure, evaluation.fowlkesmallows, evaluation.goodness, evaluation.jaccard, evaluation.kappa, evaluation.precision, evaluation

Examples

require (datasets)
data (iris)
d = iris
levels (d [, 5]) = c ("+", "+", "-") # Building a two classes dataset
d = splitdata (d, 5)
model.nb = NB (d$train.x, d$train.y)
pred.nb = predict (model.nb, d$test.x)
evaluation.recall (pred.nb, d$test.y)

fdm2id documentation built on Aug. 28, 2026, 9:07 a.m.