Modelkit.Multiclass_rankingRanking metrics over class-probability matrices.
One-versus-rest ROC AUC scores every class column against its indicator; Macro averages classes equally, Weighted by weighted truth support, and Micro pools every row-class indicator into one binary curve. One-versus-one ROC AUC averages, over every pair of classes with positive weighted support in ascending order, the mean of the two directional AUCs on the rows belonging to that pair; Weighted uses the pair's weighted prevalence, and Micro is a typed validation error. A class without weighted support follows the undefined policy with a fallback of 0.5. scikit-learn refuses sample weights for one-versus-one AUC; ModelKit applies them to both the pairwise curves and the prevalences.
Top-k accuracy counts a row as a hit when fewer than k other classes outrank the truth class, with exact ties broken toward the higher column index as scikit-learn does. k must lie in [1, classes). One-versus-rest costs O(classes * n log n); one-versus-one costs O(classes squared * n log n); top-k costs O(n * classes).
val roc_auc :
?strategy:strategy ->
?average:Multiclass_classification_metrics.average ->
?undefined:Undefined_metric_policy.t ->
?sample_weight:Sample_weight.t ->
truth:Target.classification Target.t ->
classes:int array ->
probabilities:Matrix.t ->
unit ->
(float, Error.t) resultval top_k_accuracy :
k:int ->
?sample_weight:Sample_weight.t ->
truth:Target.classification Target.t ->
classes:int array ->
probabilities:Matrix.t ->
unit ->
(float, Error.t) result