00001 #ifndef _theplu_yat_statistics_roc_
00002 #define _theplu_yat_statistics_roc_
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #include "yat/classifier/Target.h"
00027 #include "yat/utility/iterator_traits.h"
00028
00029 #include <algorithm>
00030 #include <map>
00031 #include <utility>
00032
00033 namespace theplu {
00034 namespace yat {
00035 namespace statistics {
00036
00044 class ROC
00045 {
00046
00047 public:
00051 ROC(void);
00052
00056 virtual ~ROC(void);
00057
00064 void add(double value, bool target, double weight=1.0);
00065
00073 double area(void);
00074
00081 unsigned int& minimum_size(void);
00082
00089 const unsigned int& minimum_size(void) const;
00090
00094 double n(void) const;
00095
00099 double n_neg(void) const;
00100
00104 double n_pos(void) const;
00105
00122 double p_value_one_sided(void) const;
00123
00129 double p_value(void) const;
00130
00134 void reset(void);
00135
00136 private:
00137
00139 double get_p_approx(double) const;
00140
00142 double get_p_exact(const double, const double, const double) const;
00143
00144 double area_;
00145 unsigned int minimum_size_;
00146 double w_neg_;
00147 double w_pos_;
00148
00149 std::multimap<double, std::pair<bool, double> > multimap_;
00150 };
00151
00152 }}}
00153
00154 #endif