SHOGUN  v2.0.0
 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) 2012 Fernando José Iglesias García
8  * Copyright (C) 2012 Fernando José Iglesias García
9  */
10 
11 #ifndef _MULTICLASS_MODEL__H__
12 #define _MULTICLASS_MODEL__H__
13 
15 
16 namespace shogun
17 {
18 
25 {
26 
27  public:
30 
36  CMulticlassModel(CFeatures* features, CStructuredLabels* labels);
37 
39  virtual ~CMulticlassModel();
40 
45  virtual int32_t get_dim() const;
46 
60 
74  virtual CResultSet* argmax(SGVector< float64_t > w, int32_t feat_idx, bool const training = true);
75 
84 
95  virtual void init_opt(
100 
102  virtual const char* get_name() const { return "MulticlassModel"; }
103 
133  virtual float64_t risk(float64_t* subgrad, float64_t* W, TMultipleCPinfo* info=0);
134 
135  private:
136  void init();
137 
140  float64_t delta_loss(int32_t y1_idx, float64_t y2);
141 
142  private:
144  int32_t m_num_classes;
145 
146 }; /* MulticlassModel */
147 
148 } /* namespace shogun */
149 
150 #endif /* _MULTICLASS_MODEL__H__ */

SHOGUN Machine Learning Toolbox - Documentation