recall

It measures the performance of a classification model in terms of the classifier's ability to predict positive examples correctly out of all positive examples. Recall score can be interpreted as the probability that a randomly selected positive example is correctly identified by the classifier, where the best value is 1 and the worst is 0.

Syntax

Score = recall(targets,predictions,average)

Inputs

targets
Actual label for each observation.
Type: double
Dimension: vector
predictions
Predicted value for each observation.
Type: double
Dimension: vector
average
Averaging strategy in case of multiclass classification. 'micro' (default), 'macro', 'none' are the possible values for average. If 'none' is chosen, per class metric is given as output.
Type: char
Dimension: string

Outputs

Score
Recall score of the classifier.
Type: double
Dimension: scalar | struct (if 'none' is chosen)

Example

Usage of recall

targets = [0, 1, 2, 3, 0, 1, 2, 3];
predictions = [1, 0, 2, 1, 3, 1, 2, 1];
score1 = recall(targets, predictions);
score2 = recall(targets, predictions, 'micro');
score3 = recall(targets, predictions, 'macro');
score4 = recall(targets, predictions, 'none');
printf('Micro: %f \n', score1);
printf('Micro: %f \n', score2);
printf('Macro: %f \n', score3);
printf('None : ');
disp(score4);
Micro: 0.375000 
Micro: 0.375000 
Macro: 0.375000 
None : 
struct [
  0: 0
  1: 0.5
  2: 1
  3: 0
]