recall

Description

Given an Observable of ground-truth labels and predictions, the recall operator returns the recall.

Examples

import { from } from 'rxjs';
import { recall } from '@bottlenose/rxstats';

const items = [
  [0, 1], // [trueLabel, prediction]
  [0, 1],
  [0, 1],
  [0, 0],
  [0, 0],
  [1, 1],
  [1, 1],
  [1, 1],
  [1, 1],
  [1, 0],
];

const recall$ = from(items).pipe(
  recall()
);

recall$.subscribe(console.log);
// Output
// 0
// 0
// 0
// 0
// 0
// 0.25
// 0.40
// 0.50
// 0.5714285714
// 0.5714285714

API

recall([initialState={truePositives: 0, falseNegatives: 0}])

Since

0.1

Parameters

None

Options

  • initialState: Object {truePositives: Number, falseNegatives: Number}: Sets a warm start value so that the calculation can continue from a non-zero starting point (instead of a blank state). The initialState should have these keys:

    • truePositives: Number is a count of the true positives

    • falseNegatives: Number is a count of the false negatives

Returns

Number. (The current recall of the Observable.)

Last updated