sorbetto.performance package
- class sorbetto.performance.AbstractScore(default_name: str, default_abbreviation: str | None, default_symbol: str | None, name: str | None = None, abbreviation: str | None = None, symbol: str | None = None)[source]
Bases:
ABC- property abbreviation: str | None
- property longLabel: str
- property name: str
- rename(name: str | None = None, abbreviation: str | None = None, symbol: str | None = None) None[source]
Set the name, abbreviation, and symbol of the score. It is not allowed to set the abbreviation or symbol without giving a name too.
- Parameters:
name (str | None, optional) – the new name. Defaults to None.
abbreviation (str | None, optional) – the new abbreviation. Defaults to None.
symbol (str | None, optional) – the new symbol. Defaults to None.
- Raises:
ValueError – if name is None and abbreviation or symbol are not None.
- property shortLabel: str
- property symbol: str | None
- class sorbetto.performance.FiniteSetOfTwoClassClassificationPerformances(performance_list: list[TwoClassClassificationPerformance] | ndarray, name: str = 'finite set')[source]
Bases:
object- getMean() TwoClassClassificationPerformance[source]
The mean is know as the summarized performance Piérard and Van Droogenbroeck [18] as well as Fawcett’s interpolated performance Fawcett [7].
- property name: str
- property performance_list: list[TwoClassClassificationPerformance]
- property pfn: ndarray
- property pfp: ndarray
- property ptn: ndarray
- property ptp: ndarray
- class sorbetto.performance.TwoClassClassificationPerformance(ptn: float, pfp: float, pfn: float, ptp: float, name: str | None = None)[source]
Bases:
AbstractPerformanceA 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_
- static getNoSkill(*, priorNeg: float | None = None, priorPos: float | None = None, rateNeg: float | None = None, ratePos: float | None = None, name: str | None = None) Self[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
Subpackages
Submodules
- sorbetto.performance.abstract_performance module
- sorbetto.performance.abstract_score module
- sorbetto.performance.constraint_fixed_class_priors module
- sorbetto.performance.constraint_fixed_prediction_rates module
- sorbetto.performance.finite_set_of_two_class_classification_performances module
- sorbetto.performance.roc module
- sorbetto.performance.two_class_classification_performance module