autofaiss.metrics package

Submodules

autofaiss.metrics.benchmark module

autofaiss.metrics.recalls module

function to compute different kind of recalls

autofaiss.metrics.recalls.one_recall_at_r(query, ground_truth, other_index, r_max=40, eval_item_ids=None)[source]

Compute an 1-recall@R array for each R in range [1, r_max]

Return type:

ndarray

autofaiss.metrics.recalls.one_recall_at_r_single(query, ground_truth, other_index, r_max=40, eval_item_ids=None)[source]

Compute an 1-recall@R array for each R in range [1, r_max] for a single query.

Return type:

List[int]

autofaiss.metrics.recalls.r_recall_at_r(query, ground_truth, other_index, r_max=40, eval_item_ids=None)[source]

Compute an R-recall@R array for each R in range [1, R_max] for a single query.

Return type:

ndarray

autofaiss.metrics.recalls.r_recall_at_r_single(query, ground_truth, other_index, r_max=40, eval_item_ids=None)[source]

Compute an R-recall@R array for each R in range [1, R_max]

Return type:

List[int]

autofaiss.metrics.reconstruction module

function to compute the reconstruction error

autofaiss.metrics.reconstruction.quantize_vec_without_modifying_index(index, vecs)[source]

Quantizes a batch of vectors if the index given uses quantization

Return type:

ndarray

autofaiss.metrics.reconstruction.reconstruction_error(before, after, avg_norm_before=None)[source]

Computes the average reconstruction error

Return type:

float

Module contents