Skip to content

Commit

Permalink
Merge 0fe2b46 into fa5c3df
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnLangford committed Jun 4, 2019
2 parents fa5c3df + 0fe2b46 commit 413ec95
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions vowpalwabbit/confidence.cc
Expand Up @@ -16,9 +16,21 @@ void predict_or_learn_with_confidence(confidence& /* c */, single_learner& base,
{
float threshold = 0.f;
float sensitivity = 0.f;

float existing_label = ec.l.simple.label;
if (existing_label == FLT_MAX)
{
base.predict(ec);
float opposite_label = 1.f;
if (ec.pred.scalar > 0)
opposite_label = -1.f;
ec.l.simple.label = opposite_label;
}

if (!is_confidence_after_training)
sensitivity = base.sensitivity(ec);

ec.l.simple.label = existing_label;
if (is_learn)
base.learn(ec);
else
Expand Down

0 comments on commit 413ec95

Please sign in to comment.