diff options
author | John Langford <jl@hunch.net> | 2014-04-23 02:50:14 +0400 |
---|---|---|
committer | John Langford <jl@hunch.net> | 2014-04-23 02:50:14 +0400 |
commit | 8e652a9b5b59f723f32f98cf3c078e1b5ee8676c (patch) | |
tree | 33d629cddeced544410792c18a7321145deb128d /vowpalwabbit/multiclass.h | |
parent | 0e7a0da366d46f4acb4e051f7fcbf73dea9f5efb (diff) |
refactor problem types a bit
Diffstat (limited to 'vowpalwabbit/multiclass.h')
-rw-r--r-- | vowpalwabbit/multiclass.h | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/vowpalwabbit/multiclass.h b/vowpalwabbit/multiclass.h index 25995ce9..67fab367 100644 --- a/vowpalwabbit/multiclass.h +++ b/vowpalwabbit/multiclass.h @@ -13,30 +13,20 @@ license as described in the file LICENSE. namespace MULTICLASS { - struct mc_label { + struct multiclass { uint32_t label; float weight; }; - size_t read_cached_label(shared_data*, void* v, io_buf& cache); - void cache_label(void* v, io_buf& cache); - void default_label(void* v); - void parse_label(parser* p, shared_data*, void* v, v_array<substring>& words); - void delete_label(void* v); - float weight(void* v); - const label_parser mc_label_parser = {default_label, parse_label, - cache_label, read_cached_label, - delete_label, weight, - NULL, - sizeof(mc_label)}; + extern label_parser mc_label; void output_example(vw& all, example& ec); - inline int label_is_test(mc_label* ld) + inline int label_is_test(multiclass* ld) { return ld->label == (uint32_t)-1; } inline int example_is_test(example* ec) - { return label_is_test((mc_label*)ec->ld); } + { return label_is_test((multiclass*)ec->ld); } } |