SHOGUN  4.1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
StructuredLabels.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 _STRUCTURED_LABELS__H__
12 #define _STRUCTURED_LABELS__H__
13 
14 #include <shogun/lib/config.h>
15 
16 #include <shogun/labels/Labels.h>
21 
22 namespace shogun {
23 
25 class CStructuredLabels : public CLabels
26 {
27 
28  public:
31 
40  CStructuredLabels(int32_t num_labels);
41 
43  virtual ~CStructuredLabels();
44 
51  virtual void ensure_valid(const char* context = NULL);
52 
61  virtual void add_label(CStructuredData* label);
62 
70 
77  virtual CStructuredData* get_label(int32_t idx);
78 
89  virtual bool set_label(int32_t idx, CStructuredData* label);
90 
95  virtual int32_t get_num_labels() const;
96 
98  virtual const char* get_name() const { return "StructuredLabels"; }
99 
104  virtual ELabelType get_label_type() const { return LT_STRUCTURED; }
105 
111 
112  private:
114  void init();
115 
117  void ensure_valid_sdt(CStructuredData* label);
118 
119  protected:
122 
125 
126 }; /* class CStructuredLabels */
127 
128 } /* namespace shogun */
129 
130 #endif /* _STRUCTUREDLABELS_H__ */
virtual const char * get_name() const
Base class of the labels used in Structured Output (SO) problems.
The class Labels models labels, i.e. class assignments of objects.
Definition: Labels.h:43
structured labels (e.g. sequences, trees) used in Structured Output problems
Definition: LabelTypes.h:24
CDynamicObjectArray * get_labels() const
virtual ELabelType get_label_type() const
CDynamicObjectArray * m_labels
EStructuredDataType m_sdt
Dynamic array class for CSGObject pointers that creates an array that can be used like a list or an a...
virtual void add_label(CStructuredData *label)
all of classes and functions are contained in the shogun namespace
Definition: class_list.h:18
virtual int32_t get_num_labels() const
virtual CStructuredData * get_label(int32_t idx)
EStructuredDataType get_structured_data_type()
virtual void ensure_valid(const char *context=NULL)
Base class of the components of StructuredLabels.
virtual bool set_label(int32_t idx, CStructuredData *label)
ELabelType
Definition: LabelTypes.h:15

SHOGUN Machine Learning Toolbox - Documentation