Vowpal Wabbit
cb.h
Go to the documentation of this file.
1 /*
2 Copyright (c) by respective owners including Yahoo!, Microsoft, and
3 individual contributors. All rights reserved. Released under a BSD
4 license as described in the file LICENSE.
5  */
6 #pragma once
7 
8 #include "label_parser.h"
9 #include <vector>
10 
11 struct example;
12 
13 namespace CB
14 {
15 struct cb_class
16 {
17  float cost; // the cost of this class
18  uint32_t action; // the index of this class
19  float probability; // new for bandit setting, specifies the probability the data collection policy chose this class
20  // for importance weighting
21  float partial_prediction; // essentially a return value
22  bool operator==(cb_class j) { return action == j.action; }
23 };
24 
25 struct label
26 {
28  float weight;
29 };
30 
31 extern label_parser cb_label; // for learning
32 bool ec_is_example_header(example const& ec); // example headers look like "shared"
33 
34 void print_update(vw& all, bool is_test, example& ec, std::vector<example*>* ec_seq, bool action_scores);
35 } // namespace CB
36 
37 namespace CB_EVAL
38 {
39 struct label
40 {
41  uint32_t action;
43 };
44 
45 extern label_parser cb_eval; // for evaluation of an arbitrary policy.
46 } // namespace CB_EVAL
label_parser cb_eval
Definition: cb.cc:292
bool ec_is_example_header(example const &ec)
Definition: cb.cc:170
float weight
Definition: cb.h:28
bool operator==(cb_class j)
Definition: cb.h:22
v_array< action_score > action_scores
Definition: action_score.h:10
v_array< cb_class > costs
Definition: cb.h:27
uint32_t action
Definition: cb.h:41
CB::label event
Definition: cb.h:42
void print_update(vw &all, bool is_test, example &ec, multi_ex *ec_seq, bool action_scores)
Definition: cb.cc:180
Definition: cb.cc:15
uint32_t action
Definition: cb.h:18
float partial_prediction
Definition: cb.h:21
float probability
Definition: cb.h:19
label_parser cb_label
Definition: cb.cc:167
Definition: cb.h:25
float cost
Definition: cb.h:17
Definition: cb.cc:219