Skip to content

Commit

Permalink
fix test-label bug
Browse files Browse the repository at this point in the history
Summary: `Meter` didn't count golds for individual numbers any more when `falseNegativeLabels_` is false.

Reviewed By: EdouardGrave

Differential Revision: D21379435

fbshipit-source-id: b898c5d156727a0f001db5efbf72fd0bf6640efb
  • Loading branch information
Celebio authored and facebook-github-bot committed May 5, 2020
1 parent b96adbe commit b64e359
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/meter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ void Meter::log(
labelMetrics_[prediction.second].scoreVsTrue.emplace_back(score, gold);
}

if (falseNegativeLabels_) {
for (const auto& label : labels) {
labelMetrics_[label].gold++;
for (const auto& label : labels) {
labelMetrics_[label].gold++;
if (falseNegativeLabels_) {
if (!utils::containsSecond(predictions, label)) {
labelMetrics_[label].scoreVsTrue.emplace_back(falseNegativeScore, 1.0);
}
Expand Down

0 comments on commit b64e359

Please sign in to comment.