QueryEvaluation#

class scikitplot.corpus.QueryEvaluation(query_id, metrics, n_retrieved, n_relevant, latency_s, status=None, retrieved=None)[source]#

One query of a RetrievalEvaluation.

Parameters:
query_idstr or int

Query identifier.

metricsmapping

Metric name to value; NaN when undefined under zero_division=np.nan.

n_retrievedint

Ranking length after duplicate handling.

n_relevantint

Relevant identifiers in the judgments.

latency_sfloat

Seconds to obtain the ranking: the retriever call and the consumption of its results (a lazy retriever does its work while they are read).

statusstr or None, default=None

Response status ("success", "empty", "degraded" …), or None when the retriever returned none.

retrievedtuple or None, default=None

The ranking, when kept.

Parameters:
classmethod from_dict(data)[source]#

Rebuild from to_dict output (None metric values are NaN).

Raises:
KeyError

If a required field is missing.

Parameters:

data (Mapping[str, Any])

Return type:

QueryEvaluation

latency_s: float[source]#
metrics: Mapping[str, float][source]#
n_relevant: int[source]#
n_retrieved: int[source]#
query_id: Any[source]#
retrieved: tuple | None = None#
status: str | None = None#
to_dict()[source]#

Return a mapping in the report schema.

Return type:

dict[str, Any]