SHOGUN  3.2.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
StudentsTLikelihood.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  * Code adapted from the GPML Toolbox:
12  * http://www.gaussianprocess.org/gpml/code/matlab/doc/
13  */
14 
15 #ifndef CSTUDENTSTLIKELIHOOD_H_
16 #define CSTUDENTSTLIKELIHOOD_H_
17 
18 #include <shogun/lib/config.h>
19 
20 #ifdef HAVE_EIGEN3
21 
23 
24 namespace shogun
25 {
26 
39 {
40 public:
43 
50 
51  virtual ~CStudentsTLikelihood();
52 
57  virtual const char* get_name() const { return "StudentsTLikelihood"; }
58 
63  float64_t get_sigma() { return m_sigma; }
64 
69  void set_sigma(float64_t sigma)
70  {
71  REQUIRE(sigma>0.0, "Scale parameter must be greater than zero\n")
72  m_sigma=sigma;
73  }
74 
79  float64_t get_degrees_freedom() { return m_df; }
80 
86  {
87  REQUIRE(df>1.0, "Number of degrees of freedom must be greater than one\n")
88  m_df=df;
89  }
90 
97 
113  SGVector<float64_t> s2, const CLabels* lab=NULL) const;
114 
130  SGVector<float64_t> s2, const CLabels* lab=NULL) const;
131 
137 
150  SGVector<float64_t> func) const;
151 
163  const CLabels* lab, SGVector<float64_t> func, index_t i) const;
164 
175  SGVector<float64_t> func, const TParameter* param) const;
176 
188  SGVector<float64_t> func, const TParameter* param) const;
189 
201  SGVector<float64_t> func, const TParameter* param) const;
202 
220  SGVector<float64_t> s2, const CLabels* lab) const;
221 
237  SGVector<float64_t> s2, const CLabels* lab, index_t i) const;
238 
254  SGVector<float64_t> s2, const CLabels* lab, index_t i) const;
255 
260  virtual bool supports_regression() const { return true; }
261 
262 private:
264  void init();
265 
267  float64_t m_sigma;
268 
270  float64_t m_df;
271 };
272 }
273 #endif /* HAVE_EIGEN3 */
274 #endif /* CSTUDENTSTLIKELIHOOD_H_ */

SHOGUN Machine Learning Toolbox - Documentation