nicetoolbox.evaluation.metrics.categorical

Categorical metrics for classification tasks, including accuracy, precision, recall, and F1 score.

Classes

Accuracy

Calculate the accuracy for binary classification.

CategoricalMetric

Handler for all categorical metrics.

F1Score

Calculate the F1 score for binary classification.

Precision

Calculate the precision for binary classification.

Recall

Calculate the recall for binary classification.

class nicetoolbox.evaluation.metrics.categorical.Accuracy[source]

Calculate the accuracy for binary classification.

Returns:

Dictionary with key (component, algorithm, person, camera, “accuracy”) and the corresponding aggregated accuracy value.

Return type:

Dict[Tuple[str, str, str, str, str], MetricReturnType]

Initializes the metric. Subclasses can use kwargs for specific setup.

compute() Dict[Tuple[str, str, str, str, str], List[BatchResult] | AggregatedResult][source]

Compute the final metric from the stored state and return as a dictionary.

class nicetoolbox.evaluation.metrics.categorical.CategoricalMetric(cfg: EvaluationMetricType, device: str)[source]

Handler for all categorical metrics.

Initialize the metric handler with its config and device, creating its metrics.

Parameters:
  • cfg (MetricTypeConfig) – Configuration for this metric type.

  • device (str) – Device to run the metrics on (e.g., ‘cpu’ or ‘cuda’).

property name: str

The name of the metric handler (e.g., ‘point_cloud_metrics’).

class nicetoolbox.evaluation.metrics.categorical.F1Score[source]

Calculate the F1 score for binary classification.

Returns:

Dictionary with key (component, algorithm, person, camera, “f1_score”) and the corresponding aggregated F1 score value.

Return type:

Dict[Tuple[str, str, str, str, str], MetricReturnType]

Initializes the metric. Subclasses can use kwargs for specific setup.

compute() Dict[Tuple[str, str, str, str, str], List[BatchResult] | AggregatedResult][source]

Compute the final metric from the stored state and return as a dictionary.

class nicetoolbox.evaluation.metrics.categorical.Precision[source]

Calculate the precision for binary classification.

Returns:

Dictionary with key (component, algorithm, person, camera, “precision”) and the corresponding aggregated precision value.

Return type:

Dict[Tuple[str, str, str, str, str], MetricReturnType]

Initializes the metric. Subclasses can use kwargs for specific setup.

compute() Dict[Tuple[str, str, str, str, str], List[BatchResult] | AggregatedResult][source]

Compute the final metric from the stored state and return as a dictionary.

class nicetoolbox.evaluation.metrics.categorical.Recall[source]

Calculate the recall for binary classification.

Returns:

Dictionary with key (component, algorithm, person, camera, “recall”) and the corresponding aggregated recall value.

Return type:

Dict[Tuple[str, str, str, str, str], MetricReturnType]

Initializes the metric. Subclasses can use kwargs for specific setup.

compute() Dict[Tuple[str, str, str, str, str], List[BatchResult] | AggregatedResult][source]

Compute the final metric from the stored state and return as a dictionary.