SHOGUN  4.2.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
MultilabelModel.h
Go to the documentation of this file.
1 /*
2  * This software is distributed under BSD 3-clause license (see LICENSE file).
3  *
4  * Copyright (C) 2014 Abinash Panda
5  * Written (W) 2014 Abinash Panda
6  */
7 
8 #ifndef _MULTILABEL_MODEL__H__
9 #define _MULTILABEL_MODEL__H__
10 
11 #include <shogun/lib/config.h>
13 
14 namespace shogun
15 {
16 
25 {
26 public:
29 
35  CMultilabelModel(CFeatures * features, CStructuredLabels * labels);
36 
38  virtual ~CMultilabelModel();
39 
40 
42  virtual CStructuredLabels * structured_labels_factory(int32_t num_labels = 0);
43 
47  virtual int32_t get_dim() const;
48 
58  virtual SGVector<float64_t> get_joint_feature_vector(int32_t feat_idx,
59  CStructuredData * y);
60 
72  virtual CResultSet * argmax(SGVector<float64_t> w, int32_t feat_idx,
73  bool const training = true);
74 
83 
90  virtual void set_misclass_cost(float64_t false_positive,
91  float64_t false_negative);
92 
104  virtual void init_primal_opt(
105  float64_t regularization,
113 
115  virtual const char * get_name() const
116  {
117  return "MultilabelModel";
118  }
119 
120 private:
121  float64_t m_false_positive;
122  float64_t m_false_negative;
123  int32_t m_num_classes;
124 
125 private:
126  void init();
127 
131 
137  SGVector<int32_t> to_sparse(SGVector<float64_t> dense_vector,
138  float64_t d_true, float64_t d_false);
139 
140 }; /* class CMultilabelModel */
141 
142 } /* namespace shogun */
143 
144 #endif /* _MULTILABEL_MODEL__H__ */
145 
146 
147 
Base class of the labels used in Structured Output (SO) problems.
virtual void init_primal_opt(float64_t regularization, SGMatrix< float64_t > &A, SGVector< float64_t > a, SGMatrix< float64_t > B, SGVector< float64_t > &b, SGVector< float64_t > &lb, SGVector< float64_t > &ub, SGMatrix< float64_t > &C)
Class CMultilabelModel represents application specific model and contains application dependent logic...
virtual float64_t delta_loss(CStructuredData *y1, CStructuredData *y2)
virtual SGVector< float64_t > get_joint_feature_vector(int32_t feat_idx, CStructuredData *y)
virtual const char * get_name() const
double float64_t
Definition: common.h:50
virtual int32_t get_dim() const
Class CStructuredModel that represents the application specific model and contains most of the applic...
all of classes and functions are contained in the shogun namespace
Definition: class_list.h:18
The class Features is the base class of all feature objects.
Definition: Features.h:68
virtual void set_misclass_cost(float64_t false_positive, float64_t false_negative)
Base class of the components of StructuredLabels.
virtual CResultSet * argmax(SGVector< float64_t > w, int32_t feat_idx, bool const training=true)
virtual CStructuredLabels * structured_labels_factory(int32_t num_labels=0)

SHOGUN Machine Learning Toolbox - Documentation