1 #pragma once 2 #include <float.h> 3 #include "vw.h" 4 5 extern bool is_more_than_two_labels_observed; 6 extern float first_observed_label; 7 extern float second_observed_label; 8 count_label(float l)9inline void count_label(float l) 10 { 11 if (is_more_than_two_labels_observed || l == FLT_MAX) return; 12 13 if (first_observed_label != FLT_MAX) 14 { 15 16 if (first_observed_label != l) 17 { 18 if (second_observed_label != FLT_MAX) 19 { 20 if (second_observed_label != l) 21 is_more_than_two_labels_observed = true; 22 23 } else second_observed_label = l; 24 } 25 26 } else first_observed_label = l; 27 28 } 29 30 bool get_best_constant(vw& all, float& best_constant, float& best_constant_loss); 31