Vowpal Wabbit
best_constant.h
Go to the documentation of this file.
1 #pragma once
2 #include <float.h>
3 #include "vw.h"
4 
5 inline void count_label(shared_data* sd, float l)
6 {
7  if (sd->is_more_than_two_labels_observed || l == FLT_MAX)
8  return;
9 
10  if (sd->first_observed_label != FLT_MAX)
11  {
12  if (sd->first_observed_label != l)
13  {
14  if (sd->second_observed_label != FLT_MAX)
15  {
16  if (sd->second_observed_label != l)
18  }
19  else
20  sd->second_observed_label = l;
21  }
22  }
23  else
24  sd->first_observed_label = l;
25 }
26 
27 bool get_best_constant(vw& all, float& best_constant, float& best_constant_loss);
bool is_more_than_two_labels_observed
Definition: global_data.h:170
void count_label(shared_data *sd, float l)
Definition: best_constant.h:5
float first_observed_label
Definition: global_data.h:171
float second_observed_label
Definition: global_data.h:172
bool get_best_constant(vw &all, float &best_constant, float &best_constant_loss)
Definition: best_constant.cc:3