"""Stub file for metrics directory."""
from typing import Any

# Functions
# From classification
def accuracy_per_class(output: Any.Any, target: Any.Any) -> dict[int, float]:
    """
    Compute per-class one-vs-rest accuracy.
    """
    ...

# From classification
def calculate_metrics(output: Any.Any, target: Any.Any) -> tuple[Any.Any, Any.Any, Any.Any, Any.Any]:
    """
    Compute one-vs-rest TP/TN/FP/FN vectors for each class.
    """
    ...

# From classification
def confusion_matrix(output: Any.Any, target: Any.Any) -> Any.Any:
    """
    Return full multiclass confusion matrix with shape [C, C].
    """
    ...

# From classification
def confusion_matrix_per_class(output: Any.Any, target: Any.Any) -> dict[int, list[list[float]]]:
    """
    Return one-vs-rest confusion matrix for each class.
    """
    ...

# From classification
def f1_score_per_class(output: Any.Any, target: Any.Any) -> dict[int, float]:
    """
    Compute per-class F1-score.
    """
    ...

# From classification
def precision(output: Any.Any, target: Any.Any) -> dict[int, float]:
    """
    Compute per-class precision.
    """
    ...

# From classification
def recall(output: Any.Any, target: Any.Any) -> dict[int, float]:
    """
    Compute per-class recall.
    """
    ...

# From classification
def specificity(output: Any.Any, target: Any.Any) -> dict[int, float]:
    """
    Compute per-class specificity (true negative rate).
    """
    ...

# From classification
def specificity_all(output: Any.Any, target: Any.Any) -> float:
    """
    Compute overall specificity across all classes.
    """
    ...

# From common
def accuracy(output: Any.Any, target: Any.Any, topk: Any[int] = (1,)) -> list[Any.Any]:
    """
    Compute top-k accuracy values for logits and labels.
    
        Returns the same shape contract as legacy BYOM code: a list of scalar tensors
        where each value is in [0, 1].
    """
    ...

# From common
def calculate_metrics_for_all_classes(predictions: Any.Any, target: Any.Any) -> tuple[float, float, float]:
    """
    Compute macro precision/recall/F1 from predicted and true class indices.
    """
    ...

# From detection
def box_iou(boxes1: Any.Any, boxes2: Any.Any) -> Any.Any:
    """
    Compute IoU matrix for `xyxy` boxes with shapes [N, 4] and [M, 4].
    """
    ...

# From detection
def compute_map_metrics(outputs: Any[Any[str, Any]], targets: Any[Any[str, Any]], num_classes: int, iou_thresholds: Any[float] = (0.5, 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95), background_class: int | None = 0) -> tuple[float, float, dict[int, float]]:
    """
    Compute mAP@50, mAP@50-95 and per-class AP@50.
    """
    ...

# From detection
def compute_metrics(outputs: Any[Any[str, Any]], targets: Any[Any[str, Any]], num_classes: int, iou_threshold: float = 0.5, background_class: int | None = 0) -> tuple[Any.Any, Any.Any, Any.Any]:
    """
    Compute per-class precision, recall and F1-score for detection outputs.
    """
    ...

# From detection
def epoch_metrics(data_loader: Any[tuple[Any[Any.Any], Any[Any[str, Any]]]], model: Any.Any.Any, device: Any.Any, num_classes: int, iou_threshold: float = 0.5, background_class: int | None = 0) -> Any[str, float]:
    """
    Run model inference for one epoch and aggregate detection metrics.
    """
    ...

from . import classification, common, detection