SHOGUN  4.1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
GaussianLikelihood.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) 2013 Roman Votyakov
8  * Copyright (C) 2012 Jacob Walker
9  * Copyright (C) 2013 Roman Votyakov
10  */
11 
12 #ifndef CGAUSSIANLIKELIHOOD_H_
13 #define CGAUSSIANLIKELIHOOD_H_
14 
15 #include <shogun/lib/config.h>
17 
18 #ifdef HAVE_EIGEN3
19 
21 
22 namespace shogun
23 {
24 
36 {
37 public:
40 
46 
47  virtual ~CGaussianLikelihood();
48 
53  virtual const char* get_name() const { return "GaussianLikelihood"; }
54 
59  float64_t get_sigma() { return CMath::exp(m_log_sigma); }
60 
65  void set_sigma(float64_t sigma)
66  {
67  REQUIRE(sigma>0.0, "Standard deviation (%f) must be greater than zero\n",
68  sigma)
69  m_log_sigma=CMath::log(sigma);
70  }
71 
78 
95  SGVector<float64_t> s2, const CLabels* lab=NULL) const;
96 
112  SGVector<float64_t> s2, const CLabels* lab=NULL) const;
113 
118  virtual ELikelihoodModelType get_model_type() const { return LT_GAUSSIAN; }
119 
132  SGVector<float64_t> func) const;
133 
145  const CLabels* lab, SGVector<float64_t> func, index_t i) const;
146 
157  SGVector<float64_t> func, const TParameter* param) const;
158 
170  SGVector<float64_t> func, const TParameter* param) const;
171 
183  SGVector<float64_t> func, const TParameter* param) const;
184 
202  SGVector<float64_t> s2, const CLabels* lab) const;
203 
219  SGVector<float64_t> s2, const CLabels* lab, index_t i) const;
220 
236  SGVector<float64_t> s2, const CLabels* lab, index_t i) const;
237 
242  virtual bool supports_regression() const { return true; }
243 
244 private:
246  void init();
247 
249  float64_t m_log_sigma;
250 };
251 }
252 #endif /* HAVE_EIGEN3 */
253 #endif /* CGAUSSIANLIKELIHOOD_H_ */
ELikelihoodModelType
Class that models Gaussian likelihood.
virtual SGVector< float64_t > get_log_probability_f(const CLabels *lab, SGVector< float64_t > func) const
int32_t index_t
Definition: common.h:62
The class Labels models labels, i.e. class assignments of objects.
Definition: Labels.h:43
parameter struct
#define REQUIRE(x,...)
Definition: SGIO.h:206
void set_sigma(float64_t sigma)
virtual float64_t get_second_moment(SGVector< float64_t > mu, SGVector< float64_t > s2, const CLabels *lab, index_t i) const
virtual ELikelihoodModelType get_model_type() const
virtual SGVector< float64_t > get_first_derivative(const CLabels *lab, SGVector< float64_t > func, const TParameter *param) const
virtual SGVector< float64_t > get_predictive_variances(SGVector< float64_t > mu, SGVector< float64_t > s2, const CLabels *lab=NULL) const
virtual SGVector< float64_t > get_predictive_means(SGVector< float64_t > mu, SGVector< float64_t > s2, const CLabels *lab=NULL) const
double float64_t
Definition: common.h:50
virtual const char * get_name() const
virtual float64_t get_first_moment(SGVector< float64_t > mu, SGVector< float64_t > s2, const CLabels *lab, index_t i) const
static CGaussianLikelihood * obtain_from_generic(CLikelihoodModel *lik)
virtual SGVector< float64_t > get_second_derivative(const CLabels *lab, SGVector< float64_t > func, const TParameter *param) const
virtual SGVector< float64_t > get_log_zeroth_moments(SGVector< float64_t > mu, SGVector< float64_t > s2, const CLabels *lab) const
all of classes and functions are contained in the shogun namespace
Definition: class_list.h:18
static float64_t exp(float64_t x)
Definition: Math.h:621
static float64_t log(float64_t v)
Definition: Math.h:922
virtual SGVector< float64_t > get_log_probability_derivative_f(const CLabels *lab, SGVector< float64_t > func, index_t i) const
virtual bool supports_regression() const
virtual SGVector< float64_t > get_third_derivative(const CLabels *lab, SGVector< float64_t > func, const TParameter *param) const
The Likelihood model base class.

SHOGUN Machine Learning Toolbox - Documentation