Changeset 465
- Timestamp:
- Dec 17, 2005, 12:19:24 AM (18 years ago)
- Location:
- trunk/lib/statistics
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/statistics/ROC.h
r447 r465 35 35 /// belonges to class + otherwise sample belongs to class 36 36 /// -. @return the area under the ROC curve. If the area is less 37 /// than 0.5 and absolute=true, 1-area is returned. 37 /// than 0.5 and absolute=true, 1-area is returned. Complexity is 38 /// \f$ N\log N \f$ where \f$ N \f$ is number of samples. 38 39 /// 39 40 double score(const gslapi::vector& target, const gslapi::vector& value, … … 48 49 /// -. @return wheighted version of area under the ROC curve. If 49 50 /// the area is less than 0.5 and absolute=true, 1-area is 50 /// returned. 51 /// returned. Complexity is \f$ N^2 \f$ where \f$ N \f$ is number 52 /// of samples. 51 53 /// 52 54 double score(const gslapi::vector& target, const gslapi::vector& value, -
trunk/lib/statistics/WilcoxonFoldChange.cc
r461 r465 1 1 // $Id$ 2 2 3 #include "WilcoxonFoldChange.h" 3 #include <c++_tools/statistics/WilcoxonFoldChange.h> 4 #include <c++_tools/statistics/utility.h> 4 5 5 #include "Score.h" 6 #include "Averager.h" 7 #include "AveragerWeighted.h" 6 #include <cmath> 8 7 9 8 namespace theplu { … … 28 27 train_set_=train_set; 29 28 29 std::vector<double> distance; 30 //Peter, should reserve the vector to avoid reallocations 30 31 weighted_=false; 31 32 for (size_t i=0; i<train_set_.size(); i++) { 33 for (size_t j=0; i<j; j++) { 34 if (target(train_set_[i])==target(train_set_[j])) continue; 35 distance.push_back(value(train_set_[i])-value(train_set_[j])); 36 } 37 } 38 if (absolute_) 39 return fabs(median(distance)); 40 return median(distance); 32 41 } 33 42 … … 37 46 const std::vector<size_t>& train_set) 38 47 { 39 if (!train_set_.size()) 40 for (size_t i=0; i<target_.size(); i++) 41 train_set_.push_back(i); 42 else 43 train_set_=train_set; 44 45 weighted_=true; 48 return 0; 46 49 } 47 50 -
trunk/lib/statistics/WilcoxonFoldChange.h
r461 r465 4 4 #define _theplu_statistics_wilcoxonfoldchange_ 5 5 6 #include "Score.h"6 #include <c++_tools/statistics/Score.h> 7 7 8 8 namespace theplu { … … 34 34 const std::vector<size_t>& train_set = std::vector<size_t>()); 35 35 36 /// 36 /// @todo 37 37 /// @return difference of the weighted means of the two classes 38 38 /// … … 42 42 /// @train_set defining which values to use (number of values used 43 43 /// in the calculation is equal to size of \a train_set) 44 /// 44 /// 45 /// @note not implemented 46 /// 45 47 double 46 48 score(const gslapi::vector& target,
Note: See TracChangeset
for help on using the changeset viewer.