# mmcls.core.mAP¶

mmcls.core.mAP(pred, target)[source]

Calculate the mean average precision with respect of classes.

Parameters
• pred (torch.Tensor | np.ndarray) – The model prediction with shape (N, C), where C is the number of classes.

• target (torch.Tensor | np.ndarray) – The target of each prediction with shape (N, C), where C is the number of classes. 1 stands for positive examples, 0 stands for negative examples and -1 stands for difficult examples.

Returns

A single float as mAP value.

Return type

float