rStats.js v1.3.0
    Preparing search index...

    Function coords

    • Coordinates of a ROC curve: sensitivity, specificity, the counts, predictive values, likelihood ratios and the criteria of the best threshold, at every point of the curve, at the best threshold(s) or at given thresholds. Equivalent to pROC::coords(roc, x, ret = "all") in R.

      Every column is computed from the integer counts of each threshold and rounded once (pROC rebuilds the counts from the proportions, so that they are not always integers, and loses digits in 1 − specificity). The rows of "best" are all the points whose criterion equals the best one exactly (pROC compares rounded sums and can lose ties). At a given threshold, an observation equal to it counts as positive.

      Parameters

      • curve: RocResult

        A curve from roc.

      • x: number | readonly number[] | string & {} | "all" | "best" = "all"

        "all" (default: every point of the curve), "best", or thresholds (a number or an array).

      • options: CoordsOptions = {}

      Returns CoordsResult

      const r = roc({ controls: [1, 2, 2, 3, 5, 7], cases: [2, 4, 5, 5, 8, 9, 10] });
      const best = coords(r, "best");
      best.threshold; // [3.5]
      best.sensitivity; // [0.8571428571428571]
      coords(r, [4, 6]).tp; // [6, 3]