SHOGUN  v2.0.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PrimalMosekSOSVM.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 _PRIMAL_MOSEK_SOSVM__H__
12 #define _PRIMAL_MOSEK_SOSVM__H__
13 
14 #ifdef USE_MOSEK
15 
19 
20 namespace shogun
21 {
22 
33 class CPrimalMosekSOSVM : public CLinearStructuredOutputMachine
34 {
35  public:
37  CPrimalMosekSOSVM();
38 
45  CPrimalMosekSOSVM(CStructuredModel* model, CLossFunction* loss, CStructuredLabels* labs);
46 
48  ~CPrimalMosekSOSVM();
49 
54  inline SGVector< float64_t > get_slacks() const { return m_slacks; }
55 
57  virtual const char* get_name() const { return "PrimalMosekSOSVM"; }
58 
59  protected:
65  virtual bool train_machine(CFeatures* data = NULL);
66 
67  private:
68  void init();
69 
75  float64_t compute_loss_arg(CResultSet* result) const;
76 
82  bool insert_result(CList* result_list, CResultSet* result) const;
83 
107  bool add_constraint(CMosek* mosek, CResultSet* result, index_t con_idx, index_t train_idx) const;
108 
109  private:
111  SGVector< float64_t > m_slacks;
112 
113 }; /* class CPrimalMosekSOSVM */
114 
115 } /* namespace shogun */
116 
117 #endif /* USE_MOSEK */
118 #endif /* _PRIMAL_MOSEK_SOSVM__H__ */

SHOGUN Machine Learning Toolbox - Documentation