Vowpal Wabbit
vowpalwabbit
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)
17
sd->
is_more_than_two_labels_observed
=
true
;
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);
shared_data::is_more_than_two_labels_observed
bool is_more_than_two_labels_observed
Definition:
global_data.h:170
shared_data
Definition:
global_data.h:133
count_label
void count_label(shared_data *sd, float l)
Definition:
best_constant.h:5
vw
Definition:
global_data.h:369
shared_data::first_observed_label
float first_observed_label
Definition:
global_data.h:171
vw.h
shared_data::second_observed_label
float second_observed_label
Definition:
global_data.h:172
get_best_constant
bool get_best_constant(vw &all, float &best_constant, float &best_constant_loss)
Definition:
best_constant.cc:3
Generated on Thu Apr 9 2020 14:45:24 for Vowpal Wabbit by
1.8.13