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
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/multiclass/GMNPSVM.h
>
20
#include <
shogun/classifier/mkl/MKLMulticlassGLPK.h
>
21
#include <
shogun/classifier/mkl/MKLMulticlassGradient.h
>
22
#include <
shogun/multiclass/MulticlassSVM.h
>
23
24
25
namespace
shogun
26
{
33
class
CMKLMulticlass
:
public
CMulticlassSVM
34
{
35
public
:
39
CMKLMulticlass
();
45
CMKLMulticlass
(
float64_t
C,
CKernel
* k,
CLabels
* lab);
46
47
51
virtual
~CMKLMulticlass
();
52
57
virtual
inline
EMachineType
get_classifier_type
()
58
{
return
CT_MKLMULTICLASS
; }
59
60
69
float64_t
*
getsubkernelweights
(int32_t & numweights);
70
78
void
set_mkl_epsilon
(
float64_t
eps );
79
87
void
set_max_num_mkliters
(int32_t maxnum);
88
92
virtual
void
set_mkl_norm
(
float64_t
norm
);
93
94
95
protected
:
100
CMKLMulticlass
(
const
CMKLMulticlass
& cm);
105
CMKLMulticlass
operator=
(
const
CMKLMulticlass
& cm);
106
111
void
initlpsolver
();
112
116
void
initsvm
();
117
118
119
120
126
virtual
bool
evaluatefinishcriterion
(
const
int32_t
127
numberofsilpiterations);
128
129
139
void
addingweightsstep
(
const
std::vector<float64_t> & curweights);
144
float64_t
getsumofsignfreealphas
();
151
float64_t
getsquarenormofprimalcoefficients
(
152
const
int32_t ind);
153
154
163
virtual
bool
train_machine
(
CFeatures
* data=NULL);
164
166
virtual
const
char
*
get_name
()
const
{
return
"MKLMulticlass"
; }
167
168
protected
:
173
CGMNPSVM
*
svm
;
177
MKLMulticlassOptimizationBase
*
lpw
;
181
::std::vector< std::vector< float64_t> >
weightshistory
;
182
186
float64_t
mkl_eps
;
190
int32_t
max_num_mkl_iters
;
194
float64_t
pnorm
;
198
std::vector<float64_t>
normweightssquared
;
199
200
};
201
}
202
#endif // GMNPMKL_H_
SHOGUN
Machine Learning Toolbox - Documentation