vis4d.eval.metrics.cls

Classification metrics.

Functions

accuracy(prediction, target[, top_k])

Calculate the accuracy of the prediction.

accuracy(prediction, target, top_k=1)[source]

Calculate the accuracy of the prediction.

Parameters:
  • prediction (ArrayLike) – Probabilities (or logits) of shape (N, C) or (C, ).

  • target (ArrayLikeInt) – Target of shape (N, ) or (1, ).

  • top_k (int, optional) – Top k accuracy. Defaults to 1.

Returns:

Accuracy of the prediction, in range [0, 1].

Return type:

float