jina.executors.evaluators.rank.precision

class jina.executors.evaluators.rank.precision.PrecisionEvaluator(eval_at=None, *args, **kwargs)[source]

Bases: jina.executors.evaluators.rank.BaseRankingEvaluator

A PrecisionEvaluator evaluates the Precision of the search. It computes how many of the first given eval_at matches are found in the groundtruth

” :type eval_at: Optional[int] :param eval_at: the point at which evaluation is computed, if None give, will consider all the input to evaluate

evaluate(actual, desired, *args, **kwargs)[source]

” :type actual: Sequence[Any] :param actual: the matched document identifiers from the request as matched by jina indexers and rankers :type desired: Sequence[Any] :param desired: the expected documents matches ids sorted as they are expected :return the evaluation metric value for the request document

Return type

float