prc.mli 1.74 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85
(**

References:
   - The binormal assumption on precision-recall curves,
     Kay H. Brodersen, Cheng Soon Ong, Klaas E. Stephan and Joachim M. Buhmann

   - Area Under the Precision-Recall Curve: Point Estimates and Confidence Intervals,
     Kendrick Boyd, Kevin H. Eng and C. David Page
 *)
type evaluation_data = Evaluation_data of (float * bool) list

val evaluation_data :
  float option array ->
  bool array ->
  (evaluation_data, [> `Msg of string]) result

type curve = {
  x : float array ;
  y : float array ;
  col : string option ;
  lwd : int option ;
  label : string option ;
}

val empirical_curve :
  ?col:string ->
  ?label:string ->
  ?lwd:int ->
  evaluation_data ->
  curve

(** Binormal model *)

type binormal_params = {
  mu_pos : float ;
  sigma_pos : float ;
  mu_neg : float ;
  sigma_neg : float ;
  alpha : float ;
}

val binormal_params :
  ?mu_pos:float ->
  ?sigma_pos:float ->
  ?mu_neg:float ->
  ?sigma_neg:float ->
  float ->
  binormal_params

val binormal_simulation :
  Gsl.Rng.t ->
  n:int ->
  binormal_params ->
  evaluation_data

val binormal_curve :
  ?n:int ->
  ?col:string ->
  ?lwd:int ->
  ?label:string ->
  binormal_params ->
  curve

val binormal_estimate : evaluation_data -> binormal_params

val auc_binormal : binormal_params -> float

val auc_trapezoidal_lt : evaluation_data -> float

val auc_average_precision : evaluation_data -> float

val logit_confidence_interval :
  alpha:float ->
  theta_hat:float ->
  n:int ->
  float * float
(** [logit_confidence_interval ~alpha ~theta_hat ~n] computes an
   asymptotically valid confidence interval at level 1 - [alpha], when
   the estimate [theta_hat] was obtained from a sample of [n]
   observations. *)

val recall_precision_plot :
  ?main:string ->
  curve list ->
  unit