nystroem_method.hpp
Go to the documentation of this file.
1 
15 #ifndef MLPACK_METHODS_NYSTROEM_METHOD_NYSTROEM_METHOD_HPP
16 #define MLPACK_METHODS_NYSTROEM_METHOD_NYSTROEM_METHOD_HPP
17 
18 #include <mlpack/prereqs.hpp>
19 #include "kmeans_selection.hpp"
20 
21 namespace mlpack {
22 namespace kernel {
23 
24 template<
25  typename KernelType,
26  typename PointSelectionPolicy = KMeansSelection<>
27 >
29 {
30  public:
39  NystroemMethod(const arma::mat& data, KernelType& kernel, const size_t rank);
40 
47  void Apply(arma::mat& output);
48 
56  void GetKernelMatrix(const arma::mat* data,
57  arma::mat& miniKernel,
58  arma::mat& semiKernel);
59 
67  void GetKernelMatrix(const arma::Col<size_t>& selectedPoints,
68  arma::mat& miniKernel,
69  arma::mat& semiKernel);
70 
71  private:
73  const arma::mat& data;
75  KernelType& kernel;
77  const size_t rank;
78 };
79 
80 } // namespace kernel
81 } // namespace mlpack
82 
83 // Include implementation.
84 #include "nystroem_method_impl.hpp"
85 
86 #endif
.hpp
Definition: add_to_po.hpp:21
The core includes that mlpack expects; standard C++ includes and Armadillo.
void Apply(arma::mat &output)
Apply the low-rank factorization to obtain an output matrix G such that K&#39; = G * G^T.
NystroemMethod(const arma::mat &data, KernelType &kernel, const size_t rank)
Create the NystroemMethod object.
void GetKernelMatrix(const arma::mat *data, arma::mat &miniKernel, arma::mat &semiKernel)
Construct the kernel matrix with matrix that contains the selected points.