Recall Computation
Documentation for computing the k recall at n metric.
-
template<typename Groundtruth, typename Results>
double k_recall_at_n(const Groundtruth &groundtruth, const Results &results, size_t k = 0, size_t n = 0) Compute the
k-recall@nforresultswith respect togroundtruthComputes and returns the average of the
kactual nearest neighbors found in the groundtruth with thentop entries inresults.If the parameters
kandnare left off, this defaults to computing then-recall@nwheren == results.dimensions().Preconditions:
groundtruth.size() == results.size(). Same number of groundtruth elements as result elements.k <= groundtruth.dimensions(). Ifk == 0, thenresults.dimensions() <= groundtruth.dimensions().n <= results.dimensions().k <= n.
- Parameters:
groundtruth – The groundtruth of nearest neighbors.
results – The actual computed results.
k – The number of groundtruth neighbors to consider (optional). Defaults to
results.dimensions().n – The number of results to consider (optional). Defaults to
results.dimensions().
- Returns:
The average
k-recall@nfor all entries pairwise matchings ingroundtruthandresults.
Argument Conversion
-
template<data::ImmutableMemoryDataset Data>
const Data &recall_convert(const Data &x) Placeholder for conversion to a
svs::data::ImmutableMemoryDataset.Classes already implementing
svs::data::ImmutableMemoryDatasetare passed through by default unless a more specialized overload exists.The element types of the values inside the dataset must be integers. Otherwise, a compile-time exception will be thrown.
-
template<std::integral T, typename Dims, typename Base>
data::ConstSimpleDataView<T> recall_convert(const DenseArray<T, Dims, Base> &x) Create a
data::ConstSimpleDataViewaliasing the contents of matrixx.- Parameters:
x – The matrix to alias.
- Returns:
A
data::ConstSimpleDataViewaliasing the memory owned byx.