Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cost_sensitive.h « vowpalwabbit - github.com/moses-smt/vowpal_wabbit.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: f6934d4c5db121448acb15b30326cd9a2fbff3ab (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/*
Copyright (c) by respective owners including Yahoo!, Microsoft, and
individual contributors. All rights reserved.  Released under a BSD
license as described in the file LICENSE.
 */
#pragma once
#include "label_parser.h"

struct example;
struct vw;

namespace COST_SENSITIVE {
  struct wclass {
    float x;
    uint32_t class_index;
    float partial_prediction;  // a partial prediction: new!
    float wap_value;  // used for wap to store values derived from costs
    bool operator==(wclass j){return class_index == j.class_index;}
  };
/* if class_index > 0, then this this a "normal" example
   if class_index == 0, then:
     if x < 0 then this is a 'shared' example
     if x > 0 then this is a label feature vector for (size_t)x
*/

  struct label {
    v_array<wclass> costs;
    uint32_t prediction;
  };
  
  void output_example(vw& all, example& ec);
  extern label_parser cs_label;

  bool example_is_test(example& ec);

  void print_update(vw& all, bool is_test, example& ec, const v_array<example*> *ec_seq);
}

namespace CSOAA_AND_WAP_LDF {
  void global_print_newline(vw& all);
  void output_example(vw& all, example& ec, bool& hit_loss);
}