From 173b1131c24d985002c97891bf971de727033e47 Mon Sep 17 00:00:00 2001 From: Franck Dary <franck.dary@etu.univ-amu.fr> Date: Mon, 3 Dec 2018 14:13:18 +0100 Subject: [PATCH] corrected eval error --- .../src/macaon_train_error_detector.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/error_correction/src/macaon_train_error_detector.cpp b/error_correction/src/macaon_train_error_detector.cpp index 8238cc1..2270820 100644 --- a/error_correction/src/macaon_train_error_detector.cpp +++ b/error_correction/src/macaon_train_error_detector.cpp @@ -253,17 +253,20 @@ std::map<std::string, std::pair<float, std::pair<float, float> > > getScoreOnDev } fprintf(stderr, "Class 0 nbExemples : %d\n", pred0Hyp0+pred1Hyp0); - fprintf(stderr, "Class 0 precision : %.2f\n", 100.0*pred0Hyp0 / (pred0Hyp0+pred1Hyp0)); - fprintf(stderr, "Class 0 recall : %.2f\n\n", 100.0*pred0Hyp0 / (pred0Hyp0+pred0Hyp1)); + fprintf(stderr, "Class 0 precision : %.2f%%\n", 100.0*pred0Hyp0 / (pred0Hyp0+pred0Hyp1)); + fprintf(stderr, "Class 0 recall : %.2f%%\n\n", 100.0*pred0Hyp0 / (pred0Hyp0+pred1Hyp0)); fprintf(stderr, "Class 1 nbExemples : %d\n", pred0Hyp1+pred1Hyp1); - fprintf(stderr, "Class 1 precision : %.2f\n", 100.0*pred1Hyp1 / (pred1Hyp1+pred0Hyp1)); - fprintf(stderr, "Class 1 recall : %.2f\n", 100.0*pred1Hyp1 / (pred1Hyp1+pred1Hyp0)); + fprintf(stderr, "Class 1 precision : %.2f%%\n", 100.0*pred1Hyp1 / (pred1Hyp1+pred1Hyp0)); + fprintf(stderr, "Class 1 recall : %.2f%%\n", 100.0*pred1Hyp1 / (pred1Hyp1+pred0Hyp1)); std::map<std::string, std::pair<float,std::pair<float,float> > > scores; for (auto & it : counts) - scores[it.first].first = 100.0 * it.second.second / it.second.first; + { + // scores[it.first].first = 100.0 * it.second.second / it.second.first; + scores[it.first].first = 100.0*pred1Hyp1 / (pred1Hyp1+pred1Hyp0); + } return scores; } -- GitLab