16 #ifndef MLPACK_CORE_KERNELS_PSPECTRUM_STRING_KERNEL_HPP 17 #define MLPACK_CORE_KERNELS_PSPECTRUM_STRING_KERNEL_HPP 89 template<
typename VecType>
90 double Evaluate(
const VecType& a,
const VecType& b)
const;
93 const std::vector<std::vector<std::map<std::string, int> > >&
Counts()
const 96 std::vector<std::vector<std::map<std::string, int> > >&
Counts()
100 size_t P()
const {
return p; }
102 size_t&
P() {
return p; }
106 const std::vector<std::vector<std::string> >&
datasets;
110 std::vector<std::vector<std::map<std::string, int> > >
counts;
120 #include "pspectrum_string_kernel_impl.hpp" Linear algebra utility functions, generally performed on matrices or vectors.
const std::vector< std::vector< std::string > > & datasets
The datasets.
size_t & P()
Modify the value of p.
const std::vector< std::vector< std::map< std::string, int > > > & Counts() const
Access the lists of substrings.
The core includes that mlpack expects; standard C++ includes and Armadillo.
double Evaluate(const VecType &a, const VecType &b) const
Evaluate the kernel for the string indices given.
PSpectrumStringKernel(const std::vector< std::vector< std::string > > &datasets, const size_t p)
Initialize the PSpectrumStringKernel with the given string datasets.
size_t p
The value of p to use in calculation.
The p-spectrum string kernel.
std::vector< std::vector< std::map< std::string, int > > > counts
Mappings of the datasets to counts of substrings.
std::vector< std::vector< std::map< std::string, int > > > & Counts()
Modify the lists of substrings.
size_t P() const
Access the value of p.