source: trunk/lib/classifier/KernelWeighted_SEV.h @ 513

Last change on this file since 513 was 513, checked in by Peter, 16 years ago

added kernels using weights

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 1.7 KB
Line 
1// $Id: KernelWeighted_SEV.h 513 2006-02-18 16:02:43Z peter $
2
3#ifndef _theplu_classifier_kernel_weighted_sev_
4#define _theplu_classifier_kernel_weighted_sev_
5
6#include <c++_tools/classifier/Kernel.h>
7#include <c++_tools/gslapi/matrix.h>
8
9
10namespace theplu {
11namespace classifier {
12
13  class KernelFunction;
14
15  ///
16  ///   @brief Speed Efficient Kernel
17  ///   Class taking care of the \f$NxN\f$ kernel matrix, where
18  ///   \f$N\f$ is number of samples. Type of Kernel is defined by a
19  ///   KernelFunction. This Speed Efficient Version (SEV) calculated
20  ///   the kernel matrix once and the kernel is stored in
21  ///   memory. When \f$N\f$ is large and the kernel matrix cannot be
22  ///   stored in memory, use Kernel_MEV instead.
23  ///   
24  ///   @see also Kernel_MEV
25  ///
26  class KernelWeighted_SEV : public Kernel
27  {
28   
29  public:
30
31    ///
32    ///   Constructor taking the data matrix and KernelFunction as
33    ///   input. @note Can not handle NaNs. When dealing with missing values,
34    ///   use constructor taking a weight matrix.
35    ///
36    /// @note if @a data, @a kf, or @a weights is destroyed the
37    /// behaviour of the object is undefined
38    ///
39    KernelWeighted_SEV(const gslapi::matrix& data, const KernelFunction& kf, 
40                       const gslapi::matrix& weights);
41
42   
43    ///
44    /// @return element at position (\a row, \a column) in the Kernel
45    /// matrix
46    ///
47    inline double operator()(const size_t row,const size_t column) const
48    { return kernel_matrix_(row,column); }
49
50  private:
51    /// Copy constructor (not implemented)
52    KernelWeighted_SEV(const KernelWeighted_SEV&);
53
54    gslapi::matrix kernel_matrix_;
55    const gslapi::matrix& weights_;
56
57  }; // class Kernel_SEV
58
59}} // of namespace classifier and namespace theplu
60
61#endif
Note: See TracBrowser for help on using the repository browser.