Changeset 548
- Timestamp:
- Mar 6, 2006, 7:00:05 PM (17 years ago)
- Location:
- trunk/lib/classifier
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/classifier/KernelWeighted_SEV.cc
r545 r548 19 19 : Kernel(data,kf,weights) 20 20 { 21 kernel_matrix_ = gslapi::matrix(data.columns(),data.columns()); 21 build_kernel(); 22 } 23 24 25 KernelWeighted_SEV::KernelWeighted_SEV(const KernelWeighted_SEV& other, 26 const std::vector<size_t>& index) 27 : Kernel(other, index) 28 { 29 build_kernel(); 30 } 31 32 33 void KernelWeighted_SEV::build_kernel(void) 34 { 35 kernel_matrix_ = gslapi::matrix(data_->columns(),data_->columns()); 22 36 for (size_t i=0; i<kernel_matrix_.rows(); i++) 23 37 for (size_t j=i; j<kernel_matrix_.columns(); j++) … … 28 42 DataLookup1D(*weights_,j,false)); 29 43 } 30 31 44 32 KernelWeighted_SEV::KernelWeighted_SEV(const KernelWeighted_SEV& other,33 const std::vector<size_t>& index)34 : Kernel(other, index)35 {36 }37 38 45 39 46 const KernelWeighted_SEV* -
trunk/lib/classifier/KernelWeighted_SEV.h
r545 r548 33 33 34 34 /// 35 /// 36 /// 37 /// 35 /// Constructor taking the data matrix and KernelFunction as 36 /// input. @note Can not handle NaNs. When dealing with missing values, 37 /// use constructor taking a weight matrix. 38 38 /// 39 39 /// @note if @a data, @a kf, or @a weights is destroyed the … … 49 49 const std::vector<size_t>& index); 50 50 51 51 52 /// 52 53 /// @return element at position (\a row, \a column) in the Kernel … … 66 67 } 67 68 69 /// 70 /// @todo doc 71 /// 68 72 inline double element(const DataLookup1D& vec, const DataLookup1D& w, 69 73 const size_t i) const … … 86 90 KernelWeighted_SEV(const KernelWeighted_SEV&); 87 91 92 /// 93 /// Building Kernel matrix 94 /// 95 void build_kernel(void); 96 88 97 gslapi::matrix kernel_matrix_; 89 98 -
trunk/lib/classifier/Kernel_SEV.cc
r545 r548 17 17 : Kernel(data,kf) 18 18 { 19 kernel_matrix_ = gslapi::matrix(data.columns(),data.columns()); 19 build_kernel(); 20 } 21 22 Kernel_SEV::Kernel_SEV(const Kernel_SEV& other, 23 const std::vector<size_t>& index) 24 : Kernel(other, index) 25 { 26 build_kernel(); 27 } 28 29 30 void Kernel_SEV::build_kernel(void) 31 { 32 kernel_matrix_ = gslapi::matrix(data_->columns(),data_->columns()); 20 33 for (size_t i=0; i<kernel_matrix_.rows(); i++) 21 34 for (size_t j=i; j<kernel_matrix_.columns(); j++) … … 24 37 } 25 38 26 Kernel_SEV::Kernel_SEV(const Kernel_SEV& other,27 const std::vector<size_t>& index)28 : Kernel(other, index)29 {30 }31 39 32 40 double Kernel_SEV::element(const DataLookup1D& vec, const size_t i) const -
trunk/lib/classifier/Kernel_SEV.h
r545 r548 31 31 32 32 /// 33 /// Default constructor (not implemented)34 ///35 Kernel_SEV(void);36 37 ///38 33 /// Constructor taking the data matrix and KernelFunction as 39 34 /// input. @note Can not handle NaNs. When dealing with missing values, … … 41 36 Kernel_SEV(const MatrixLookup&, const KernelFunction&); 42 37 43 ///44 /// Copy constructor (not implemented)45 ///46 Kernel_SEV(const Kernel_SEV&);47 48 38 /// 49 39 /// @todo doc … … 59 49 60 50 /// 61 /// @return kernel element between data @a ve and training sample @a i51 /// @return kernel element between data @a vec and training sample @a i 62 52 /// 63 53 double element(const DataLookup1D& vec, const size_t i) const; 54 55 /// 56 /// @todo doc 57 /// 64 58 double element(const DataLookup1D& vec, const DataLookup1D& w, 65 59 const size_t i) const; 66 60 61 /// 62 /// @todo doc 63 /// 67 64 const Kernel* selected(const std::vector<size_t>& index) const; 68 65 66 /// 67 /// @return false 68 /// 69 69 inline bool weighted(void) const { return false; } 70 70 71 private: 72 /// 73 /// Copy constructor (not implemented) 74 /// 75 Kernel_SEV(const Kernel_SEV&); 76 77 void build_kernel(void); 78 71 79 gslapi::matrix kernel_matrix_; 72 80
Note: See TracChangeset
for help on using the changeset viewer.