MAIDR JavaScript API
    Preparing search index...

    Interface RocPoint

    One operating point of a ROC curve: the false positive rate a classifier pays and the true positive rate it gets at one decision threshold.

    A ROC layer is RocPoint[][], one array per curve, so several classifiers (or the classes of one) are compared in one layer the way a multi-line layer holds several series; z names the curve, as it names a line. Both rates are fractions of one. Listed in any order: the area is measured over the points sorted by x.

    // one classifier, three thresholds, with the area it scored
    {
    type: 'roc',
    data: [[
    { x: 0, y: 0, threshold: 1, z: 'Logistic', auc: 0.9 },
    { x: 0.1, y: 0.8, threshold: 0.5, z: 'Logistic' },
    { x: 1, y: 1, threshold: 0, z: 'Logistic' },
    ]],
    }
    interface RocPoint {
        z?: string;
        label?: string;
        yMin?: number;
        yMax?: number;
        x: number;
        y: number | null;
        threshold?: number | null;
        auc?: number | null;
    }

    Hierarchy (View Summary)

    Index

    Properties

    z?: string
    label?: string

    Ordinal level name announced in place of the raw numeric y, for a chart whose y axis is a category rather than a magnitude — a hypnogram's sleep stages, a Likert response, a severity grade. y stays numeric because it drives sonification, braille and the min/max range, so the human-readable name has to travel alongside it.

    An empty string counts as absent, so a producer that emits '' for an unnamed level gets the numeric announcement rather than a blank one. Omitting it entirely is the right shape for a continuous y.

    { x: 1.5, y: 3, label: 'REM' }
    
    yMin?: number

    Lower bound of the uncertainty around y, when the chart draws one.

    A fitted curve almost always comes with a band, and it is the reason the curve is drawn rather than a plain line: geom_smooth(se = TRUE) and sns.regplot both default to one. Carried on the sample rather than in a layer of its own so a reader hears the value and its interval at the same x — the comparison a band exists for is whether the trend is distinguishable from flat, and that cannot be made by navigating two layers in turn.

    Named to match ErrorBarPoint, so a producer that already computes an interval emits the same keys wherever it puts them.

    Both bounds are optional and independent: a one-sided interval is a real chart, and a sample missing its bounds still carries its value.

    yMax?: number

    Upper bound of the uncertainty around y. See LinePoint.yMin.

    x: number

    The false positive rate at this threshold, from 0 to 1.

    y: number | null

    The true positive rate at this threshold, from 0 to 1, or null for a gap.

    threshold?: number | null

    The decision threshold this operating point was scored at.

    It is the one number a reader can act on: the curve shows what each threshold costs and buys, and without it the reader learns the rates but not how to get them. Optional because a curve drawn from rates alone is still a ROC curve.

    auc?: number | null

    The area under this curve, as the producer computed it.

    Read from the first point of the curve that declares one, the way z names a series from its first point. When no point declares it, the area is the trapezoid rule over the curve's own points -- which is what sklearn.metrics.auc and pROC::auc compute, so a producer that has the number can pass it and one that does not can leave it out.