Home  · Classes  · Annotated Classes  · Modules  · Members  · Namespaces  · Related Pages

ROCCurve.h (Maintainer: Andreas Bertsch)

Go to the documentation of this file.
00001 // -*- Mode: C++; tab-width: 2; -*-
00002 // vi: set ts=2:
00003 //
00004 // --------------------------------------------------------------------------
00005 //                   OpenMS Mass Spectrometry Framework
00006 // --------------------------------------------------------------------------
00007 //  Copyright (C) 2003-2008 -- Oliver Kohlbacher, Knut Reinert
00008 //
00009 //  This library is free software; you can redistribute it and/or
00010 //  modify it under the terms of the GNU Lesser General Public
00011 //  License as published by the Free Software Foundation; either
00012 //  version 2.1 of the License, or (at your option) any later version.
00013 //
00014 //  This library is distributed in the hope that it will be useful,
00015 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
00016 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00017 //  Lesser General Public License for more details.
00018 //
00019 //  You should have received a copy of the GNU Lesser General Public
00020 //  License along with this library; if not, write to the Free Software
00021 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00022 //
00023 // --------------------------------------------------------------------------
00024 // $Maintainer: Andreas Bertsch $
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       // @name Constructors and Destructors
00053       // @{
00055       ROCCurve();
00056   
00058       virtual ~ROCCurve();
00059   
00061       ROCCurve(const ROCCurve& source);
00062       // @}
00063   
00064       // @name Operators
00065       // @{
00067       ROCCurve& operator = (const ROCCurve& source);
00068       // @}
00069   
00070       // @name Accessors
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

Generated Tue Apr 1 15:36:37 2008 -- using doxygen 1.5.4 OpenMS / TOPP 1.1