SHOGUN  5.0.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules
SequenceLabels.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-2013 Fernando José Iglesias García
8  * Copyright (C) 2012-2013 Fernando José Iglesias García
9  */
10 
11 #ifndef _SEQUENCE_LABELS__H__
12 #define _SEQUENCE_LABELS__H__
13 
14 #include <shogun/lib/config.h>
15 
17 #include <shogun/lib/SGVector.h>
20 
21 namespace shogun
22 {
23 
24 class CSequenceLabels;
25 
28 class CSequence : public CStructuredData
29 {
30 public:
33 
39 
41  ~CSequence() { }
42 
48  {
49  if ( base_data->get_structured_data_type() == SDT_SEQUENCE )
50  return (CSequence*) base_data;
51  else
52  SG_SERROR("base_data must be of dynamic type CSequence\n")
53 
54  return NULL;
55  }
56 
58  virtual const char* get_name() const { return "Sequence"; }
59 
61  SGVector<int32_t> get_data() const { return data; }
62 
63 protected:
66 
67 };
68 
74 {
75  public:
78 
84  CSequenceLabels(int32_t num_labels, int32_t num_states);
85 
96  CSequenceLabels(SGVector< int32_t > labels, int32_t label_length, int32_t num_labels, int32_t num_states);
97 
99  virtual ~CSequenceLabels();
100 
102  virtual const char* get_name() const { return "SequenceLabels"; }
103 
114 
119  inline int32_t get_num_states() const { return m_num_states; };
120 
121  private:
123  void init();
124 
125  private:
130  int32_t m_num_states;
131 
132 }; /* CSequenceLabels */
133 
134 } /* namespace shogun */
135 
136 #endif /* _SEQUENCE_LABELS__H__ */
Base class of the labels used in Structured Output (SO) problems.
virtual const char * get_name() const
SGVector< int32_t > data
Class CSequenceLabels used e.g. in the application of Structured Output (SO) learning to Hidden Marko...
Class CSequence to be used in the application of Structured Output (SO) learning to Hidden Markov Sup...
virtual const char * get_name() const
virtual EStructuredDataType get_structured_data_type() const
void add_vector_label(SGVector< int32_t > label)
int32_t get_num_states() const
all of classes and functions are contained in the shogun namespace
Definition: class_list.h:18
#define SG_SERROR(...)
Definition: SGIO.h:179
STRUCTURED_DATA_TYPE(SDT_SEQUENCE)
CSequence(SGVector< int32_t > seq=SGVector< int32_t >())
SGVector< int32_t > get_data() const
static CSequence * obtain_from_generic(CStructuredData *base_data)
Base class of the components of StructuredLabels.

SHOGUN Machine Learning Toolbox - Documentation