Skip to content

Include recall computation #66

@johnarevalo

Description

@johnarevalo

@shntnu as per our discussion.

An starting point could be this function:

def average_precision(rel_k) -> np.ndarray:
"""Compute average precision based on binary list sorted by relevance"""
tp = np.cumsum(rel_k, axis=1)
num_pos = tp[:, -1]
k = np.arange(1, rel_k.shape[1] + 1)
pr_k = tp / k
ap = (pr_k * rel_k).sum(axis=1) / num_pos
return ap

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions