SHOGUN
v1.1.0
Main Page
Related Pages
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
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
11
#ifndef MKLMULTICLASS_H_
12
#define MKLMULTICLASS_H_
13
14
#include <vector>
15
16
#include <
shogun/base/SGObject.h
>
17
#include <
shogun/kernel/Kernel.h
>
18
#include <
shogun/kernel/CombinedKernel.h
>
19
#include <
shogun/classifier/svm/GMNPSVM.h
>
20
#include <
shogun/classifier/mkl/MKLMultiClassGLPK.h
>
21
#include <
shogun/classifier/mkl/MKLMultiClassGradient.h
>
22
23
24
namespace
shogun
25
{
32
class
CMKLMultiClass
:
public
CMultiClassSVM
33
{
34
public
:
38
CMKLMultiClass
();
44
CMKLMultiClass
(
float64_t
C,
CKernel
* k,
CLabels
* lab);
45
46
50
virtual
~CMKLMultiClass
();
51
56
virtual
inline
EClassifierType
get_classifier_type
()
57
{
return
CT_MKLMULTICLASS
; }
58
59
68
float64_t
*
getsubkernelweights
(int32_t & numweights);
69
77
void
set_mkl_epsilon
(
float64_t
eps );
78
86
void
set_max_num_mkliters
(int32_t maxnum);
87
91
virtual
void
set_mkl_norm
(
float64_t
norm);
92
93
94
protected
:
99
CMKLMultiClass
(
const
CMKLMultiClass
& cm);
104
CMKLMultiClass
operator=
(
const
CMKLMultiClass
& cm);
105
110
void
initlpsolver
();
111
115
void
initsvm
();
116
117
118
119
125
virtual
bool
evaluatefinishcriterion
(
const
int32_t
126
numberofsilpiterations);
127
128
138
void
addingweightsstep
(
const
std::vector<float64_t> & curweights);
143
float64_t
getsumofsignfreealphas
();
150
float64_t
getsquarenormofprimalcoefficients
(
151
const
int32_t ind);
152
153
162
virtual
bool
train_machine
(
CFeatures
* data=NULL);
163
164
165
protected
:
170
CGMNPSVM
*
svm
;
174
MKLMultiClassOptimizationBase
*
lpw
;
178
::std::vector< std::vector< float64_t> >
weightshistory
;
179
183
float64_t
mkl_eps
;
187
int32_t
max_num_mkl_iters
;
191
float64_t
pnorm
;
195
std::vector<float64_t>
normweightssquared
;
196
197
};
198
}
199
#endif // GMNPMKL_H_
SHOGUN
Machine Learning Toolbox - Documentation