# source:trunk/c++_tools/classifier/GaussianKernelFunction.h@627

Last change on this file since 627 was 627, checked in by Peter, 15 years ago

fixes #124 also extended interface of AveragerPairWeighted? supporting DataLookupWeighted1D

• Property svn:eol-style set to native
• Property svn:keywords set to Author Date ID
File size: 1.7 KB
Line
1#ifndef _theplu_classifier_gaussian_kernel_function_
2#define _theplu_classifier_gaussian_kernel_function_
3
4// $Id$
5
6#include <c++_tools/classifier/KernelFunction.h>
7#include <c++_tools/classifier/DataLookup1D.h>
8
9#include <cmath>
10
11namespace theplu {
12namespace classifier {
13
14  ///
15  /// Class for Gaussian kernel calculations.
16  ///
17
18  class GaussianKernelFunction : public KernelFunction
19  {
20
21  public:
22    ///
23    /// Constructor taking the sigma_ , i.e. the width of the Gaussian,as
24    /// input. Default is sigma_ = 1.
25    ///
26    GaussianKernelFunction(double = 1);
27
28    ///
29    ///Destructor
30    ///
31       virtual ~GaussianKernelFunction(void) {};
32
33    ///
34    /// returning the scalar product of two vectors in feature space using the
35    /// Gaussian kernel. @return \f$exp(-(x - y)^{2}/\sigma^2) \f$ \n
36    ///
37    double operator()(const DataLookup1D& x,
38                      const DataLookup1D& y) const;
39
40    /**
41       \f$\exp(-d^2/\sigma^2) \f$ where \f$d^2 = \sum w_y(x_i-y_i)^2 42 / \sum w_y * N \f$
43     **/
44    double operator()(const DataLookup1D& x,
45                      const DataLookupWeighted1D& y) const;
46
47    /**
48       \f$\exp(-d^2/\sigma^2) \f$ where \f$d^2 = \sum w_xw_y(x_i-y_i)^2 49 / \sum w_xw_y * N \f$
50     **/
51    double operator()(const DataLookupWeighted1D& x,
52                      const DataLookupWeighted1D& y) const;
53
54    ///
55    ///returning the scalar product of two vectors in feature space using the
56    ///Gaussian kernel with weights.
57    ///
58    double operator()(const DataLookup1D& a1,
59                      const DataLookup1D& a2,
60                      const DataLookup1D& w1,
61                      const DataLookup1D& w2) const;
62
63  private:
64    double sigma2_;
65
66  }; // class GaussianKernelFunction
67
68}} // of namespace classifier and namespace theplu
69
70#endif
Note: See TracBrowser for help on using the repository browser.