SHOGUN
v3.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
classifier
mkl
MKLMulticlass.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) 2009 Alexander Binder
8
* Copyright (C) 2009 Fraunhofer Institute FIRST and Max-Planck-Society
9
*
10
* Update to patch 0.10.0 - thanks to Eric aka Yoo (thereisnoknife@gmail.com)
11
*
12
*/
13
14
#ifndef MKLMulticlass_H_
15
#define MKLMulticlass_H_
16
17
#include <vector>
18
19
#include <
shogun/base/SGObject.h
>
20
#include <
shogun/kernel/Kernel.h
>
21
#include <
shogun/kernel/CombinedKernel.h
>
22
#include <
shogun/multiclass/GMNPSVM.h
>
23
#include <
shogun/classifier/mkl/MKLMulticlassGLPK.h
>
24
#include <
shogun/classifier/mkl/MKLMulticlassGradient.h
>
25
#include <
shogun/multiclass/MulticlassSVM.h
>
26
27
28
namespace
shogun
29
{
30
37
class
CMKLMulticlass
:
public
CMulticlassSVM
38
{
39
public
:
41
CMKLMulticlass
();
47
CMKLMulticlass
(
float64_t
C,
CKernel
* k,
CLabels
* lab);
48
50
virtual
~CMKLMulticlass
();
51
56
virtual
inline
EMachineType
get_classifier_type
()
57
{
return
CT_MKLMULTICLASS
; }
58
67
float64_t
*
getsubkernelweights
(int32_t & numweights);
68
76
void
set_mkl_epsilon
(
float64_t
eps );
77
85
void
set_max_num_mkliters
(int32_t maxnum);
86
90
virtual
void
set_mkl_norm
(
float64_t
norm
);
91
92
protected
:
97
CMKLMulticlass
(
const
CMKLMulticlass
& cm);
98
103
CMKLMulticlass
operator=
(
const
CMKLMulticlass
& cm);
104
109
void
initlpsolver
();
110
114
void
initsvm
();
115
116
122
virtual
bool
evaluatefinishcriterion
(
const
int32_t
123
numberofsilpiterations);
124
125
135
void
addingweightsstep
(
const
std::vector<float64_t> & curweights);
136
141
float64_t
getsumofsignfreealphas
();
142
149
float64_t
getsquarenormofprimalcoefficients
(
150
const
int32_t ind);
151
160
virtual
bool
train_machine
(
CFeatures
* data=NULL);
161
163
virtual
const
char
*
get_name
()
const
{
return
"MKLMulticlass"
; }
164
165
protected
:
170
CGMNPSVM
*
svm
;
171
173
MKLMulticlassOptimizationBase
*
lpw
;
174
176
::std::vector< std::vector< float64_t> >
weightshistory
;
177
181
float64_t
mkl_eps
;
182
186
int32_t
max_num_mkl_iters
;
187
191
float64_t
pnorm
;
192
196
std::vector<float64_t>
normweightssquared
;
197
199
std::vector<float64_t>
oldnormweightssquared
;
200
202
float64_t
curalphaterm
;
204
float64_t
oldalphaterm
;
205
};
206
207
}
208
#endif // GMNPMKL_H_
SHOGUN
Machine Learning Toolbox - Documentation