SHOGUN
3.2.1
首页
相关页面
模块
类
文件
文件列表
文件成员
全部
类
命名空间
文件
函数
变量
类型定义
枚举
枚举值
友元
宏定义
组
页
src
shogun
classifier
svm
SVMLin.h
浏览该文件的文档.
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) 2006-2009 Soeren Sonnenburg
8
* Copyright (C) 2006-2009 Fraunhofer Institute FIRST and Max-Planck-Society
9
*/
10
11
#ifndef _SVMLIN_H___
12
#define _SVMLIN_H___
13
14
#include <
shogun/lib/common.h
>
15
#include <
shogun/machine/LinearMachine.h
>
16
#include <
shogun/features/DotFeatures.h
>
17
#include <
shogun/labels/Labels.h
>
18
19
namespace
shogun
20
{
22
class
CSVMLin
:
public
CLinearMachine
23
{
24
public
:
25
27
MACHINE_PROBLEM_TYPE
(
PT_BINARY
);
28
30
CSVMLin
();
31
38
CSVMLin
(
39
float64_t
C,
CDotFeatures
* traindat,
40
CLabels
* trainlab);
41
virtual
~CSVMLin
();
42
47
virtual
EMachineType
get_classifier_type
() {
return
CT_SVMLIN
; }
48
55
inline
void
set_C
(
float64_t
c_neg,
float64_t
c_pos) {
C1
=c_neg;
C2
=c_pos; }
56
61
inline
float64_t
get_C1
() {
return
C1
; }
62
67
inline
float64_t
get_C2
() {
return
C2
; }
68
73
inline
void
set_bias_enabled
(
bool
enable_bias) {
use_bias
=enable_bias; }
74
79
inline
bool
get_bias_enabled
() {
return
use_bias
; }
80
85
inline
void
set_epsilon
(
float64_t
eps) {
epsilon
=eps; }
86
91
inline
float64_t
get_epsilon
() {
return
epsilon
; }
92
94
virtual
const
char
*
get_name
()
const
{
return
"SVMLin"
; }
95
96
protected
:
105
virtual
bool
train_machine
(
CFeatures
* data=NULL);
106
107
protected
:
109
float64_t
C1
;
111
float64_t
C2
;
113
float64_t
epsilon
;
114
116
bool
use_bias
;
117
};
118
}
119
#endif
SHOGUN
机器学习工具包 - 项目文档