PRCEvaluation.h

Go to the documentation of this file.
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 PRCEVALUATION_H_
00012 #define PRCEVALUATION_H_
00013 
00014 #include <shogun/evaluation/BinaryClassEvaluation.h>
00015 
00016 namespace shogun
00017 {
00018 
00019 class CLabels;
00020 
00025 class CPRCEvaluation: public CBinaryClassEvaluation
00026 {
00027 public:
00029     CPRCEvaluation() :
00030         CBinaryClassEvaluation(), m_PRC_graph(NULL),
00031         m_auPRC(0.0), m_PRC_length(0), m_computed(false) {};
00032 
00034     virtual ~CPRCEvaluation();
00035 
00037     virtual inline const char* get_name() const { return "PRCEvaluation"; };
00038 
00044     virtual float64_t evaluate(CLabels* predicted, CLabels* ground_truth);
00045 
00046     inline EEvaluationDirection get_evaluation_direction()
00047     {
00048         return ED_MAXIMIZE;
00049     }
00050 
00054     float64_t get_auPRC();
00055 
00059     SGMatrix<float64_t> get_PRC();
00060 
00064     SGVector<float64_t> get_thresholds();
00065 protected:
00066 
00068     float64_t* m_PRC_graph;
00069 
00071     float64_t* m_thresholds;
00072 
00074     float64_t m_auPRC;
00075 
00077     int32_t m_PRC_length;
00078 
00080     bool m_computed;
00081 };
00082 
00083 }
00084 
00085 #endif /* PRCEVALUATION_H_ */
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

SHOGUN Machine Learning Toolbox - Documentation