SHOGUN  5.0.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules
KMeans.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) 2014 Parijat Mazumdar
8  * Written (W) 2016 Saurabh Mahindre
9  */
10 
11 #ifndef _KMEANS_H__
12 #define _KMEANS_H__
13 
14 #include <shogun/lib/config.h>
15 
16 #include <shogun/lib/common.h>
17 #include <shogun/io/SGIO.h>
21 
22 namespace shogun
23 {
24 class CKMeansBase;
25 
45 class CKMeans : public CKMeansBase
46 {
47  public:
48 
50  CKMeans();
51 
58  CKMeans(int32_t k, CDistance* d, bool kmeanspp=false);
59 
65  CKMeans(int32_t k_i, CDistance* d_i, SGMatrix<float64_t> centers_i);
66 
67  virtual ~CKMeans();
68 
70  virtual const char* get_name() const { return "KMeans"; }
71 
72  private:
73 
82  virtual bool train_machine(CFeatures* data=NULL);
83 
86  void Lloyd_KMeans(SGMatrix<float64_t> centers, int32_t num_centers);
87 };
88 }
89 #endif
virtual const char * get_name() const
Definition: KMeans.h:70
Class Distance, a base class for all the distances used in the Shogun toolbox.
Definition: Distance.h:87
virtual ~CKMeans()
Definition: KMeans.cpp:38
KMeans clustering, partitions the data into k (a-priori specified) clusters.
Definition: KMeans.h:45
all of classes and functions are contained in the shogun namespace
Definition: class_list.h:18
The class Features is the base class of all feature objects.
Definition: Features.h:68
SGMatrix< float64_t > kmeanspp()
Definition: KMeansBase.cpp:276

SHOGUN Machine Learning Toolbox - Documentation