SHOGUN  4.1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules 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/config.h>
17 
18 #include <shogun/lib/common.h>
19 #include <shogun/base/SGObject.h>
23 #include <shogun/lib/SGVector.h>
24 
25 namespace shogun
26 {
43 class CLabels : public CSGObject
44 {
45 public:
47  CLabels();
48 
50  virtual ~CLabels();
51 
58  virtual void ensure_valid(const char * context = NULL) = 0;
59 
64  virtual int32_t get_num_labels() const = 0;
65 
70  virtual ELabelType get_label_type() const = 0;
71 
80  virtual void add_subset(SGVector<index_t> subset);
81 
89  virtual void add_subset_in_place(SGVector<index_t> subset);
90 
93  virtual void remove_subset();
94 
97  virtual void remove_all_subsets();
98 
104  virtual void set_value(float64_t value, int32_t idx);
105 
111  virtual float64_t get_value(int32_t idx);
112 
118  virtual void set_values(SGVector<float64_t> values);
119 
125 
126 private:
127  void init();
128 
129 protected:
130 
133 
136 };
137 }
138 #endif
virtual float64_t get_value(int32_t idx)
Definition: Labels.cpp:59
virtual void remove_all_subsets()
Definition: Labels.cpp:54
virtual ELabelType get_label_type() const =0
The class Labels models labels, i.e. class assignments of objects.
Definition: Labels.h:43
virtual int32_t get_num_labels() const =0
CSubsetStack * m_subset_stack
Definition: Labels.h:132
class to add subset support to another class. A CSubsetStackStack instance should be added and wrappe...
Definition: SubsetStack.h:37
Class SGObject is the base class of all shogun objects.
Definition: SGObject.h:112
double float64_t
Definition: common.h:50
virtual void set_value(float64_t value, int32_t idx)
Definition: Labels.cpp:66
virtual void remove_subset()
Definition: Labels.cpp:49
virtual void add_subset(SGVector< index_t > subset)
Definition: Labels.cpp:39
virtual SGVector< float64_t > get_values()
Definition: Labels.cpp:90
all of classes and functions are contained in the shogun namespace
Definition: class_list.h:18
SGVector< float64_t > m_current_values
Definition: Labels.h:135
virtual ~CLabels()
Definition: Labels.cpp:25
virtual void add_subset_in_place(SGVector< index_t > subset)
Definition: Labels.cpp:44
virtual void ensure_valid(const char *context=NULL)=0
virtual void set_values(SGVector< float64_t > values)
Definition: Labels.cpp:78
ELabelType
Definition: LabelTypes.h:15

SHOGUN Machine Learning Toolbox - Documentation