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
multiclass
ScatterSVM.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 Soeren Sonnenburg
8
* Written (W) 2009 Marius Kloft
9
* Copyright (C) 2009 TU Berlin and Max-Planck-Society
10
*/
11
12
#ifndef _SCATTERSVM_H___
13
#define _SCATTERSVM_H___
14
15
#include <
shogun/lib/common.h
>
16
#include <
shogun/lib/config.h
>
17
#include <
shogun/multiclass/MulticlassSVM.h
>
18
#include <shogun/lib/external/shogun_libsvm.h>
19
20
#include <stdio.h>
21
22
namespace
shogun
23
{
25
enum
SCATTER_TYPE
26
{
28
NO_BIAS_LIBSVM
,
29
#ifdef USE_SVMLIGHT
30
31
NO_BIAS_SVMLIGHT
,
32
#endif //USE_SVMLIGHT
33
34
TEST_RULE1
,
36
TEST_RULE2
37
};
38
53
class
CScatterSVM
:
public
CMulticlassSVM
54
{
55
public
:
57
CScatterSVM
();
58
60
CScatterSVM
(
SCATTER_TYPE
type);
61
68
CScatterSVM
(
float64_t
C,
CKernel
* k,
CLabels
* lab);
69
71
virtual
~CScatterSVM
();
72
77
virtual
EMachineType
get_classifier_type
() {
return
CT_SCATTERSVM
; }
78
84
virtual
float64_t
apply_one
(int32_t num);
85
90
virtual
CLabels
*
classify_one_vs_rest
();
91
93
virtual
const
char
*
get_name
()
const
{
return
"ScatterSVM"
; }
94
95
protected
:
104
virtual
bool
train_machine
(
CFeatures
* data=NULL);
105
106
private
:
107
void
compute_norm_wc();
108
virtual
bool
train_no_bias_libsvm();
109
#ifdef USE_SVMLIGHT
110
virtual
bool
train_no_bias_svmlight();
111
#endif //USE_SVMLIGHT
112
virtual
bool
train_testrule12();
113
114
protected
:
116
SCATTER_TYPE
scatter_type
;
117
119
svm_problem
problem
;
121
svm_parameter
param
;
122
124
struct
svm_model*
model
;
125
127
float64_t
*
norm_wc
;
128
130
float64_t
*
norm_wcw
;
131
133
float64_t
rho
;
134
136
int32_t
m_num_classes
;
137
};
138
}
139
#endif // ScatterSVM
SHOGUN
Machine Learning Toolbox - Documentation