package biocaml

  1. Overview
  2. Docs
The OCaml Bioinformatics Library

Install

Dune Dependency

Authors

Maintainers

Sources

v0.11.1.tar.gz
md5=e292efa2f61fec33dad63ec897106f59
sha512=35519bf3b1e67a9191ef9bb74eba0dae941e0d05bad89076a36f507dc5c2d105a03c1c917d5a3f7ed9d1da4acbf3199582f78c308aa2a5a22c21f743945c852b

doc/biocaml.unix/Biocaml_unix/Bin_pred/index.html

Module Biocaml_unix.Bin_predSource

Performance measurement of binary classifiers.

This module provides functions to compute various performance measurements of a binary classifier's prediction. Typically, binary classifiers output both a label and a score indicating a confidence level. A ROC curve represents the variation of sensitivity and specificity of the classifier as a function of a score threshold.

Sourcetype confusion_matrix = private {
  1. tp : int;
  2. tn : int;
  3. fp : int;
  4. fn : int;
}
Sourceval confusion_matrix : scores:float array -> labels:bool array -> threshold:float -> confusion_matrix

confusion_matrix ~scores ~labels ~threshold computes a confusion matrix from the classifier scores and example labels, based on a threshold. It assumes that example i has score scores.(i) and label labels.(i), that scores and labels have the same length and that a higher score means increased probability of a true label.

Sourceval positive : confusion_matrix -> int
Sourceval negative : confusion_matrix -> int
Sourceval cardinal : confusion_matrix -> int
Sourceval sensitivity : confusion_matrix -> float
Sourceval recall : confusion_matrix -> float

same as sensitivity

Sourceval false_positive_rate : confusion_matrix -> float
Sourceval accuracy : confusion_matrix -> float
Sourceval specificity : confusion_matrix -> float
Sourceval positive_predictive_value : confusion_matrix -> float
Sourceval precision : confusion_matrix -> float

same as positive_predictive_value

Sourceval negative_predictive_value : confusion_matrix -> float
Sourceval false_discovery_rate : confusion_matrix -> float
Sourceval f1_score : confusion_matrix -> float
Sourceval performance_curve : scores:float array -> labels:bool array -> (float * confusion_matrix) array

performance_curve ~scores ~labels returns the series of confusion matrices obtained by varying the threshold from infinity to neg_infinity. Each confusion matrix comes with the corresponding threshold.

Sourceval roc_curve : scores:float array -> labels:bool array -> (float * float) array * float

roc_curve ~scores ~labels returns the ROC curve of the prediction, and the associated Area Under Curve (AUC)

Sourceval recall_precision_curve : scores:float array -> labels:bool array -> (float * float) array * float

recall_precision_curve ~scores ~labels returns the RP curve of the prediction, and the associated average precision

OCaml

Innovation. Community. Security.