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