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

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

fixes #125 removing obsolete function and cleaning in Kernel classes.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date ID
File size: 1.4 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  private:
55    double sigma2_;
56
57  }; // class GaussianKernelFunction
58
59}} // of namespace classifier and namespace theplu
60
61#endif
Note: See TracBrowser for help on using the repository browser.