scorebook.utils.mappers
Utility functions for mapping and converting data types in Scorebook.
to_binary
def to_binary(value: Any) -> int
Transform various input types to binary (0/1) classification value.
to_binary_classification
def to_binary_classification(prediction: Any,
reference: Any) -> ClassificationResult
Determine classification result based on prediction and reference values.
Arguments:
prediction
- Predicted value (will be converted to binary)reference
- Reference/true value (will be converted to binary)
Returns:
Classification result as one of: "true_positive", "false_positive", "true_negative", "false_negative"