MetricKnn API
Fast Similarity Search using the Metric Space Approach
mevaluation_wrapper.h
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_WRAPPER_H
10 #define MKNN_EVALUATION_WRAPPER_H
11 
12 #include "../metricknn_impl.h"
13 
14 typedef struct MknnGroundTruth_s MknnGroundTruth_s;
15 typedef struct MknnAnswers_s MknnAnswers_s;
16 typedef struct MknnEvaluation_s MknnEvaluation_s;
17 
18 MknnGroundTruth_s *mknn_evaluation_gt_newGroundTruth_s();
19 
20 void mknn_evaluation_gt_releaseGroundTruth_s(MknnGroundTruth_s *mgt);
21 
22 void mknn_evaluation_gt_addCorrectAnswer_s(MknnGroundTruth_s *mgt,
23  const char* id_query, const char* id_category);
24 
25 void mknn_evaluation_gt_addCategoryObject_s(MknnGroundTruth_s *mgt,
26  const char* id_category, const char* id_object);
27 
28 int64_t mknn_evaluation_gt_getTotalQueries_s(MknnGroundTruth_s *mgt);
29 
30 int64_t mknn_evaluation_gt_getTotalCategories_s(MknnGroundTruth_s *mgt);
31 
32 int64_t mknn_evaluation_gt_getTotalObjects_s(MknnGroundTruth_s *mgt);
33 
34 void mknn_evaluation_gt_getCategoriesQuery_s(MknnGroundTruth_s *mgt,
35  const char* id_query, MyVectorString *list_id_categories);
36 
37 void mknn_evaluation_gt_getCategoriesObject_s(MknnGroundTruth_s *mgt,
38  const char* id_object, MyVectorString *list_id_categories);
39 
40 void mknn_evaluation_gt_getObjectsCategory_s(MknnGroundTruth_s *mgt,
41  const char* id_category, MyVectorString *list_id_objects);
42 
43 MknnAnswers_s *mknn_evaluation_ans_newAnswers_s();
44 
45 void mknn_evaluation_ans_releaseAnswers_s(MknnAnswers_s *ans);
46 
47 void mknn_evaluation_ans_addAnswer_s(MknnAnswers_s *ans, const char* id_query,
48  const char* id_answer, long long rank_answer);
49 
50 MknnEvaluation_s *mknn_evaluation_newEvaluation_s(MknnGroundTruth_s *mgt);
51 
52 void mknn_evaluation_releaseEvaluation_s(MknnEvaluation_s *mev);
53 
54 void mknn_evaluation_evaluate_s(MknnEvaluation_s *mev, MknnAnswers_s *mans, bool with_details);
55 
56 double mknn_evaluation_getMAP_s(MknnEvaluation_s *mev);
57 
58 void mknn_evaluation_print_s(MknnEvaluation_s *mev, const char *filename_output, const char *file_header_text);
59 
60 #endif
Powered by Download MetricKnn