SHOGUN  3.2.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Labels.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) 1999-2009 Soeren Sonnenburg
8  * Written (W) 1999-2008 Gunnar Raetsch
9  * Written (W) 2011-2012 Heiko Strathmann
10  * Copyright (C) 1999-2009 Fraunhofer Institute FIRST and Max-Planck-Society
11  */
12 
13 #ifndef _LABELS__H__
14 #define _LABELS__H__
15 
16 #include <shogun/lib/common.h>
17 #include <shogun/base/SGObject.h>
21 
22 namespace shogun
23 {
35 class CLabels : public CSGObject
36 {
37  public:
39  CLabels();
40 
42  virtual ~CLabels();
43 
50  virtual void ensure_valid(const char* context=NULL)=0;
51 
56  virtual int32_t get_num_labels() const=0;
57 
62  virtual ELabelType get_label_type() const=0;
63 
69  virtual void add_subset(SGVector<index_t> subset);
70 
73  virtual void remove_subset();
74 
77  virtual void remove_all_subsets();
78 
84  virtual void set_value(float64_t value, int32_t idx);
85 
91  virtual float64_t get_value(int32_t idx);
92 
98  virtual void set_values(SGVector<float64_t> values);
99 
105 
106  private:
107  void init();
108 
109  protected:
110 
113 
116 };
117 }
118 #endif
virtual float64_t get_value(int32_t idx)
Definition: Labels.cpp:55
virtual void remove_all_subsets()
Definition: Labels.cpp:50
virtual ELabelType get_label_type() const =0
The class Labels models labels, i.e. class assignments of objects.
Definition: Labels.h:35
virtual int32_t get_num_labels() const =0
CSubsetStack * m_subset_stack
Definition: Labels.h:112
class to add subset support to another class. A CSubsetStackStack instance should be added and wrappe...
Definition: SubsetStack.h:35
Class SGObject is the base class of all shogun objects.
Definition: SGObject.h:102
double float64_t
Definition: common.h:48
virtual void set_value(float64_t value, int32_t idx)
Definition: Labels.cpp:62
virtual void remove_subset()
Definition: Labels.cpp:45
virtual void add_subset(SGVector< index_t > subset)
Definition: Labels.cpp:40
virtual SGVector< float64_t > get_values()
Definition: Labels.cpp:86
SGVector< float64_t > m_current_values
Definition: Labels.h:115
virtual ~CLabels()
Definition: Labels.cpp:26
virtual void ensure_valid(const char *context=NULL)=0
virtual void set_values(SGVector< float64_t > values)
Definition: Labels.cpp:74
ELabelType
Definition: LabelTypes.h:11

SHOGUN Machine Learning Toolbox - Documentation