Changeset 749 for trunk/yat/classifier/Kernel.h
 Timestamp:
 Feb 11, 2007, 11:08:23 PM (15 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

trunk/yat/classifier/Kernel.h
r747 r749 38 38 class MatrixLookupWeighted; 39 39 40 40 /// 41 41 /// @brief Abstract Base Class for Kernels. 42 42 /// 43 43 /// Class taking care of the \f$ NxN \f$ kernel matrix, where \f$ N \f$ 44 /// is number of samples. Each element in the Kernel corresponds is44 /// is number of samples. Each element in the Kernel corresponds to 45 45 /// the scalar product of the corresponding pair of samples. At the 46 46 /// time being there are two kinds of kernels. Kernel_SEV that is 47 47 /// optimized to be fast and Kernel_MEV that is preferable when 48 48 /// dealing with many samples and memory might be a 49 /// bottleneck. Also there are the corresponding weighted versions 50 /// to deal with weights (including missing values). A 49 /// bottleneck. A 51 50 /// KernelFunction defines what kind of scalar product the Kernel 52 51 /// represents, e.g. a Polynomial Kernel of degree 1 means we are 53 52 /// dealing with the ordinary linear scalar product. 54 53 /// 55 56 57 58 59 60 61 54 /// @note If the KernelFunction is destroyed, the Kernel is no 55 /// longer defined. 56 /// 57 class Kernel 58 { 59 60 public: 62 61 63 62 /// 64 /// Constructor taking the @a data matrix and KernelFunction as 65 /// input. Each column in the data matrix corresponds to one 66 /// sample and the Kernel matrix is built applying the 67 /// KernelFunction on each pair of columns in the data matrix. 63 /// Constructor taking the @a data matrix and KernelFunction as 64 /// input. Each column in the data matrix corresponds to one 65 /// sample and the Kernel matrix is built applying the 66 /// KernelFunction on each pair of columns in the data matrix. 67 /// If @a own is set to true, Kernel is owner of underlying data. 68 68 /// 69 /// @note Can not handle NaNs. 69 /// @note Can not handle NaNs. To deal with missing values use 70 /// constructor taking MatrixLookupWeighted. 70 71 /// 71 72 Kernel(const MatrixLookup& data, const KernelFunction& kf, … … 73 74 74 75 /// 75 /// Constructor taking the @a data matrix (with weights) and 76 /// KernelFunction as 77 /// input. Each column in the data matrix corresponds to one 78 /// sample and the Kernel matrix is built applying the 79 /// KernelFunction on each pair of columns in the data matrix. 80 /// 81 /// @note Can not handle NaNs. 76 /// Constructor taking the @a data matrix (with weights) and 77 /// KernelFunction as 78 /// input. Each column in the data matrix corresponds to one 79 /// sample and the Kernel matrix is built applying the 80 /// KernelFunction on each pair of columns in the data matrix. 81 /// If @a own is set to true, Kernel is owner of underlying data. 82 82 /// 83 83 Kernel(const MatrixLookupWeighted& data, const KernelFunction& kf, … … 86 86 /// 87 87 /// The new kernel is created using selected features @a 88 /// index. Kernel will own its underlying data and delete it in 89 /// destructor. 88 /// index. Kernel will own its underlying data 90 89 /// 91 90 Kernel(const Kernel& kernel, const std::vector<size_t>& index); 92 91 93 /// 94 /// Destructor 95 /// 92 /// 93 /// @brief Destructor 94 /// 95 /// If Kernel is owner of underlying data and Kernel is the last 96 /// owner, underlying data is deleted. 97 /// 96 98 virtual ~Kernel(void); 97 99 … … 99 101 /// @return element at position (\a row, \a column) of the Kernel 100 102 /// matrix 101 103 /// 102 104 virtual double operator()(const size_t row, const size_t column) const=0; 103 105 … … 156 158 bool weighted(void) const; 157 159 158 160 protected: 159 161 /// underlying data 160 162 const DataLookup2D* data_; … … 165 167 166 168 /// 167 /// poi ter telling how many owners to underlying data169 /// pointer telling how many owners to underlying data 168 170 /// (data_). NULL if this is not an owner. 169 171 /// … … 171 173 172 174 /// 173 /// poi ter telling how many owners to underlying weights175 /// pointer telling how many owners to underlying weights 174 176 /// (data_w_). NULL if this is not an owner. 175 177 /// … … 184 186 const Kernel& operator=(const Kernel&); 185 187 186 188 }; // class Kernel 187 189 188 190 }}} // of namespace classifier, yat, and theplu
Note: See TracChangeset
for help on using the changeset viewer.