Overview
The metrics module provides functions for calculating performance tradeoffs between different model characteristics.Functions
latency_accuracy_tradeoff
Calculates the tradeoff ratio between accuracy and latency.The accuracy value (typically between 0 and 1)
The latency in milliseconds
The tradeoff ratio calculated as accuracy divided by latency. A higher value indicates better performance (higher accuracy with lower latency).
- Uses a minimum latency threshold of 1e-6 to prevent division by zero
- Returns accuracy / max(latency_ms, 1e-6)