00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #ifndef OPENMS_MATH_STATISTICS_ROCCURVE_H
00028 #define OPENMS_MATH_STATISTICS_ROCCURVE_H
00029
00030 #include <OpenMS/config.h>
00031 #include <OpenMS/CONCEPT/Types.h>
00032
00033 #include <CGAL/Cartesian.h>
00034 #include <CGAL/Polygon_2.h>
00035
00036 #include <list>
00037 #include <vector>
00038
00039 namespace OpenMS
00040 {
00041 namespace Math
00042 {
00048 class ROCCurve
00049 {
00050 public:
00051
00052
00053
00055 ROCCurve();
00056
00058 virtual ~ROCCurve();
00059
00061 ROCCurve(const ROCCurve& source);
00062
00063
00064
00065
00067 ROCCurve& operator = (const ROCCurve& source);
00068
00069
00070
00071
00073 void insertPair(double score, bool clas);
00074
00076 double AUC();
00077
00079 std::vector<std::pair<double, double> > curve(UInt resolution = 10);
00080
00082 double cutoffPos(double fraction = 0.95);
00083
00085 double cutoffNeg(double fraction = 0.95);
00086
00087
00088 private:
00089
00090 typedef CGAL::Point_2<CGAL::Cartesian<double> > Point;
00091 typedef CGAL::Polygon_2<CGAL::Cartesian<double> > Polygon;
00092
00094 class simsortdec
00095 {
00096 public:
00097
00098 bool operator () (const std::pair<double,bool>& a, const std::pair<double,bool>& b)
00099 {
00100 return b.first < a.first;
00101 }
00102 };
00103
00104
00105 std::list<std::pair<double,bool> > score_clas_pairs_;
00106
00107 UInt pos_;
00108
00109 UInt neg_;
00110 };
00111 }
00112 }
00113 #endif // OPENMS_MATH_STATISTICS_ROCCURVE_H