Changeset 1305 for trunk/yat/statistics
- Timestamp:
- May 15, 2008, 12:25:54 AM (15 years ago)
- Location:
- trunk/yat/statistics
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/yat/statistics/Makefile.am
r1275 r1305 39 39 include_statistics_HEADERS = AUC.h Averager.h AveragerPair.h \ 40 40 AveragerWeighted.h AveragerPairWeighted.h \ 41 EuclideanDistance.h Fisher.h \41 averager_traits.h EuclideanDistance.h Fisher.h \ 42 42 FoldChange.h Histogram.h \ 43 43 KolmogorovSmirnov.h \ -
trunk/yat/statistics/utility.h
r1275 r1305 29 29 */ 30 30 31 #include "averager_traits.h" 31 32 #include "yat/classifier/DataLookupWeighted1D.h" 32 33 #include "yat/classifier/Target.h" … … 44 45 namespace yat { 45 46 namespace statistics { 47 48 /** 49 \brief Functor to take average of a range. 50 */ 51 struct Average 52 { 53 /** 54 If range is weighted an AveragerWeighted is used else a Averager. 55 56 \return average of range 57 */ 58 template<typename ForwardIterator> 59 inline double operator()(ForwardIterator first, ForwardIterator last) const 60 { 61 typename averager<ForwardIterator>::type a; 62 add(a, first, last); 63 return a.mean(); 64 } 65 66 }; 67 68 46 69 47 70 //forward declarations … … 77 100 /// 78 101 /// @return cumulative hypergeomtric distribution functions P(k). 102 /// 103 /// \deprecated 79 104 /// 80 105 double cdf_hypergeometric_P(unsigned int k, unsigned int n1, … … 167 192 double percentile(T first, T last, double p, bool sorted=false) 168 193 { 169 utility::yat_assert<std::range_error>(first<last); 194 utility::yat_assert<std::range_error>(first<last, 195 "percentile: invalid range"); 170 196 utility::yat_assert<std::runtime_error>(p>=0, "percentage is negative"); 171 197 utility::yat_assert<std::runtime_error>(p<=100,
Note: See TracChangeset
for help on using the changeset viewer.