SHOGUN  3.2.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MulticlassOneVsRestStrategy.h
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or modify
3  * it under the terms of the GNU General Public License as published by
4  * the Free Software Foundation; either version 3 of the License, or
5  * (at your option) any later version.
6  *
7  * Written (W) 2012 Chiyuan Zhang
8  * Written (W) 2013 Shell Hu and Heiko Strathmann
9  * Copyright (C) 2012 Chiyuan Zhang
10  */
11 
12 #ifndef MULTICLASSONEVSRESTSTRATEGY_H__
13 #define MULTICLASSONEVSRESTSTRATEGY_H__
14 
15 #include <shogun/lib/config.h>
16 
18 
19 namespace shogun
20 {
21 
34 {
35 public:
38 
43 
46 
48  virtual void train_start(CMulticlassLabels *orig_labels, CBinaryLabels *train_labels)
49  {
50  CMulticlassStrategy::train_start(orig_labels, train_labels);
51  }
52 
54  virtual bool train_has_more()
55  {
56  return m_train_iter < m_num_classes;
57  }
58 
63 
67  virtual int32_t decide_label(SGVector<float64_t> outputs);
68 
73  virtual SGVector<index_t> decide_label_multiple_output(SGVector<float64_t> outputs, int32_t n_outputs);
74 
77  virtual int32_t get_num_machines()
78  {
79  return m_num_classes;
80  }
81 
83  virtual const char* get_name() const
84  {
85  return "MulticlassOneVsRestStrategy";
86  };
87 
91  virtual void rescale_outputs(SGVector<float64_t> outputs);
92 
99  virtual void rescale_outputs(SGVector<float64_t> outputs,
100  const SGVector<float64_t> As, const SGVector<float64_t> Bs);
101 
102 protected:
107 
114  const SGVector<float64_t> As, const SGVector<float64_t> Bs);
115 
116 };
117 
118 } // namespace shogun
119 
120 #endif /* end of include guard: MULTICLASSONEVSRESTSTRATEGY_H__ */
121 

SHOGUN Machine Learning Toolbox - Documentation