SHOGUN  3.2.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MulticlassModel.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 Thoralf Klein
8  * Written (W) 2012 Fernando José Iglesias García
9  * Copyright (C) 2012 Fernando José Iglesias García
10  */
11 
12 #ifndef _MULTICLASS_MODEL__H__
13 #define _MULTICLASS_MODEL__H__
14 
15 #include <shogun/lib/config.h>
16 
18 
19 namespace shogun
20 {
21 
28 {
29 
30  public:
33 
39  CMulticlassModel(CFeatures* features, CStructuredLabels* labels);
40 
42  virtual ~CMulticlassModel();
43 
45  virtual CStructuredLabels* structured_labels_factory(int32_t num_labels=0);
46 
51  virtual int32_t get_dim() const;
52 
66 
80  virtual CResultSet* argmax(SGVector< float64_t > w, int32_t feat_idx, bool const training = true);
81 
90 
103  virtual void init_primal_opt(
104  float64_t regularization,
109 
111  virtual const char* get_name() const { return "MulticlassModel"; }
112 
113  private:
114  void init();
115 
118  float64_t delta_loss(int32_t y1_idx, float64_t y2);
119 
120  private:
122  int32_t m_num_classes;
123 
124 }; /* MulticlassModel */
125 
126 } /* namespace shogun */
127 
128 #endif /* _MULTICLASS_MODEL__H__ */

SHOGUN Machine Learning Toolbox - Documentation