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
multiclass
MulticlassOneVsRestStrategy.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
* Written (W) 2012 Chiyuan Zhang
8
* Copyright (C) 2012 Chiyuan Zhang
9
*/
10
11
#ifndef MULTICLASSONEVSRESTSTRATEGY_H__
12
#define MULTICLASSONEVSRESTSTRATEGY_H__
13
14
#include <
shogun/multiclass/MulticlassStrategy.h
>
15
16
namespace
shogun
17
{
18
25
class
CMulticlassOneVsRestStrategy
:
public
CMulticlassStrategy
26
{
27
public
:
29
CMulticlassOneVsRestStrategy
();
30
32
virtual
~CMulticlassOneVsRestStrategy
() {}
33
35
virtual
void
train_start
(
CMulticlassLabels
*orig_labels,
CBinaryLabels
*train_labels)
36
{
37
CMulticlassStrategy::train_start
(orig_labels, train_labels);
38
}
39
41
virtual
bool
train_has_more
()
42
{
43
return
m_train_iter
<
m_num_classes
;
44
}
45
49
virtual
SGVector<int32_t>
train_prepare_next
();
50
54
virtual
int32_t
decide_label
(
SGVector<float64_t>
outputs);
55
60
virtual
SGVector<index_t>
decide_label_multiple_output
(
SGVector<float64_t>
outputs, int32_t n_outputs);
61
64
virtual
int32_t
get_num_machines
()
65
{
66
return
m_num_classes
;
67
}
68
70
virtual
const
char
*
get_name
()
const
71
{
72
return
"MulticlassOneVsRestStrategy"
;
73
};
74
75
};
76
77
}
// namespace shogun
78
79
#endif
/* end of include guard: MULTICLASSONEVSRESTSTRATEGY_H__ */
80
SHOGUN
Machine Learning Toolbox - Documentation