SHOGUN  4.1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
LikelihoodModel.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  * Written (W) 2013 Heiko Strathmann
9  * Copyright (C) 2012 Jacob Walker
10  * Copyright (C) 2013 Roman Votyakov
11  */
12 
13 #ifndef CLIKELIHOODMODEL_H_
14 #define CLIKELIHOODMODEL_H_
15 
16 #include <shogun/lib/config.h>
17 
18 #include <shogun/base/SGObject.h>
19 #include <shogun/labels/Labels.h>
20 #include <shogun/lib/SGMatrix.h>
21 
22 namespace shogun
23 {
24 
27 {
34 };
35 
42 {
43 public:
46 
47  virtual ~CLikelihoodModel();
48 
78  const CLabels* lab=NULL);
79 
95  SGVector<float64_t> s2, const CLabels* lab=NULL) const=0;
96 
112  SGVector<float64_t> s2, const CLabels* lab=NULL) const=0;
113 
118  virtual ELikelihoodModelType get_model_type() const { return LT_NONE; }
119 
132  SGVector<float64_t> func) const=0;
133 
147  SGMatrix<float64_t> F) const;
148 
160  const CLabels* lab, SGVector<float64_t> func, index_t i) const=0;
161 
172  SGVector<float64_t> func, const TParameter* param) const
173  {
174  SG_ERROR("Can't compute derivative wrt %s parameter\n", param->m_name)
175  return SGVector<float64_t>();
176  }
177 
178 
190  SGVector<float64_t> func, const TParameter* param) const
191  {
192  SG_ERROR("Can't compute derivative wrt %s parameter\n", param->m_name)
193  return SGVector<float64_t>();
194  }
195 
207  SGVector<float64_t> func, const TParameter* param) const
208  {
209  SG_ERROR("Can't compute derivative wrt %s parameter\n", param->m_name)
210  return SGVector<float64_t>();
211  }
212 
230  SGVector<float64_t> s2, const CLabels* lab) const=0;
231 
247  SGVector<float64_t> s2, const CLabels* lab, index_t i) const=0;
248 
263  SGVector<float64_t> s2, const CLabels* lab) const;
264 
280  SGVector<float64_t> s2, const CLabels* lab, index_t i) const=0;
281 
296  SGVector<float64_t> s2, const CLabels* lab) const;
297 
302  virtual bool supports_regression() const { return false; }
303 
308  virtual bool supports_binary() const { return false; }
309 
314  virtual bool supports_multiclass() const { return false; }
315 };
316 }
317 #endif /* CLIKELIHOODMODEL_H_ */
virtual SGVector< float64_t > get_first_moments(SGVector< float64_t > mu, SGVector< float64_t > s2, const CLabels *lab) const
virtual SGVector< float64_t > get_log_probability_f(const CLabels *lab, SGVector< float64_t > func) const =0
ELikelihoodModelType
virtual bool supports_multiclass() const
int32_t index_t
Definition: common.h:62
The class Labels models labels, i.e. class assignments of objects.
Definition: Labels.h:43
virtual SGVector< float64_t > get_second_derivative(const CLabels *lab, SGVector< float64_t > func, const TParameter *param) const
virtual ELikelihoodModelType get_model_type() const
parameter struct
#define SG_ERROR(...)
Definition: SGIO.h:129
virtual SGVector< float64_t > get_log_zeroth_moments(SGVector< float64_t > mu, SGVector< float64_t > s2, const CLabels *lab) const =0
virtual SGVector< float64_t > get_predictive_variances(SGVector< float64_t > mu, SGVector< float64_t > s2, const CLabels *lab=NULL) const =0
virtual SGVector< float64_t > get_second_moments(SGVector< float64_t > mu, SGVector< float64_t > s2, const CLabels *lab) const
virtual float64_t get_second_moment(SGVector< float64_t > mu, SGVector< float64_t > s2, const CLabels *lab, index_t i) const =0
virtual SGVector< float64_t > get_log_probability_fmatrix(const CLabels *lab, SGMatrix< float64_t > F) const
virtual SGVector< float64_t > get_predictive_log_probabilities(SGVector< float64_t > mu, SGVector< float64_t > s2, const CLabels *lab=NULL)
Class SGObject is the base class of all shogun objects.
Definition: SGObject.h:112
double float64_t
Definition: common.h:50
virtual bool supports_regression() const
virtual bool supports_binary() const
all of classes and functions are contained in the shogun namespace
Definition: class_list.h:18
virtual SGVector< float64_t > get_log_probability_derivative_f(const CLabels *lab, SGVector< float64_t > func, index_t i) const =0
virtual SGVector< float64_t > get_predictive_means(SGVector< float64_t > mu, SGVector< float64_t > s2, const CLabels *lab=NULL) const =0
virtual SGVector< float64_t > get_third_derivative(const CLabels *lab, SGVector< float64_t > func, const TParameter *param) const
virtual float64_t get_first_moment(SGVector< float64_t > mu, SGVector< float64_t > s2, const CLabels *lab, index_t i) const =0
virtual SGVector< float64_t > get_first_derivative(const CLabels *lab, SGVector< float64_t > func, const TParameter *param) const
The Likelihood model base class.

SHOGUN Machine Learning Toolbox - Documentation