SHOGUN  6.0.0
KDTreeKNNSolver.h
Go to the documentation of this file.
1 /* This software is distributed under BSD 3-clause license (see LICENSE file).
2  *
3  * Copyright (c) 2012-2013 Sergey Lisitsyn
4  */
5 
6 #ifndef KDTREESOLVER_H__
7 #define KDTREESOLVER_H__
8 
9 #include <shogun/lib/config.h>
10 
11 #include <shogun/lib/common.h>
14 
15 namespace shogun
16 {
17 
25 {
26  public:
29  {
30  init();
31  }
32 
34  virtual ~CKDTREEKNNSolver() { /* nothing to do */ }
35 
45  CKDTREEKNNSolver(const int32_t k, const float64_t q, const int32_t num_classes, const int32_t min_label, const SGVector<int32_t> train_labels, const int32_t leaf_size);
46 
47  virtual CMulticlassLabels* classify_objects(CDistance* d, const int32_t num_lab, SGVector<int32_t>& train_lab, SGVector<float64_t>& classes) const;
48 
49  virtual SGVector<int32_t> classify_objects_k(CDistance* d, const int32_t num_lab, SGVector<int32_t>& train_lab, SGVector<int32_t>& classes) const;
50 
52  const char* get_name() const { return "KDTREEKNNSolver"; }
53 
54  private:
55  void init()
56  {
57  m_leaf_size=0;
58  }
59 
60  protected:
61  // leaf size of K-D tree
62  int32_t m_leaf_size;
63 };
64 }
65 
66 #endif
Class Distance, a base class for all the distances used in the Shogun toolbox.
Definition: Distance.h:87
virtual SGVector< int32_t > classify_objects_k(CDistance *d, const int32_t num_lab, SGVector< int32_t > &train_lab, SGVector< int32_t > &classes) const
Multiclass Labels for multi-class classification.
double float64_t
Definition: common.h:60
const char * get_name() const
virtual CMulticlassLabels * classify_objects(CDistance *d, const int32_t num_lab, SGVector< int32_t > &train_lab, SGVector< float64_t > &classes) const
all of classes and functions are contained in the shogun namespace
Definition: class_list.h:18

SHOGUN Machine Learning Toolbox - Documentation