Metrics
Definition of XML classification and L2R metrics
Extreme Multilabel Classification
precision_at_k
precision_at_k (yhat_raw, y, k=15)
Inputs: yhat_raw: activation matrix of ndarray and shape (n_samples, n_labels) y: binary ground truth matrix of type ndarray and shape (n_samples, n_labels) k: for @k metric
precision_at_r
precision_at_r (yhat_raw, y)
Inputs: yhat_raw: activation matrix of ndarray and shape (n_samples, n_labels) y: binary ground truth matrix of type ndarray and shape (n_samples, n_labels)
recall_at_k
recall_at_k (pred_probs, true_labels, k=15)
Learning to Rank
We want to compute a metric which measures how many orderings did the model get right:
batch_lbs_accuracy
batch_lbs_accuracy (preds, xb, len=1000, resamps=10, threshold=0.5)
accuracy
accuracy (xb, model)
NOTE: The following ndcg
only used on a batch:
ndcg
ndcg (preds, xb, k=None)
NOTE: The following ndcg_at_k
only used on the entite dataset:
ndcg_at_k
ndcg_at_k (dset, model, k=20)