source: trunk/c++_tools/classifier/PolynomialKernelFunction.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.8 KB
Line 
1#ifndef _theplu_classifier_polynomial_kernel_function_
2#define _theplu_classifier_polynomial_kernel_function_
3
4// $Id$
5
6#include <c++_tools/classifier/KernelFunction.h>
7#include <c++_tools/classifier/DataLookup1D.h>
8
9
10#include <cmath>
11
12
13namespace theplu {
14namespace classifier {
15
16  ///
17  /// Class for polynomial kernel calculations
18  ///
19
20 
21  class PolynomialKernelFunction : public KernelFunction
22  {
23   
24  public:
25    ///
26    ///Constructor taking the order of the polynomial as input. Default is
27    ///order=1 yielding the linear kernel function.
28    ///
29    PolynomialKernelFunction(int = 1);
30   
31    ///
32    ///Destructor
33    ///
34    virtual ~PolynomialKernelFunction(void) {};
35   
36    ///
37    /// returning the scalar product of two vectors in feature space using the
38    /// polynomial kernel. @return If order is larger than one: \f$ (1+x \cdot
39    /// y)^{order} \f$ \n If order is one (linear): \f$ x \cdot y \f$
40    ///   
41    double operator()(const DataLookup1D& a1, const DataLookup1D& a2) const;
42
43    ///
44    /// @return If order is larger than one: \f$ (1+x \cdot y)^{order}
45    /// \f$ \n If order is one (linear): \f$ \frac{\sum w_yxy} \f$
46    ///
47    ///
48    double operator()(const DataLookup1D& x, 
49                      const DataLookupWeighted1D& y) const;
50    ///
51    /// returning the scalar product of two vectors in feature space
52    /// using the polynomial kernel with weights. Having all weights
53    /// equal to unity yields the same as non-weighted version.
54    ///
55    /// @return If order is larger than one: \f$ (1+x \cdot y)^{order}
56    /// \f$ \n If order is one (linear): \f$ \sum w_xw_yxy} \f$
57    ///
58    double operator()(const DataLookupWeighted1D& x, 
59                      const DataLookupWeighted1D& y) const;
60
61
62  private:
63    int order_;
64
65  }; // class PolynomialKernelFunction
66
67}} // of namespace classifier and namespace theplu
68
69#endif
Note: See TracBrowser for help on using the repository browser.