SHOGUN  5.0.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules
MulticlassTreeGuidedLogisticRegression.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 Sergey Lisitsyn
8  * Copyright (C) 2012 Sergey Lisitsyn
9  */
10 
11 #ifndef MULTICLASSTREEGUIDEDLOGISTICREGRESSION_H_
12 #define MULTICLASSTREEGUIDEDLOGISTICREGRESSION_H_
13 #include <shogun/lib/config.h>
14 #ifdef USE_GPL_SHOGUN
15 #include <shogun/lib/common.h>
19 
20 namespace shogun
21 {
22 
25 class CMulticlassTreeGuidedLogisticRegression : public CLinearMulticlassMachine
26 {
27  public:
29 
30 
31  CMulticlassTreeGuidedLogisticRegression();
32 
39  CMulticlassTreeGuidedLogisticRegression(float64_t z, CDotFeatures* feats, CLabels* labs, CIndexBlockTree* tree);
40 
42  virtual ~CMulticlassTreeGuidedLogisticRegression();
43 
45  virtual const char* get_name() const
46  {
47  return "MulticlassTreeGuidedLogisticRegression";
48  }
49 
53  inline void set_z(float64_t z)
54  {
55  ASSERT(z>0)
56  m_z = z;
57  }
61  inline float64_t get_z() const { return m_z; }
62 
66  inline void set_epsilon(float64_t epsilon)
67  {
68  ASSERT(epsilon>0)
69  m_epsilon = epsilon;
70  }
74  inline float64_t get_epsilon() const { return m_epsilon; }
75 
79  inline void set_max_iter(int32_t max_iter)
80  {
81  ASSERT(max_iter>0)
82  m_max_iter = max_iter;
83  }
87  inline int32_t get_max_iter() const { return m_max_iter; }
88 
92  inline void set_index_tree(CIndexBlockTree* index_tree)
93  {
94  SG_REF(index_tree);
95  SG_UNREF(m_index_tree);
96  m_index_tree = index_tree;
97  }
101  inline CIndexBlockTree* get_index_tree() const
102  {
103  SG_REF(m_index_tree);
104  return m_index_tree;
105  }
106 
107 protected:
108 
110  virtual bool train_machine(CFeatures* data = NULL);
111 
112 private:
113 
115  void init_defaults();
116 
118  void register_parameters();
119 
120 protected:
121 
123  CIndexBlockTree* m_index_tree;
124 
126  float64_t m_z;
127 
129  float64_t m_epsilon;
130 
132  int32_t m_max_iter;
133 
134 };
135 }
136 #endif //USE_GPL_SHOGUN
137 #endif
#define SG_REF(x)
Definition: SGObject.h:54
#define ASSERT(x)
Definition: SGIO.h:201
#define MACHINE_PROBLEM_TYPE(PT)
Definition: Machine.h:120
double float64_t
Definition: common.h:50
#define SG_UNREF(x)
Definition: SGObject.h:55
all of classes and functions are contained in the shogun namespace
Definition: class_list.h:18
void set_epsilon(float *begin, float max)
Definition: JLCoverTree.h:513

SHOGUN Machine Learning Toolbox - Documentation