yat/classifier/Kernel_SEV.h

Code
Comments
Other
Rev Date Author Line
680 11 Oct 06 jari 1 #ifndef _theplu_yat_classifier_kernel_sev_
680 11 Oct 06 jari 2 #define _theplu_yat_classifier_kernel_sev_
306 03 May 05 peter 3
616 31 Aug 06 jari 4 // $Id$
616 31 Aug 06 jari 5
675 10 Oct 06 jari 6 /*
4359 23 Aug 23 peter 7   Copyright (C) 2005, 2006 Jari Häkkinen, Peter Johansson
4359 23 Aug 23 peter 8   Copyright (C) 2007 Peter Johansson
4359 23 Aug 23 peter 9   Copyright (C) 2008 Jari Häkkinen, Peter Johansson
306 03 May 05 peter 10
1437 25 Aug 08 peter 11   This file is part of the yat library, http://dev.thep.lu.se/yat
307 03 May 05 peter 12
675 10 Oct 06 jari 13   The yat library is free software; you can redistribute it and/or
675 10 Oct 06 jari 14   modify it under the terms of the GNU General Public License as
1486 09 Sep 08 jari 15   published by the Free Software Foundation; either version 3 of the
675 10 Oct 06 jari 16   License, or (at your option) any later version.
675 10 Oct 06 jari 17
675 10 Oct 06 jari 18   The yat library is distributed in the hope that it will be useful,
675 10 Oct 06 jari 19   but WITHOUT ANY WARRANTY; without even the implied warranty of
675 10 Oct 06 jari 20   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
675 10 Oct 06 jari 21   General Public License for more details.
675 10 Oct 06 jari 22
675 10 Oct 06 jari 23   You should have received a copy of the GNU General Public License
1487 10 Sep 08 jari 24   along with yat. If not, see <http://www.gnu.org/licenses/>.
675 10 Oct 06 jari 25 */
675 10 Oct 06 jari 26
680 11 Oct 06 jari 27 #include "Kernel.h"
1121 22 Feb 08 peter 28 #include "yat/utility/Matrix.h"
675 10 Oct 06 jari 29
306 03 May 05 peter 30 namespace theplu {
680 11 Oct 06 jari 31 namespace yat {
450 15 Dec 05 peter 32 namespace classifier {
306 03 May 05 peter 33
527 01 Mar 06 peter 34   class DataLookup1D;
306 03 May 05 peter 35   class KernelFunction;
306 03 May 05 peter 36
592 24 Aug 06 peter 37   ///
322 26 May 05 peter 38   ///   @brief Speed Efficient Kernel
648 14 Sep 06 peter 39   ///
597 28 Aug 06 markus 40   ///   Class taking care of the \f$ NxN \f$ kernel matrix, where
597 28 Aug 06 markus 41   ///   \f$ N \f$ is number of samples. Type of Kernel is defined by a
749 11 Feb 07 peter 42   ///   KernelFunction. This Speed Efficient Version (SEV) calculates
592 24 Aug 06 peter 43   ///   the kernel matrix once by construction and the kernel is stored in
597 28 Aug 06 markus 44   ///   memory. When \f$ N \f$ is large and the kernel matrix cannot be
592 24 Aug 06 peter 45   ///   stored in memory, use Kernel_MEV instead.
592 24 Aug 06 peter 46   ///
4200 19 Aug 22 peter 47   class Kernel_SEV : public Kernel
306 03 May 05 peter 48   {
4200 19 Aug 22 peter 49
306 03 May 05 peter 50   public:
333 02 Jun 05 jari 51
306 03 May 05 peter 52     ///
592 24 Aug 06 peter 53     /// Constructor taking the data matrix and KernelFunction as
592 24 Aug 06 peter 54     /// input. @note Can not handle NaNs. When dealing with missing values,
592 24 Aug 06 peter 55     /// use KernelWeighted_SEV instead.
592 24 Aug 06 peter 56     ///
658 25 Sep 06 peter 57     Kernel_SEV(const MatrixLookup&, const KernelFunction&,const bool own=false);
4200 19 Aug 22 peter 58
322 26 May 05 peter 59     ///
628 05 Sep 06 peter 60     /// Constructor taking the data matrix and KernelFunction as
628 05 Sep 06 peter 61     /// input. @note Can not handle NaNs. When dealing with missing values,
628 05 Sep 06 peter 62     /// use KernelWeighted_SEV instead.
545 06 Mar 06 peter 63     ///
658 25 Sep 06 peter 64     Kernel_SEV(const MatrixLookupWeighted&, const KernelFunction&,
658 25 Sep 06 peter 65                const bool own=false);
4200 19 Aug 22 peter 66
628 05 Sep 06 peter 67     ///
648 14 Sep 06 peter 68     /// Constructs a Kernel based on selected features defined by @a index
628 05 Sep 06 peter 69     ///
545 06 Mar 06 peter 70     Kernel_SEV(const Kernel_SEV& kernel, const std::vector<size_t>& index);
306 03 May 05 peter 71
658 25 Sep 06 peter 72
307 03 May 05 peter 73     ///
658 25 Sep 06 peter 74     /// An interface for making new classifier objects. This function
658 25 Sep 06 peter 75     /// allows for specification at run-time of which kernel to
658 25 Sep 06 peter 76     /// instatiate (see 'Prototype' in Design Patterns).
658 25 Sep 06 peter 77     ///
1125 22 Feb 08 peter 78     /// @note Returns a dynamically allocated Kernel, which has
658 25 Sep 06 peter 79     /// to be deleted by the caller to avoid memory leaks.
658 25 Sep 06 peter 80     ///
4200 19 Aug 22 peter 81     const Kernel_SEV* make_kernel(const MatrixLookup&,
658 25 Sep 06 peter 82                                   const bool own=false) const;
658 25 Sep 06 peter 83
658 25 Sep 06 peter 84
658 25 Sep 06 peter 85     ///
658 25 Sep 06 peter 86     /// An interface for making new classifier objects. This function
658 25 Sep 06 peter 87     /// allows for specification at run-time of which kernel to
658 25 Sep 06 peter 88     /// instatiate (see 'Prototype' in Design Patterns).
658 25 Sep 06 peter 89     ///
1125 22 Feb 08 peter 90     /// @note Returns a dynamically allocated Kernel, which has
658 25 Sep 06 peter 91     /// to be deleted by the caller to avoid memory leaks.
658 25 Sep 06 peter 92     ///
4200 19 Aug 22 peter 93     const Kernel_SEV* make_kernel(const MatrixLookupWeighted&,
658 25 Sep 06 peter 94                                   const bool own=false) const;
658 25 Sep 06 peter 95
658 25 Sep 06 peter 96
658 25 Sep 06 peter 97     ///
322 26 May 05 peter 98     /// @return element at position (\a row, \a column) in the Kernel
307 03 May 05 peter 99     /// matrix
592 24 Aug 06 peter 100     ///
658 25 Sep 06 peter 101     double operator()(const size_t row,const size_t column) const;
336 03 Jun 05 peter 102
658 25 Sep 06 peter 103
306 03 May 05 peter 104   private:
548 06 Mar 06 peter 105     ///
548 06 Mar 06 peter 106     /// Copy constructor (not implemented)
548 06 Mar 06 peter 107     ///
548 06 Mar 06 peter 108     Kernel_SEV(const Kernel_SEV&);
555 08 Mar 06 peter 109     const Kernel_SEV& operator=(const Kernel_SEV&);
548 06 Mar 06 peter 110
548 06 Mar 06 peter 111     void build_kernel(void);
548 06 Mar 06 peter 112
1121 22 Feb 08 peter 113     utility::Matrix kernel_matrix_;
306 03 May 05 peter 114
307 03 May 05 peter 115   }; // class Kernel_SEV
306 03 May 05 peter 116
680 11 Oct 06 jari 117 }}} // of namespace classifier, yat, and theplu
306 03 May 05 peter 118
306 03 May 05 peter 119 #endif