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
machine
LinearMachine.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) 1999-2009 Soeren Sonnenburg
8
* Copyright (C) 1999-2009 Fraunhofer Institute FIRST and Max-Planck-Society
9
*/
10
11
#ifndef _LINEARCLASSIFIER_H__
12
#define _LINEARCLASSIFIER_H__
13
14
#include <
shogun/lib/common.h
>
15
#include <
shogun/labels/Labels.h
>
16
#include <
shogun/features/DotFeatures.h
>
17
#include <
shogun/machine/Machine.h
>
18
19
#include <stdio.h>
20
21
namespace
shogun
22
{
23
class
CDotFeatures;
24
class
CMachine;
25
class
CLabels;
26
61
class
CLinearMachine
:
public
CMachine
62
{
63
public
:
65
CLinearMachine
();
66
68
virtual
~CLinearMachine
();
69
71
CLinearMachine
(
CLinearMachine
* machine);
72
77
virtual
SGVector<float64_t>
get_w
()
const
;
78
83
virtual
void
set_w
(
const
SGVector<float64_t>
src_w);
84
89
virtual
void
set_bias
(
float64_t
b);
90
95
virtual
float64_t
get_bias
();
96
101
virtual
void
set_features
(
CDotFeatures
* feat);
102
109
virtual
CBinaryLabels
*
apply_binary
(
CFeatures
* data=NULL);
110
117
virtual
CRegressionLabels
*
apply_regression
(
CFeatures
* data=NULL);
118
120
virtual
float64_t
apply_one
(int32_t vec_idx);
121
126
virtual
CDotFeatures
*
get_features
();
127
133
virtual
const
char
*
get_name
()
const
{
return
"LinearMachine"
; }
134
135
protected
:
136
142
virtual
SGVector<float64_t>
apply_get_outputs
(
CFeatures
* data);
143
148
virtual
void
store_model_features
();
149
150
private
:
151
152
void
init();
153
154
protected
:
156
SGVector<float64_t>
w
;
158
float64_t
bias
;
160
CDotFeatures
*
features
;
161
};
162
}
163
#endif
SHOGUN
Machine Learning Toolbox - Documentation