SHOGUN  v3.0.0
 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 <stdio.h>
14 #include <shogun/lib/common.h>
15 #include <shogun/io/SGIO.h>
20 
21 namespace shogun
22 {
23 
24 class CDistanceMachine;
25 
33 
34 public:
35 
38 
43 
50 
53  virtual ~CNearestCentroid();
54 
59  void set_shrinking(float64_t shrinking) {
60  m_shrinking = shrinking ;
61  }
62 
68  return m_shrinking;
69  }
70 
76  return m_centroids;
77  }
78 
83  virtual const char* get_name() const { return "NearestCentroid"; }
84 
85 protected:
94  virtual bool train_machine(CFeatures* data=NULL);
95 
101 private:
102  void init();
103 
104 protected:
106  int32_t m_num_classes;
107 
110 
113 
116 };
117 
118 }
119 
120 #endif

SHOGUN Machine Learning Toolbox - Documentation