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
MKLClassification.cpp
Go to the documentation of this file.
1
#include <
shogun/classifier/mkl/MKLClassification.h
>
2
#ifdef USE_SVMLIGHT
3
#include <
shogun/classifier/svm/SVMLight.h
>
4
#endif //USE_SVMLIGHT
5
#include <
shogun/classifier/svm/LibSVM.h
>
6
7
using namespace
shogun;
8
9
CMKLClassification::CMKLClassification
(
CSVM
* s) :
CMKL
(s)
10
{
11
if
(!s)
12
{
13
#ifdef USE_SVMLIGHT
14
s=
new
CSVMLight
();
15
#endif //USE_SVMLIGHT
16
if
(!s)
17
s=
new
CLibSVM
();
18
set_svm
(s);
19
}
20
}
21
22
CMKLClassification::~CMKLClassification
()
23
{
24
}
25
float64_t
CMKLClassification::compute_sum_alpha
()
26
{
27
float64_t
suma=0;
28
int32_t nsv=
svm
->
get_num_support_vectors
();
29
for
(int32_t i=0; i<nsv; i++)
30
suma+=
CMath::abs
(
svm
->
get_alpha
(i));
31
32
return
suma;
33
}
34
35
void
CMKLClassification::init_training
()
36
{
37
ASSERT
(
m_labels
&&
m_labels
->
get_num_labels
() &&
m_labels
->
get_label_type
() ==
LT_BINARY
)
38
}
SHOGUN
Machine Learning Toolbox - Documentation