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 <stdio.h>
16 #include <shogun/lib/common.h>
17 #include <shogun/io/SGIO.h>
22 
23 namespace shogun
24 {
25 
26 class CDistanceMachine;
27 
35 
36 public:
37 
40 
45 
52 
55  virtual ~CNearestCentroid();
56 
61  void set_shrinking(float64_t shrinking) {
62  m_shrinking = shrinking ;
63  }
64 
70  return m_shrinking;
71  }
72 
78  return m_centroids;
79  }
80 
85  virtual const char* get_name() const { return "NearestCentroid"; }
86 
87 protected:
96  virtual bool train_machine(CFeatures* data=NULL);
97 
103 private:
104  void init();
105 
106 protected:
108  int32_t m_num_classes;
109 
112 
115 
118 };
119 
120 }
121 
122 #endif

SHOGUN Machine Learning Toolbox - Documentation