SHOGUN  3.2.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MulticlassSOLabels.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_SO_LABELS__H__
13 #define _MULTICLASS_SO_LABELS__H__
14 
16 #include <shogun/lib/SGVector.h>
19 
20 namespace shogun
21 {
22 
23 class CStructuredLabels;
24 class CMulticlassSOLabels;
25 
32 {
35 
41 
47  {
48  if ( base_data->get_structured_data_type() == SDT_REAL )
49  return (CRealNumber*) base_data;
50  else
51  SG_SERROR("base_data must be of dynamic type CRealNumber\n")
52 
53  return NULL;
54  }
55 
57  virtual const char* get_name() const { return "RealNumber"; }
58 
61 };
62 
69 {
70  public:
73 
78  CMulticlassSOLabels(int32_t num_labels);
79 
85 
87  virtual ~CMulticlassSOLabels();
88 
93  inline int32_t get_num_classes() { return m_num_classes; }
94 
103  virtual void add_label(CStructuredData* label);
104 
111  virtual CStructuredData* get_label(int32_t idx);
112 
123  virtual bool set_label(int32_t idx, CStructuredData* label);
124 
129  virtual int32_t get_num_labels() const;
130 
132  virtual const char* get_name() const { return "MulticlassSOLabels"; }
133 
134  private:
135  void init();
136 
137  private:
139  int32_t m_num_classes;
140 
141  SGVector< float64_t > m_labels_vector;
142  int32_t m_num_labels_set;
143 
144 }; /* CMulticlassSOLabels */
145 
146 } /* namespace shogun */
147 
148 #endif /* _MULTICLASS_SO_LABELS__H__ */

SHOGUN Machine Learning Toolbox - Documentation