MLPACK  1.0.10
nystroem_method.hpp
Go to the documentation of this file.
1 
25 #ifndef __MLPACK_METHODS_NYSTROEM_METHOD_NYSTROEM_METHOD_HPP
26 #define __MLPACK_METHODS_NYSTROEM_METHOD_NYSTROEM_METHOD_HPP
27 
28 #include <mlpack/core.hpp>
29 #include "kmeans_selection.hpp"
30 
31 namespace mlpack {
32 namespace kernel {
33 
34 template<
35  typename KernelType,
36  typename PointSelectionPolicy = KMeansSelection<>
37 >
39 {
40  public:
49  NystroemMethod(const arma::mat& data, KernelType& kernel, const size_t rank);
50 
57  void Apply(arma::mat& output);
58 
66  void GetKernelMatrix(const arma::mat* data,
67  arma::mat& miniKernel,
68  arma::mat& semiKernel);
69 
77  void GetKernelMatrix(const arma::Col<size_t>& selectedPoints,
78  arma::mat& miniKernel,
79  arma::mat& semiKernel);
80 
81  private:
83  const arma::mat& data;
85  KernelType& kernel;
87  const size_t rank;
88 };
89 
90 }; // namespace kernel
91 }; // namespace mlpack
92 
93 // Include implementation.
94 #include "nystroem_method_impl.hpp"
95 
96 #endif
Linear algebra utility functions, generally performed on matrices or vectors.
Definition: load.hpp:31
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' = G * G^T.
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.