iRoCS Toolbox  1.1.0
ClassificationStatistics.hh
Go to the documentation of this file.
1 /**************************************************************************
2  *
3  * Copyright (C) 2004-2015 Olaf Ronneberger, Florian Pigorsch, Jörg Mechnich,
4  * Thorsten Falk
5  *
6  * Image Analysis Lab, University of Freiburg, Germany
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 3 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, write to the Free Software Foundation,
20  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21  *
22  **************************************************************************/
23 
24 /**************************************************************************
25 ** Title:
26 ** $RCSfile$
27 ** $Revision: 754 $$Name$
28 ** $Date: 2005-10-26 08:59:17 +0200 (Wed, 26 Oct 2005) $
29 ** Copyright: GPL $Author: ronneber $
30 ** Description:
31 **
32 **
33 **
34 **-------------------------------------------------------------------------
35 **
36 ** $Log$
37 ** Revision 1.2 2005/10/26 06:59:17 ronneber
38 ** - added prettyPrintConfusionTable()
39 **
40 ** Revision 1.1 2004/08/26 08:36:58 ronneber
41 ** initital import
42 **
43 **
44 **
45 **************************************************************************/
46 
47 #ifndef CLASSIFICATIONSTATISTICS_HH
48 #define CLASSIFICATIONSTATISTICS_HH
49 
50 #ifdef HAVE_CONFIG_H
51 #include <config.hh>
52 #endif
53 
54 #include <vector>
55 #include <iostream>
56 
57 namespace svt
58 {
60  {
62  : label(0),
63  truePositives(0),
64  trueNumber(0),
66  {}
67 
68  int label;
72  };
73 
75  {
76  public:
77  /*======================================================================*/
88  /*======================================================================*/
89  void calcStatistics( const std::vector<double>& trueLabels,
90  const std::vector<double>& predictedLabels,
91  std::vector<SingleClassResult>& resultTable);
92 
93  void prettyPrintStatistics(
94  const std::vector<SingleClassResult>& resultTable, std::ostream& os );
95 
96  void prettyPrintConfusionTable(
97  const std::vector<double>& trueLabels,
98  const std::vector<double>& predictedLabels,
99  std::ostream& os);
100 
101  };
102 }
103 
104 
105 #endif
106