mlpack  2.0.1
nystroem_method.hpp
Go to the documentation of this file.
1 
17 #ifndef __MLPACK_METHODS_NYSTROEM_METHOD_NYSTROEM_METHOD_HPP
18 #define __MLPACK_METHODS_NYSTROEM_METHOD_NYSTROEM_METHOD_HPP
19 
20 #include <mlpack/core.hpp>
21 #include "kmeans_selection.hpp"
22 
23 namespace mlpack {
24 namespace kernel {
25 
26 template<
27  typename KernelType,
28  typename PointSelectionPolicy = KMeansSelection<>
29 >
31 {
32  public:
41  NystroemMethod(const arma::mat& data, KernelType& kernel, const size_t rank);
42 
49  void Apply(arma::mat& output);
50 
58  void GetKernelMatrix(const arma::mat* data,
59  arma::mat& miniKernel,
60  arma::mat& semiKernel);
61 
69  void GetKernelMatrix(const arma::Col<size_t>& selectedPoints,
70  arma::mat& miniKernel,
71  arma::mat& semiKernel);
72 
73  private:
75  const arma::mat& data;
77  KernelType& kernel;
79  const size_t rank;
80 };
81 
82 } // namespace kernel
83 } // namespace mlpack
84 
85 // Include implementation.
86 #include "nystroem_method_impl.hpp"
87 
88 #endif
Linear algebra utility functions, generally performed on matrices or vectors.
const size_t rank
Rank used for matrix approximation.
void Apply(arma::mat &output)
Apply the low-rank factorization to obtain an output matrix G such that K&#39; = G * G^T.
Include all of the base components required to write MLPACK methods, and the main MLPACK Doxygen docu...
KernelType & kernel
The locally stored kernel, if it is necessary.
const arma::mat & data
The reference dataset.
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.