SHOGUN  3.2.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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/lib/config.h>
15 
18 #include <shogun/lib/common.h>
20 
21 #include <shogun/lib/SGVector.h>
22 #include <shogun/lib/SGMatrix.h>
23 
24 namespace shogun
25 {
28 {
29  public:
32 
33  virtual ~CPositionalPWM();
34 
41  virtual bool train(CFeatures* data=NULL);
42 
47  virtual int32_t get_num_model_parameters();
48 
54  virtual float64_t get_log_model_parameter(int32_t num_param);
55 
63  int32_t num_param, int32_t num_example);
64 
72  virtual float64_t get_log_likelihood_example(int32_t num_example);
73 
79  float64_t get_log_likelihood_window(uint8_t* window, int32_t len, float64_t pos);
80 
83  virtual float64_t get_sigma()
84  {
85  return m_sigma;
86  }
87 
92  virtual void set_sigma(float64_t sigma)
93  {
94  m_sigma=sigma;
95  }
96 
99  virtual float64_t get_mean()
100  {
101  return m_mean;
102  }
103 
108  virtual void set_mean(float64_t mean)
109  {
110  m_mean=mean;
111  }
112 
117  virtual void set_pwm(SGMatrix<float64_t> pwm)
118  {
119  m_pwm = pwm;
120  }
121 
126  virtual SGMatrix<float64_t> get_pwm() const
127  {
128  return m_pwm;
129  }
130 
135  virtual SGMatrix<float64_t> get_w() const
136  {
137  return m_w;
138  }
139 
146  virtual SGMatrix<float64_t> get_scoring(int32_t d);
147 
151  void compute_w(int32_t num_pos);
152 
156  void compute_scoring(int32_t max_degree);
157 
159  virtual const char* get_name() const { return "PositionalPWM"; }
160 
161  private:
163  void register_params();
164 
165  protected:
166 
169 
172 
175 
178 
181 
182 };
183 }
184 #endif //_POSITIONAL_PWM_H__

SHOGUN Machine Learning Toolbox - Documentation