SHOGUN  4.1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
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-2008 Soeren Sonnenburg
8  * Written (W) 1999-2008 Gunnar Raetsch
9  * Copyright (C) 1999-2008 Fraunhofer Institute FIRST and Max-Planck-Society
10  */
12 #ifndef __GUIHMM__H
13 #define __GUIHMM__H
15 #include <shogun/lib/config.h>
16 #include <shogun/base/SGObject.h>
18 #include <shogun/labels/Labels.h>
21 namespace shogun
22 {
23 class CSGInterface;
26 class CGUIHMM : public CSGObject
27 {
28  public:
30  CGUIHMM() { };
34  CGUIHMM(CSGInterface* interface);
36  ~CGUIHMM();
39  bool new_hmm(int32_t n, int32_t m);
41  bool load(char* filename);
43  bool save(char* filename, bool is_binary=false);
48  bool set_num_hmm_tables(char* param) ;
50  bool baum_welch_train();
56  bool viterbi_train_defined();
58  bool viterbi_train();
62  bool linear_train(char align='l');
66  bool linear_train_from_file(char* param);
68  bool append_model(char* filename, int32_t base1=-1, int32_t base2=-1);
70  bool add_states(int32_t num_states=1, float64_t value=0);
72  bool set_hmm_as(char* target);
74  bool set_pseudo(float64_t pseudo);
77  int32_t num_iterations=100, float64_t epsilon=0.001);
79  bool output_hmm();
81  bool output_hmm_defined();
83  bool best_path(int32_t from=0, int32_t to=100);
87  bool normalize(bool keep_dead_states=false);
92  bool save_path(char* filename, bool is_binary=false);
94  bool save_likelihood(char* filename, bool is_binary=false);
99  bool load_definitions(char* filename, bool do_init=false);
103  bool set_max_dim(char* param);
105  bool likelihood();
107  bool chop(float64_t value);
112  bool relative_entropy(float64_t*& values, int32_t& len);
117  bool entropy(float64_t*& values, int32_t& len);
119  bool permutation_entropy(int32_t width=0, int32_t seq_num=-1);
121  inline CHMM* get_pos() { return pos; }
123  inline CHMM* get_neg() { return neg; }
125  inline CHMM* get_test() { return test; }
129  inline void set_current(CHMM* h) { working=h; }
131  inline CHMM* get_current() { return working; }
133  inline float64_t get_pseudo() { return PSEUDO; }
142  float64_t classify_example(int32_t idx);
157  virtual const char* get_name() const { return "GUIHMM"; }
159  protected:
164  bool converge(float64_t x, float64_t y);
169  void switch_model(CHMM** m1, CHMM** m2);
184  int32_t M;
186  protected:
188  CSGInterface* ui;
189 };
190 }
191 #endif
float64_t one_class_classify_example(int32_t idx)
Definition: GUIHMM.cpp:236
CHMM * get_pos()
Definition: GUIHMM.h:121
bool likelihood()
Definition: GUIHMM.cpp:508
CSGInterface * interface
Definition: SGInterface.cpp:45
Real Labels are real-valued labels.
float64_t PSEUDO
Definition: GUIHMM.h:182
virtual const char * get_name() const
Definition: GUIHMM.h:157
bool linear_train(char align='l')
Definition: GUIHMM.cpp:121
CHMM * working
Definition: GUIHMM.h:172
bool permutation_entropy(int32_t width=0, int32_t seq_num=-1)
Definition: GUIHMM.cpp:624
UI HMM (Hidden Markov Model)
Definition: GUIHMM.h:26
bool append_model(char *filename, int32_t base1=-1, int32_t base2=-1)
Definition: GUIHMM.cpp:254
CHMM * pos
Definition: GUIHMM.h:175
bool viterbi_train_defined()
Definition: GUIHMM.cpp:111
bool converge(float64_t x, float64_t y)
bool baum_welch_train_defined()
Definition: GUIHMM.cpp:91
bool set_max_dim(char *param)
bool viterbi_train()
Definition: GUIHMM.cpp:101
bool entropy(float64_t *&values, int32_t &len)
Definition: GUIHMM.cpp:599
float64_t get_pseudo()
Definition: GUIHMM.h:133
static const float64_t epsilon
Definition: libbmrm.cpp:25
bool set_hmm_as(char *target)
Definition: GUIHMM.cpp:337
Class SGObject is the base class of all shogun objects.
Definition: SGObject.h:112
CHMM * neg
Definition: GUIHMM.h:177
bool baum_welch_train()
Definition: GUIHMM.cpp:52
double float64_t
Definition: common.h:50
bool convergence_criteria(int32_t num_iterations=100, float64_t epsilon=0.001)
Definition: GUIHMM.cpp:325
bool save_likelihood(char *filename, bool is_binary=false)
Definition: GUIHMM.cpp:438
void switch_model(CHMM **m1, CHMM **m2)
float64_t classify_example(int32_t idx)
Definition: GUIHMM.cpp:173
bool relative_entropy(float64_t *&values, int32_t &len)
Definition: GUIHMM.cpp:564
CRegressionLabels * linear_one_class_classify(CRegressionLabels *output=NULL)
Definition: GUIHMM.cpp:213
CRegressionLabels * one_class_classify(CRegressionLabels *output=NULL)
Definition: GUIHMM.cpp:191
CHMM * get_test()
Definition: GUIHMM.h:125
bool add_states(int32_t num_states=1, float64_t value=0)
Definition: GUIHMM.cpp:308
CHMM * get_current()
Definition: GUIHMM.h:131
all of classes and functions are contained in the shogun namespace
Definition: class_list.h:18
bool new_hmm(int32_t n, int32_t m)
Definition: GUIHMM.cpp:44
int32_t M
Definition: GUIHMM.h:184
bool load_definitions(char *filename, bool do_init=false)
Definition: GUIHMM.cpp:416
bool set_num_hmm_tables(char *param)
bool linear_train_from_file(char *param)
bool load(char *filename)
Definition: GUIHMM.cpp:366
CHMM * get_neg()
Definition: GUIHMM.h:123
CSGInterface * ui
Definition: GUIHMM.h:188
bool baum_welch_trans_train()
Definition: GUIHMM.cpp:73
CRegressionLabels * classify(CRegressionLabels *output=NULL)
Definition: GUIHMM.cpp:149
void set_current(CHMM *h)
Definition: GUIHMM.h:129
bool normalize(bool keep_dead_states=false)
Definition: GUIHMM.cpp:555
bool output_hmm()
Definition: GUIHMM.cpp:517
CHMM * test
Definition: GUIHMM.h:179
bool chop(float64_t value)
Definition: GUIHMM.cpp:499
bool save(char *filename, bool is_binary=false)
Definition: GUIHMM.cpp:389
bool output_hmm_defined()
Definition: GUIHMM.cpp:526
bool save_path(char *filename, bool is_binary=false)
Definition: GUIHMM.cpp:467
bool set_pseudo(float64_t pseudo)
Definition: GUIHMM.cpp:318
Hidden Markov Model.
Definition: HMM.h:369
bool best_path(int32_t from=0, int32_t to=100)
Definition: GUIHMM.cpp:535

SHOGUN Machine Learning Toolbox - Documentation