eval_average_precision(label, score)
Calculate Average Precision score for binary classification.
| Parameters: |
|
|---|
| Returns: |
|
|---|
Notes
Processing Steps:
- Convert tensors to numpy arrays
- Calculate average precision using scikit-learn
- Handle binary classification scenario
Features:
- CPU computation
- Outlier detection focus
- Balanced metric
eval_macro_f1(label, pred)
Calculate Macro-F1 score for multi-class classification.
| Parameters: |
|
|---|
| Returns: |
|
|---|
Notes
Processing Steps:
- Convert tensors to numpy arrays
- Calculate macro-averaged F1 score
- Handle multi-class scenario
Features:
- CPU computation
- Class-weighted averaging
- Multi-class support
eval_micro_f1(label, pred)
Calculate Micro-F1 score for multi-class classification.
| Parameters: |
|
|---|
| Returns: |
|
|---|
Notes
Processing Steps:
- Convert tensors to numpy arrays
- Calculate micro-averaged F1 score
- Handle multi-class scenario
Features:
- CPU computation
- Instance-weighted averaging
- Multi-class support
eval_precision_at_k(label, score, k=None)
Calculate Precision@K metric for top-k predictions.
| Parameters: |
|
|---|
| Returns: |
|
|---|
Notes
Processing Steps:
- Determine k value (if not provided)
- Get top-k scoring instances
- Calculate precision as (true positives) / k
Features:
- Flexible k selection
- Efficient top-k computation
- Normalized metric
eval_recall_at_k(label, score, k=None)
Calculate Recall@K metric for top-k predictions.
| Parameters: |
|
|---|
| Returns: |
|
|---|
Notes
Processing Steps:
- Determine k value (if not provided)
- Get top-k scoring instances
- Calculate recall as (true positives) / (total positives)
Features:
- Flexible k selection
- Efficient top-k computation
- Normalized metric
eval_roc_auc(label, score)
Calculate ROC-AUC score for binary classification.
| Parameters: |
|
|---|
| Returns: |
|
|---|
Notes
Processing Steps:
- Convert tensors to numpy arrays
- Calculate standard ROC-AUC
- Adjust scores < 0.5 to their complement
Features:
- CPU computation
- Score normalization
- Binary classification focus