sorbetto.performance.two_class_classification_performance module

class sorbetto.performance.two_class_classification_performance.TwoClassClassificationPerformance(ptn: float, pfp: float, pfn: float, ptp: float, name: str | None = None)[source]

Bases: AbstractPerformance

A two-class (crisp) classification performance \(P\) is a probability measure over the measurable space \((\Omega,\Sigma)\) where the sample (a.k.a. universe) is \(\Omega=\{tn,fp,fn,tp\}\) and the event space is \(\Sigma=2^\Omega\). By convention, \(tn\), \(fp\), \(fn\), and \(tp\) represent the four cases that can arise: a true negative, a false positive, a false negative, and a true positive, respectively. The four elementary probability measures \(P(\{tn\})\), \(P(\{fp\})\), \(P(\{fn\})\), and \(P(\{tp\})\) are the elements of the normalized confusion matrix.

See Piérard et al. [17] for more information on this topic.

static buildFromRankingScoreValues(name, *pairsOfRankingScoresAndValues) TwoClassClassificationPerformance[source]
drawInROC(fig: Figure, ax: Axes) None[source]

See https://en.wikipedia.org/wiki/Receiver_operating_characteristic

Parameters:
  • fig (Figure) – _description_

  • ax (Axes) – _description_

getMassFunction() ndarray[source]
static getNoSkill(*, priorNeg: float | None = None, priorPos: float | None = None, rateNeg: float | None = None, ratePos: float | None = None, name: str | None = None) Self[source]
isAboveNoSkills() bool[source]
isBelowNoSkills() bool[source]
isNoSkill() bool[source]
property pfn: float

The probability of a false negative, \(P( \{ fn \} )\).

Returns:

The probability of a false negative, \(P( \{ fn \} )\).

Return type:

float

property pfp: float

The probability of a false positive, \(P( \{ fp \} )\).

Returns:

The probability of a false positive, \(P( \{ fp \} )\).

Return type:

float

property ptn: float

The probability of a true negative, \(P( \{ tn \} )\).

Returns:

The probability of a true negative, \(P( \{ tn \} )\).

Return type:

float

property ptp: float

The probability of a true positive, \(P( \{ tp \} )\).

Returns:

The probability of a true positive, \(P( \{ tp \} )\).

Return type:

float

tol = 1e-10