SHOGUN  6.0.0
LSHKNNSolver.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 LSHSOLVER_H__
7 #define LSHSOLVER_H__
8 
9 #include <shogun/lib/config.h>
10 
11 #include <shogun/lib/common.h>
14 
15 namespace shogun
16 {
17 
23 #ifdef HAVE_CXX11
24 class CLSHKNNSolver : public CKNNSolver
25 {
26  public:
28  CLSHKNNSolver() : CKNNSolver()
29  {
30  init();
31  }
32 
34  virtual ~CLSHKNNSolver() { /* nothing to do */ }
35 
46  CLSHKNNSolver(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 lsh_l, const int32_t lsh_t);
47 
48  virtual CMulticlassLabels* classify_objects(CDistance* d, const int32_t num_lab, SGVector<int32_t>& train_lab, SGVector<float64_t>& classes) const;
49 
50  virtual SGVector<int32_t> classify_objects_k(CDistance* d, const int32_t num_lab, SGVector<int32_t>& train_lab, SGVector<int32_t>& classes) const;
51 
53  const char* get_name() const { return "LSHKNNSolver"; }
54 
55  private:
56  void init()
57  {
58  m_lsh_l=0;
59  m_lsh_t=0;
60  }
61 
62  protected:
63  /* Number of hash tables for LSH */
64  int32_t m_lsh_l;
65 
66  /* Number of probes per query for LSH */
67  int32_t m_lsh_t;
68 
69 };
70 #endif
71 }
72 
73 #endif
double float64_t
Definition: common.h:60
all of classes and functions are contained in the shogun namespace
Definition: class_list.h:18

SHOGUN Machine Learning Toolbox - Documentation