source: trunk/lib/classifier/KernelWeighted_MEV.cc @ 545

Last change on this file since 545 was 545, checked in by Peter, 17 years ago

added feature selection for SVM

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 1.0 KB
Line 
1// $Id: KernelWeighted_MEV.cc 545 2006-03-06 13:35:45Z peter $
2
3#include <c++_tools/classifier/KernelWeighted_MEV.h>
4
5#include <c++_tools/classifier/DataLookup1D.h>
6#include <c++_tools/classifier/KernelFunction.h>
7
8namespace theplu {
9namespace classifier { 
10
11  double KernelWeighted_MEV::operator()(const size_t row, 
12                                        const size_t column) const
13      { 
14        return (*kf_)(DataLookup1D(*data_,row,false),
15                      DataLookup1D(*data_,column,false),
16                      DataLookup1D(*weights_,row,false),
17                      DataLookup1D(*weights_,column,false)); 
18      }
19
20  KernelWeighted_MEV::KernelWeighted_MEV(const MatrixLookup& data, 
21                                         const KernelFunction& kf, 
22                                         const MatrixLookup& weights)
23    : Kernel(data,kf, weights) 
24  {
25  }
26
27
28  KernelWeighted_MEV::KernelWeighted_MEV(const KernelWeighted_MEV& other, 
29                                         const std::vector<size_t>& index)
30    : Kernel(other, index)
31  {
32  }
33
34
35  const Kernel* 
36  KernelWeighted_MEV::selected(const std::vector<size_t>& index) const
37  {
38    return new KernelWeighted_MEV(*this, index);
39  }
40
41
42}} // of namespace classifier and namespace theplu
Note: See TracBrowser for help on using the repository browser.