SHOGUN
v2.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
distributions
PositionalPWM.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) 2011 Soeren Sonnenburg
8
* Copyright (C) 2011 Berlin Institute of Technology and Max-Planck-Society
9
*/
10
11
#ifndef _POSITIONAL_PWM_H__
12
#define _POSITIONAL_PWM_H__
13
14
#include <
shogun/distributions/Distribution.h
>
15
#include <
shogun/features/StringFeatures.h
>
16
#include <
shogun/lib/common.h
>
17
#include <
shogun/mathematics/Math.h
>
18
19
namespace
shogun
20
{
22
class
CPositionalPWM
:
public
CDistribution
23
{
24
public
:
26
CPositionalPWM
();
27
28
virtual
~CPositionalPWM
();
29
36
virtual
bool
train
(
CFeatures
* data=NULL);
37
42
virtual
int32_t
get_num_model_parameters
();
43
49
virtual
float64_t
get_log_model_parameter
(int32_t num_param);
50
57
virtual
float64_t
get_log_derivative
(
58
int32_t num_param, int32_t num_example);
59
67
virtual
float64_t
get_log_likelihood_example
(int32_t num_example);
68
74
float64_t
get_log_likelihood_window
(uint8_t* window, int32_t len,
float64_t
pos);
75
78
virtual
float64_t
get_sigma
()
79
{
80
return
m_sigma
;
81
}
82
87
virtual
void
set_sigma
(
float64_t
sigma)
88
{
89
m_sigma
=sigma;
90
}
91
94
virtual
float64_t
get_mean
()
95
{
96
return
m_mean
;
97
}
98
103
virtual
void
set_mean
(
float64_t
mean)
104
{
105
m_mean
=mean;
106
}
107
112
virtual
void
set_pwm
(
SGMatrix<float64_t>
pwm)
113
{
114
m_pwm
= pwm;
115
}
116
121
virtual
SGMatrix<float64_t>
get_pwm
()
const
122
{
123
return
m_pwm
;
124
}
125
130
virtual
SGMatrix<float64_t>
get_w
()
const
131
{
132
return
m_w
;
133
}
134
141
virtual
SGMatrix<float64_t>
get_scoring
(int32_t d);
142
146
void
compute_w
(int32_t num_pos);
147
151
void
compute_scoring
(int32_t max_degree);
152
154
inline
virtual
const
char
*
get_name
()
const
{
return
"PositionalPWM"
; }
155
156
private
:
158
void
register_params();
159
160
protected
:
161
163
SGMatrix<float64_t>
m_pwm
;
164
166
float64_t
m_sigma
;
167
169
float64_t
m_mean
;
170
172
SGMatrix<float64_t>
m_w
;
173
175
SGVector<float64_t>
m_poim
;
176
177
};
178
}
179
#endif //_POSITIONAL_PWM_H__
SHOGUN
Machine Learning Toolbox - Documentation