Changeset 706
- Timestamp:
- Dec 19, 2006, 9:59:19 AM (16 years ago)
- Location:
- trunk/yat
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/yat/classifier/SVM.cc
r680 r706 149 149 } 150 150 151 void SVM::reset(void) 152 { 153 trained_=false; 154 alpha_=utility::vector(target_.size(), 0); 155 } 156 151 157 bool SVM::train(void) 152 158 { -
trunk/yat/classifier/SVM.h
r692 r706 92 92 /// @returns mean of vector \f$ C_i \f$ 93 93 /// 94 inline double C(void) const { return 1 /C_inverse_; }94 inline double C(void) const { return 1.0/C_inverse_; } 95 95 96 96 /// … … 139 139 140 140 /// 141 /// Function sets \f$ \alpha=0 \f$ and makes SVM untrained. 142 /// 143 inline void reset(void) 144 { trained_=false; alpha_=utility::vector(target_.size(),0); } 141 /// @brief Function sets \f$ \alpha=0 \f$ and makes SVM untrained. 142 /// 143 void reset(void); 145 144 146 145 /// -
trunk/yat/classifier/SVindex.h
r680 r706 50 50 51 51 // @return index_first 52 inline size_t index_first(void) const 53 { assert(index_first_<size()); return index_first_; } 52 inline size_t index_first(void) const { return index_first_; } 54 53 55 54 // @return index_second 56 inline size_t index_second(void) const 57 { assert(index_second_<size()); return index_second_; } 55 inline size_t index_second(void) const { return index_second_; } 58 56 59 57 // synch the object against alpha … … 89 87 90 88 // @return value_first 91 inline size_t value_first(void) const 92 { assert(value_first_<size()); return value_first_; } 89 inline size_t value_first(void) const { return value_first_; } 93 90 94 91 // @return const ref value_second 95 inline size_t value_second(void) const 96 { assert(value_first_<size()); return value_second_; } 92 inline size_t value_second(void) const { return value_second_; } 97 93 98 inline size_t operator()(size_t i) const { 99 assert(i<size()); assert(vec_[i]<size()); return vec_[i]; } 94 inline size_t operator()(size_t i) const { return vec_[i]; } 100 95 101 96 private: -
trunk/yat/classifier/Target.h
r680 r706 91 91 92 92 /// 93 /// Default binary is set to false for all classes except class 0. 93 /// @brief Default binary is set to false for all classes except 94 /// class 0. 94 95 /// 95 96 /// @return binary target for sample @a i … … 97 98 /// @see set_binary 98 99 /// 99 inline bool binary(const size_t i) const 100 { assert(i<size()); return binary_[operator()(i)]; } 100 inline bool binary(const size_t i) const { return binary_[operator()(i)]; } 101 101 102 102 /// … … 110 110 /// 0 which is set to true. 111 111 /// 112 inline void set_binary(const size_t i, const bool b) 113 { assert(i<nof_classes()); binary_[i]=b; } 112 inline void set_binary(const size_t i, const bool b) { binary_[i]=b; } 114 113 115 114 /// … … 141 140 /// 142 141 inline size_t operator()(const size_t sample) const 143 { assert(sample<size());return classes_[sample]; }142 { return classes_[sample]; } 144 143 145 144 /// -
trunk/yat/microarray/DataSet.h
r688 r706 1 1 #ifndef _theplu_yat_microarray_dataset_ 2 2 #define _theplu_yat_microarray_dataset_ 3 3 4 // $Id$ 4 5 6 /* 7 Copyright (C) The authors contributing to this file. 8 9 This file is part of the yat library, http://lev.thep.lu.se/trac/yat 10 11 The yat library is free software; you can redistribute it and/or 12 modify it under the terms of the GNU General Public License as 13 published by the Free Software Foundation; either version 2 of the 14 License, or (at your option) any later version. 15 16 The yat library is distributed in the hope that it will be useful, 17 but WITHOUT ANY WARRANTY; without even the implied warranty of 18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 19 General Public License for more details. 20 21 You should have received a copy of the GNU General Public License 22 along with this program; if not, write to the Free Software 23 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 24 02111-1307, USA. 25 */ 5 26 6 27 #include "yat/classifier/MatrixLookup.h" … … 51 72 52 73 private: 53 /// Copy Constructor 74 /// 75 /// @brief The copy constructor 76 /// 54 77 DataSet(const DataSet&); 55 78 56 /// Assignment operator 79 /// 80 /// @brief The assignment operator 81 /// 57 82 DataSet& operator=(const DataSet&); 58 83 -
trunk/yat/random/random.cc
r680 r706 85 85 } 86 86 87 // --------------------- Discrete distribtuions --------------------- 88 89 Discrete::Discrete(void) 90 : rng_(RNG::instance()) 91 { 92 } 93 94 95 Discrete::~Discrete(void) 96 { 97 } 98 87 99 88 100 DiscreteGeneral::DiscreteGeneral(const statistics::Histogram& hist) … … 103 115 } 104 116 117 118 Poisson::Poisson(const double m) 119 : m_(m) 120 { 121 } 122 123 // --------------------- Continuous distribtuions --------------------- 124 125 Continuous::Continuous(void) 126 : rng_(RNG::instance()) 127 { 128 } 129 130 131 Continuous::~Continuous(void) 132 { 133 } 134 135 136 ContinuousGeneral::ContinuousGeneral(const statistics::Histogram& hist) 137 : discrete_(DiscreteGeneral(hist)), hist_(hist) 138 { 139 } 140 141 142 Exponential::Exponential(const double m) 143 : m_(m) 144 { 145 } 146 147 148 Gaussian::Gaussian(const double s, const double m) 149 : m_(m), s_(s) 150 { 151 } 152 105 153 }}} // of namespace random, yat, and theplu -
trunk/yat/random/random.h
r680 r706 193 193 /// @brief Constructor 194 194 /// 195 inline Discrete(void) { rng_=RNG::instance(); } 196 197 inline virtual ~Discrete(void) { } 195 Discrete(void); 196 197 /// 198 /// @brief The destructor 199 /// 200 virtual ~Discrete(void); 198 201 199 202 /// … … 338 341 /// 339 342 /// @param m is expectation value 340 inline Poisson(const double m=1) : m_(m) {} 343 /// 344 Poisson(const double m=1); 341 345 342 346 /// … … 373 377 /// @brief Constructor 374 378 /// 375 inline Continuous(void) { rng_=RNG::instance(); } 376 377 inline virtual ~Continuous(void) { } 379 Continuous(void); 380 381 /// 382 /// @brief The destructor 383 /// 384 virtual ~Continuous(void); 378 385 379 386 /// … … 434 441 /// @param hist is a Histogram defining the probability distribution 435 442 /// 436 inline ContinuousGeneral(const statistics::Histogram& hist) 437 : discrete_(DiscreteGeneral(hist)), hist_(hist) {} 438 439 /// 440 /// @brief Destructor 441 /// 442 ~ContinuousGeneral(void); 443 ContinuousGeneral(const statistics::Histogram& hist); 443 444 444 445 /// … … 475 476 /// @param m is the expectation value of the distribution. 476 477 /// 477 inline Exponential(const double m=1) : m_(m) {}478 inline Exponential(const double m=1); 478 479 479 480 /// … … 514 515 /// 515 516 /// @brief Constructor 517 /// 516 518 /// @param s is the standard deviation \f$ \sigma \f$ of distribution 517 519 /// @param m is the expectation value \f$ \mu \f$ of the distribution 518 520 /// 519 inline Gaussian(const double s=1, const double m=0) : m_(m), s_(s) {}521 Gaussian(const double s=1, const double m=0); 520 522 521 523 /// … … 528 530 /// @return A random Gaussian number with standard deviation \a s 529 531 /// and expectation value 0. 532 /// 530 533 /// @note this operator ignores parameters given in Constructor 531 534 /// … … 536 539 /// @return A random Gaussian number with standard deviation \a s 537 540 /// and expectation value \a m. 541 /// 538 542 /// @note this operator ignores parameters given in Constructor 539 543 ///
Note: See TracChangeset
for help on using the changeset viewer.