SHOGUN  3.2.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MultilabelCLRModel.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 Thoralf Klein
5  * Written(W) 2014 Thoralf Klein
6  * Written(W) 2014 Abinash Panda
7  */
8 
9 #ifndef _MULTILABEL_CLR_MODEL__H__
10 #define _MULTILABEL_CLR_MODEL__H__
11 
12 #include <shogun/lib/config.h>
14 
15 namespace shogun
16 {
17 
26 {
27 public:
30 
36  CMultilabelCLRModel(CFeatures * features, CStructuredLabels * labels);
37 
39  virtual ~CMultilabelCLRModel();
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 
95  virtual void init_primal_opt(
96  float64_t regularization,
104 
106  virtual const char * get_name() const
107  {
108  return "MultilabelCLRModel";
109  }
110 
111 private:
112  int32_t m_num_classes;
113 
114 private:
115  void init();
116 
120 
126  SGVector<int32_t> to_sparse(SGVector<float64_t> dense_vector,
127  float64_t d_true, float64_t d_false);
128 
129 }; /* class CMultilabelCLRModel */
130 
131 } /* namespace shogun */
132 
133 #endif /* _MULTILABEL_CLR_MODEL__H__ */
134 

SHOGUN Machine Learning Toolbox - Documentation