9 #ifndef MKNN_EVALUATION_WRAPPER_H
10 #define MKNN_EVALUATION_WRAPPER_H
12 #include "../metricknn_impl.h"
14 typedef struct MknnGroundTruth_s MknnGroundTruth_s;
15 typedef struct MknnAnswers_s MknnAnswers_s;
16 typedef struct MknnEvaluation_s MknnEvaluation_s;
18 MknnGroundTruth_s *mknn_evaluation_gt_newGroundTruth_s();
20 void mknn_evaluation_gt_releaseGroundTruth_s(MknnGroundTruth_s *mgt);
22 void mknn_evaluation_gt_addCorrectAnswer_s(MknnGroundTruth_s *mgt,
23 const char* id_query,
const char* id_category);
25 void mknn_evaluation_gt_addCategoryObject_s(MknnGroundTruth_s *mgt,
26 const char* id_category,
const char* id_object);
28 int64_t mknn_evaluation_gt_getTotalQueries_s(MknnGroundTruth_s *mgt);
30 int64_t mknn_evaluation_gt_getTotalCategories_s(MknnGroundTruth_s *mgt);
32 int64_t mknn_evaluation_gt_getTotalObjects_s(MknnGroundTruth_s *mgt);
34 void mknn_evaluation_gt_getCategoriesQuery_s(MknnGroundTruth_s *mgt,
35 const char* id_query, MyVectorString *list_id_categories);
37 void mknn_evaluation_gt_getCategoriesObject_s(MknnGroundTruth_s *mgt,
38 const char* id_object, MyVectorString *list_id_categories);
40 void mknn_evaluation_gt_getObjectsCategory_s(MknnGroundTruth_s *mgt,
41 const char* id_category, MyVectorString *list_id_objects);
43 MknnAnswers_s *mknn_evaluation_ans_newAnswers_s();
45 void mknn_evaluation_ans_releaseAnswers_s(MknnAnswers_s *ans);
47 void mknn_evaluation_ans_addAnswer_s(MknnAnswers_s *ans,
const char* id_query,
48 const char* id_answer,
long long rank_answer);
50 MknnEvaluation_s *mknn_evaluation_newEvaluation_s(MknnGroundTruth_s *mgt);
52 void mknn_evaluation_releaseEvaluation_s(MknnEvaluation_s *mev);
54 void mknn_evaluation_evaluate_s(MknnEvaluation_s *mev, MknnAnswers_s *mans,
bool with_details);
56 double mknn_evaluation_getMAP_s(MknnEvaluation_s *mev);
58 void mknn_evaluation_print_s(MknnEvaluation_s *mev,
const char *filename_output,
const char *file_header_text);