00001 /* 00002 * This program is free software; you can redistribute it and/or modify 00003 * it under the terms of the GNU General Public License as published by 00004 * the Free Software Foundation; either version 3 of the License, or 00005 * (at your option) any later version. 00006 * 00007 * Written (W) 2011 Sergey Lisitsyn 00008 * Copyright (C) 2011 Berlin Institute of Technology and Max-Planck-Society 00009 */ 00010 00011 #ifndef ROCEVALUATION_H_ 00012 #define ROCEVALUATION_H_ 00013 00014 #include <shogun/evaluation/BinaryClassEvaluation.h> 00015 00016 namespace shogun 00017 { 00018 00019 class CLabels; 00020 00031 class CROCEvaluation: public CBinaryClassEvaluation 00032 { 00033 public: 00035 CROCEvaluation() : 00036 CBinaryClassEvaluation(), m_ROC_graph(NULL), 00037 m_auROC(0.0), m_ROC_length(0), m_computed(false) {}; 00038 00040 virtual ~CROCEvaluation(); 00041 00043 virtual inline const char* get_name() const { return "ROCEvaluation"; }; 00044 00050 virtual float64_t evaluate(CLabels* predicted, CLabels* ground_truth); 00051 00052 inline EEvaluationDirection get_evaluation_direction() 00053 { 00054 return ED_MAXIMIZE; 00055 } 00056 00060 float64_t get_auROC(); 00061 00065 SGMatrix<float64_t> get_ROC(); 00066 00067 protected: 00068 00070 float64_t* m_ROC_graph; 00071 00073 float64_t m_auROC; 00074 00076 int32_t m_ROC_length; 00077 00079 bool m_computed; 00080 }; 00081 00082 } 00083 00084 #endif /* ROCEVALUATION_H_ */