SHOGUN  3.2.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
NearestCentroid.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 Philippe Tillet
8  */
9 
10 #ifndef _NEAREST_CENTROID_H__
11 #define _NEAREST_CENTROID_H__
12 
13 #include <shogun/lib/config.h>
14 
15 #include <shogun/lib/common.h>
16 #include <shogun/io/SGIO.h>
21 
22 namespace shogun
23 {
24 
25 class CDistanceMachine;
26 
34 
35 public:
36 
39 
44 
51 
54  virtual ~CNearestCentroid();
55 
60  void set_shrinking(float64_t shrinking) {
61  m_shrinking = shrinking ;
62  }
63 
69  return m_shrinking;
70  }
71 
77  return m_centroids;
78  }
79 
84  virtual const char* get_name() const { return "NearestCentroid"; }
85 
86 protected:
95  virtual bool train_machine(CFeatures* data=NULL);
96 
102 private:
103  void init();
104 
105 protected:
107  int32_t m_num_classes;
108 
111 
114 
117 };
118 
119 }
120 
121 #endif

SHOGUN Machine Learning Toolbox - Documentation