SHOGUN  v2.0.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MulticlassStrategy.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  * Copyright (C) 2012 Chiyuan Zhang
9  */
10 
11 #ifndef MULTICLASSSTRATEGY_H__
12 #define MULTICLASSSTRATEGY_H__
13 
14 #include <shogun/base/SGObject.h>
18 
19 namespace shogun
20 {
21 
26 {
27 public:
30 
32  virtual ~CMulticlassStrategy() {}
33 
35  virtual const char* get_name() const
36  {
37  return "MulticlassStrategy";
38  };
39 
41  void set_num_classes(int32_t num_classes)
42  {
43  m_num_classes = num_classes;
44  }
45 
47  int32_t get_num_classes() const
48  {
49  return m_num_classes;
50  }
51 
54  {
56  return m_rejection_strategy;
57  }
58 
60  void set_rejection_strategy(CRejectionStrategy *rejection_strategy)
61  {
62  SG_REF(rejection_strategy);
64  m_rejection_strategy = rejection_strategy;
65  }
66 
68  virtual void train_start(CMulticlassLabels *orig_labels, CBinaryLabels *train_labels);
69 
71  virtual bool train_has_more()=0;
72 
77 
79  virtual void train_stop();
80 
84  virtual int32_t decide_label(SGVector<float64_t> outputs)=0;
85 
91  {
93  return SGVector<index_t>();
94  }
95 
98  virtual int32_t get_num_machines()=0;
99 
100 protected:
101 
105  int32_t m_train_iter;
106  int32_t m_num_classes;
107 };
108 
109 } // namespace shogun
110 
111 #endif /* end of include guard: MULTICLASSSTRATEGY_H__ */
112 

SHOGUN Machine Learning Toolbox - Documentation