source: trunk/yat/classifier/Kernel_MEV.h @ 1437

Last change on this file since 1437 was 1437, checked in by Peter, 13 years ago

merge patch release 0.4.2 to trunk. Delta 0.4.2-0.4.1

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date ID
File size: 3.7 KB
RevLine 
[680]1#ifndef _theplu_yat_classifier_kernel_mev_
2#define _theplu_yat_classifier_kernel_mev_
[25]3
[616]4// $Id$
5
[675]6/*
[831]7  Copyright (C) 2003 Peter Johansson
8  Copyright (C) 2004, 2005 Jari Häkkinen, Peter Johansson
[1275]9  Copyright (C) 2006 Jari Häkkinen, Peter Johansson, Markus Ringnér
10  Copyright (C) 2007 Jari Häkkinen, Peter Johansson
11  Copyright (C) 2008 Peter Johansson
[25]12
[1437]13  This file is part of the yat library, http://dev.thep.lu.se/yat
[675]14
15  The yat library is free software; you can redistribute it and/or
16  modify it under the terms of the GNU General Public License as
17  published by the Free Software Foundation; either version 2 of the
18  License, or (at your option) any later version.
19
20  The yat library is distributed in the hope that it will be useful,
21  but WITHOUT ANY WARRANTY; without even the implied warranty of
22  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
23  General Public License for more details.
24
25  You should have received a copy of the GNU General Public License
26  along with this program; if not, write to the Free Software
27  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
28  02111-1307, USA.
29*/
30
[680]31#include "Kernel.h"
32#include "KernelFunction.h"
[675]33
[42]34namespace theplu {
[680]35namespace yat {
[450]36namespace classifier {
[628]37  class MatrixLookup;
38  class MatrixLookupWeighted;
[25]39
[51]40  ///
[651]41  /// @brief Memory Efficient Kernel
42  ///
43  ///   Class taking care of the
[597]44  ///   \f$ NxN \f$ kernel matrix, where \f$ N \f$ is number of
[592]45  ///   samples. Type of Kernel is defined by a KernelFunction. This
46  ///   Memory Efficient Version (MEV) does not store the kernel
47  ///   matrix in memory, but calculates an element when it is
48  ///   needed. When memory allows do always use Kernel_SEV
[651]49  ///   instead.
[51]50  ///
[330]51  class Kernel_MEV : public Kernel
[25]52  {
53   
54  public:
[303]55   
[330]56    ///
[592]57    /// Constructor taking the data matrix and KernelFunction as
[749]58    /// input. Each column in the data matrix corresponds to one
[592]59    /// sample. @note Can not handle NaNs.
[307]60    ///
[658]61    Kernel_MEV(const MatrixLookup& data, const KernelFunction& kf, 
62               const bool own=false);
[420]63
[628]64
[545]65    ///
[628]66    /// Constructor taking the data matrix and KernelFunction as
[749]67    /// input. Each column in the data matrix corresponds to one
[628]68    /// sample. @note Can not handle NaNs.
[545]69    ///
[658]70    Kernel_MEV(const MatrixLookupWeighted& data, const KernelFunction& kf,
71               const bool own=false);
[628]72
73
74    ///
[648]75    /// Constructing a new Kernel based on selected features @a
76    /// index. All other seeting are the same.
[628]77    ///
[545]78    Kernel_MEV(const Kernel_MEV& kernel, const std::vector<size_t>& index);
79
80
[307]81    ///
[420]82    /// @return Element at position (\a row, \a column) of the Kernel
[307]83    /// matrix
[51]84    ///
[527]85    double operator()(const size_t row, const size_t column) const;
86   
[658]87    ///
88    /// An interface for making new classifier objects. This function
89    /// allows for specification at run-time of which kernel to
90    /// instatiate (see 'Prototype' in Design Patterns).
91    ///
[1125]92    /// @note Returns a dynamically allocated Kernel, which has
[658]93    /// to be deleted by the caller to avoid memory leaks.
94    ///
95    const Kernel_MEV* make_kernel(const MatrixLookup&, 
96                                  const bool own=false) const;
97
98
99    ///
100    /// An interface for making new classifier objects. This function
101    /// allows for specification at run-time of which kernel to
102    /// instatiate (see 'Prototype' in Design Patterns).
103    ///
[1125]104    /// @note Returns a dynamically allocated Kernel, which has
[658]105    /// to be deleted by the caller to avoid memory leaks.
106    ///
107    const Kernel_MEV* make_kernel(const MatrixLookupWeighted&, 
108                                  const bool own=false) const;
109
110
[513]111  private:
[336]112    ///
[513]113    /// Copy constructor (not implemented)
[336]114    ///
[513]115    Kernel_MEV(const Kernel_MEV&);
[555]116    const Kernel_MEV& operator=(const Kernel_MEV&);
[25]117
[307]118  }; // class Kernel_MEV
[25]119
[680]120}}} // of namespace classifier, yat, and theplu
[25]121
122#endif
Note: See TracBrowser for help on using the repository browser.