SHOGUN
v2.0.0
Main Page
Related Pages
Modules
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
src
shogun
evaluation
MulticlassOVREvaluation.h
Go to the documentation of this file.
1
/*
2
* This program is free software; you can redistribute it and/or modify
3
* it under the terms of the GNU General Public License as published by
4
* the Free Software Foundation; either version 3 of the License, or
5
* (at your option) any later version.
6
*
7
* Copyright (C) 2012 Sergey Lisitsyn
8
*/
9
10
#ifndef MULTICLASSOVREVALUATION_H_
11
#define MULTICLASSOVREVALUATION_H_
12
13
#include <
shogun/evaluation/Evaluation.h
>
14
#include <
shogun/evaluation/BinaryClassEvaluation.h
>
15
#include <
shogun/labels/Labels.h
>
16
17
namespace
shogun
18
{
19
20
class
CLabels;
21
28
class
CMulticlassOVREvaluation
:
public
CEvaluation
29
{
30
public
:
32
CMulticlassOVREvaluation
();
33
35
CMulticlassOVREvaluation
(
CBinaryClassEvaluation
* binary_evaluation);
36
38
virtual
~CMulticlassOVREvaluation
();
39
41
void
set_binary_evaluation
(
CBinaryClassEvaluation
* binary_evaluation)
42
{
43
SG_REF
(binary_evaluation);
44
SG_UNREF
(
m_binary_evaluation
);
45
m_binary_evaluation
= binary_evaluation;
46
}
47
49
CBinaryClassEvaluation
*
get_binary_evaluation
()
50
{
51
SG_REF
(
m_binary_evaluation
);
52
return
m_binary_evaluation
;
53
}
54
60
virtual
float64_t
evaluate
(
CLabels
* predicted,
CLabels
* ground_truth);
61
63
SGVector<float64_t>
get_last_results
()
64
{
65
return
m_last_results
;
66
}
67
69
SGMatrix<float64_t>
get_graph_for_class
(int32_t class_idx)
70
{
71
ASSERT
(
m_graph_results
);
72
ASSERT
(class_idx>=0);
73
ASSERT
(class_idx<
m_num_graph_results
);
74
return
m_graph_results
[class_idx];
75
}
76
78
virtual
EEvaluationDirection
get_evaluation_direction
()
79
{
80
return
m_binary_evaluation
->
get_evaluation_direction
();
81
}
82
84
virtual
const
char
*
get_name
()
const
{
return
"MulticlassOVREvaluation"
; }
85
86
protected
:
87
89
CBinaryClassEvaluation
*
m_binary_evaluation
;
90
92
SGVector<float64_t>
m_last_results
;
93
95
SGMatrix<float64_t>
*
m_graph_results
;
96
98
int32_t
m_num_graph_results
;
99
100
};
101
102
}
103
104
#endif
/* MULTICLASSOVREVALUATION_H_ */
SHOGUN
Machine Learning Toolbox - Documentation