MetricKnn API
Fast Similarity Search using the Metric Space Approach
mevaluation_groundtruth.hpp
1 /*
2  * Copyright (C) 2012-2015, Juan Manuel Barrios <juanmanuel@barrios.cl>
3  * All rights reserved.
4  *
5  * This file is part of P-VCD. https://github.com/juanbarrios/p-vcd
6  * P-VCD is made available under the terms of the BSD 2-Clause License.
7  */
8 
9 #ifndef MKNN_EVALUATION_GROUND_TRUTH_HPP
10 #define MKNN_EVALUATION_GROUND_TRUTH_HPP
11 
12 #include <map>
13 #include <string>
14 #include <set>
15 #include <vector>
16 #include "../metricknn_impl.hpp"
17 
18 namespace mknn {
19 template<typename TypeQuery, typename TypeCategory, typename TypeObject> class MknnGroundTruth {
20 public:
22  ~MknnGroundTruth();
23  void addCorrectAnswer(TypeQuery id_query, TypeCategory id_category);
24  void addCategoryObject(TypeCategory id_category, TypeObject id_object);
25  long long getTotalQueries();
26  long long getTotalCategories();
27  long long getTotalObjects();
28  void getCategoriesQuery(TypeQuery id_query,
29  std::set<TypeCategory> &list_id_categories);
30  void getCategoriesObject(TypeObject id_object,
31  std::set<TypeCategory> &list_id_categories);
32  void getObjectsCategory(TypeCategory id_category,
33  std::set<TypeObject> &list_id_object);
34  void getQueriesCategory(TypeCategory id_category,
35  std::set<TypeQuery> &list_id_queries);
36  std::set<TypeCategory> getCategories();
37 
38 private:
39  std::map<TypeQuery, std::set<TypeCategory>> list_categories_by_query;
40  std::map<TypeCategory, std::set<TypeObject>> list_objects_by_category;
41  std::map<TypeQuery, std::set<TypeObject>> list_queries_by_category;
42  std::map<TypeObject, std::set<TypeCategory>> list_categories_by_object;
43 };
44 
46 }
47 #endif
Definition: mevaluation_answers.hpp:18
Definition: mevaluation_groundtruth.hpp:19
Powered by Download MetricKnn