12 c +=
sizeof(ld->
label);
22 size_t total =
sizeof(ld->
label) +
sizeof(ld->
weight);
23 if (cache.
buf_read(c, total) < total)
39 c +=
sizeof(ld->
label);
56 ld->
label = (uint32_t)-1;
63 return ld->
label == (uint32_t)-1;
85 std::cerr <<
"malformed example!\n";
86 std::cerr <<
"words.size() = " << words.
size() << std::endl;
89 THROW(
"label 0 is not allowed for multiclass. Valid labels are {1,k}" 90 << (sd->
ldict ?
"\nthis likely happened because you specified an invalid label with named labels" :
""));
101 !ss_label.
begin ?
"unknown" : std::string(ss_label.
begin, ss_label.
end - ss_label.
begin),
108 std::stringstream pred_ss;
109 pred_ss << prediction <<
"(" << std::setw(2) << std::setprecision(0) << std::fixed
112 std::stringstream label_ss;
121 std::stringstream pred_ss;
122 pred_ss << prediction;
124 std::stringstream label_ss;
137 template <
void (*T)(vw&, example&, u
int32_t)>
143 T(all, ec, prediction);
151 print_update<print_probability>(all, ec, pred);
172 MULTICLASS::print_update<direct_print_update>(all, ec, ec.
pred.
multiclass);
int int_of_substring(substring s)
void delete_label(void *)
v_array< int > final_prediction_sink
char * bufcache_label(label_t *ld, char *c)
float loss(cbify &data, uint32_t label, uint32_t final_prediction)
void cache_label(void *v, io_buf &cache)
void print_update_with_probability(vw &all, example &ec, uint32_t pred)
void print_update_with_score(vw &all, example &ec, uint32_t pred)
MULTICLASS::label_t multi
char * bufread_label(label_t *ld, char *c)
float float_of_substring(substring s)
void print_label_pred(vw &all, example &ec, uint32_t prediction)
void print_update(bool holdout_set_off, size_t current_pass, float label, float prediction, size_t num_features, bool progress_add, float progress_arg)
void(* print_text)(int, std::string, v_array< char >)
void finish_example(vw &, example &)
void update(bool test_example, bool labeled_example, float loss, float weight, size_t num_features)
void print_score(vw &all, example &ec, uint32_t prediction)
void buf_write(char *&pointer, size_t n)
size_t read_cached_label(shared_data *, void *v, io_buf &cache)
void print_update(vw &all, example &ec, uint32_t prediction)
uint64_t get(substring &s)
void print_probability(vw &all, example &ec, uint32_t prediction)
void finish_example(vw &all, example &ec, bool update_loss)
void direct_print_update(vw &all, example &ec, uint32_t prediction)
double weighted_examples()
void(* print)(int, float, float, v_array< char >)
void default_label(void *v)
void parse_label(parser *, shared_data *sd, void *v, v_array< substring > &words)
size_t buf_read(char *&pointer, size_t n)