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 00030 class CROCEvaluation: public CBinaryClassEvaluation 00031 { 00032 public: 00034 CROCEvaluation() : 00035 CBinaryClassEvaluation(), m_ROC_graph(NULL), 00036 m_auROC(0.0), m_ROC_length(0), m_computed(false) {}; 00037 00039 virtual ~CROCEvaluation(); 00040 00042 virtual inline const char* get_name() const { return "ROCEvaluation"; }; 00043 00049 virtual float64_t evaluate(CLabels* predicted, CLabels* ground_truth); 00050 00051 inline EEvaluationDirection get_evaluation_direction() 00052 { 00053 return ED_MAXIMIZE; 00054 } 00055 00059 float64_t get_auROC(); 00060 00064 SGMatrix<float64_t> get_ROC(); 00065 00069 SGVector<float64_t> get_thresholds(); 00070 00071 protected: 00072 00074 float64_t* m_ROC_graph; 00075 00077 float64_t* m_thresholds; 00078 00080 float64_t m_auROC; 00081 00083 int32_t m_ROC_length; 00084 00086 bool m_computed; 00087 }; 00088 00089 } 00090 00091 #endif /* ROCEVALUATION_H_ */