SHOGUN  v3.0.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MulticlassOneVsOneStrategy.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 
13 
14 namespace shogun
15 {
16 
29 {
30 public:
33 
38 
41 
43  virtual void train_start(CMulticlassLabels *orig_labels, CBinaryLabels *train_labels);
44 
46  virtual bool train_has_more();
47 
52 
56  virtual int32_t decide_label(SGVector<float64_t> outputs);
57 
60  virtual int32_t get_num_machines()
61  {
62  return m_num_classes*(m_num_classes-1)/2;
63  }
64 
66  virtual const char* get_name() const
67  {
68  return "MulticlassOneVsOneStrategy";
69  };
70 
75  virtual void rescale_outputs(SGVector<float64_t> outputs);
76 
81  void set_num_classes(int32_t num_classes)
82  {
85  }
86 
87 protected:
94  const SGVector<int32_t> indx1, const SGVector<int32_t> indx2);
95 
102  const SGVector<int32_t> indx1, const SGVector<int32_t> indx2);
103 
110  const SGVector<int32_t> indx1, const SGVector<int32_t> indx2);
111 
112 private:
114  void register_parameters();
115 
116 protected:
117  int32_t m_num_machines;
121 };
122 
123 } // namespace shogun

SHOGUN Machine Learning Toolbox - Documentation