SHOGUN  5.0.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules
LikelihoodModel.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) The Shogun Machine Learning Toolbox
3  * Written (W) 2013 Heiko Strathmann
4  * Written (W) 2013 Roman Votyakov
5  * Written (W) 2012 Jacob Walker
6  * All rights reserved.
7  *
8  * Redistribution and use in source and binary forms, with or without
9  * modification, are permitted provided that the following conditions are met:
10  *
11  * 1. Redistributions of source code must retain the above copyright notice, this
12  * list of conditions and the following disclaimer.
13  * 2. Redistributions in binary form must reproduce the above copyright notice,
14  * this list of conditions and the following disclaimer in the documentation
15  * and/or other materials provided with the distribution.
16  *
17  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
18  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20  * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
21  * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
24  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
26  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27  *
28  * The views and conclusions contained in the software and documentation are those
29  * of the authors and should not be interpreted as representing official policies,
30  * either expressed or implied, of the Shogun Development Team.
31  *
32  */
33 
34 #ifndef CLIKELIHOODMODEL_H_
35 #define CLIKELIHOODMODEL_H_
36 
37 #include <shogun/lib/config.h>
38 
39 #include <shogun/base/SGObject.h>
40 #include <shogun/labels/Labels.h>
41 #include <shogun/lib/SGMatrix.h>
42 
43 namespace shogun
44 {
45 
48 {
55 };
56 
63 {
64 public:
67 
68  virtual ~CLikelihoodModel();
69 
99  const CLabels* lab=NULL);
100 
116  SGVector<float64_t> s2, const CLabels* lab=NULL) const=0;
117 
133  SGVector<float64_t> s2, const CLabels* lab=NULL) const=0;
134 
139  virtual ELikelihoodModelType get_model_type() const { return LT_NONE; }
140 
153  SGVector<float64_t> func) const=0;
154 
168  SGMatrix<float64_t> F) const;
169 
181  const CLabels* lab, SGVector<float64_t> func, index_t i) const=0;
182 
193  SGVector<float64_t> func, const TParameter* param) const
194  {
195  SG_ERROR("Can't compute derivative wrt %s parameter\n", param->m_name)
196  return SGVector<float64_t>();
197  }
198 
199 
211  SGVector<float64_t> func, const TParameter* param) const
212  {
213  SG_ERROR("Can't compute derivative wrt %s parameter\n", param->m_name)
214  return SGVector<float64_t>();
215  }
216 
228  SGVector<float64_t> func, const TParameter* param) const
229  {
230  SG_ERROR("Can't compute derivative wrt %s parameter\n", param->m_name)
231  return SGVector<float64_t>();
232  }
233 
251  SGVector<float64_t> s2, const CLabels* lab) const=0;
252 
268  SGVector<float64_t> s2, const CLabels* lab, index_t i) const=0;
269 
284  SGVector<float64_t> s2, const CLabels* lab) const;
285 
301  SGVector<float64_t> s2, const CLabels* lab, index_t i) const=0;
302 
317  SGVector<float64_t> s2, const CLabels* lab) const;
318 
323  virtual bool supports_regression() const { return false; }
324 
329  virtual bool supports_binary() const { return false; }
330 
335  virtual bool supports_multiclass() const { return false; }
336 };
337 }
338 #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:115
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