SHOGUN  v3.0.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TOPFeatures.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  * Copyright (C) 1999-2009 Fraunhofer Institute FIRST and Max-Planck-Society
10  */
11 
12 #ifndef _CTOPFEATURES__H__
13 #define _CTOPFEATURES__H__
14 
17 
18 namespace shogun
19 {
20 template <class T> class CDenseFeatures;
21 class CHMM;
22 
23 #ifndef DOXYGEN_SHOULD_SKIP_THIS
24 
25 struct T_HMM_INDIZES
26 {
28  int32_t* idx_p;
30  int32_t* idx_q;
32  int32_t* idx_a_rows;
34  int32_t* idx_a_cols;
36  int32_t* idx_b_rows;
38  int32_t* idx_b_cols;
39 
41  int32_t num_p;
43  int32_t num_q;
45  int32_t num_a;
47  int32_t num_b;
48 };
49 #endif // DOXYGEN_SHOULD_SKIP_THIS
50 
68 class CTOPFeatures : public CDenseFeatures<float64_t>
69 {
70  public:
72  CTOPFeatures();
73 
82  CTOPFeatures(int32_t size, CHMM* p, CHMM* n, bool neglin, bool poslin);
83 
85  CTOPFeatures(const CTOPFeatures &orig);
86 
87  virtual ~CTOPFeatures();
88 
94  void set_models(CHMM* p, CHMM* n);
95 
100  virtual float64_t* set_feature_matrix();
101 
106  int32_t compute_num_features();
107 
114  bool compute_relevant_indizes(CHMM* hmm, T_HMM_INDIZES* hmm_idx);
115 
117  virtual const char* get_name() const { return "TOPFeatures"; }
118 
119  protected:
128  int32_t num, int32_t& len, float64_t* target=NULL);
129 
136  void compute_feature_vector(float64_t* addr, int32_t num, int32_t& len);
137 
138  private:
139  void init();
140 
141  protected:
147  bool neglinear;
149  bool poslinear;
150 
152  T_HMM_INDIZES pos_relevant_indizes;
154  T_HMM_INDIZES neg_relevant_indizes;
155 };
156 }
157 #endif

SHOGUN Machine Learning Toolbox - Documentation