The class LinearHMM is for learning Higher Order Markov chains.
While learning the parameters
in
are determined.
A more detailed description can be found in
Durbin et.al, Biological Sequence Analysis -Probabilistic Models of Proteins and Nucleic Acids, 1998
Definition at line 39 of file LinearHMM.h.

Public Member Functions | |
| CLinearHMM (CStringFeatures< uint16_t > *f) | |
| CLinearHMM (int32_t p_num_features, int32_t p_num_symbols) | |
| virtual | ~CLinearHMM () |
| virtual bool | train (CFeatures *data=NULL) |
| bool | train (const int32_t *indizes, int32_t num_indizes, float64_t pseudo_count) |
| float64_t | get_log_likelihood_example (uint16_t *vector, int32_t len) |
| float64_t | get_likelihood_example (uint16_t *vector, int32_t len) |
| virtual float64_t | get_log_likelihood_example (int32_t num_example) |
| virtual float64_t | get_log_derivative (int32_t num_param, int32_t num_example) |
| virtual float64_t | get_log_derivative_obsolete (uint16_t obs, int32_t pos) |
| virtual float64_t | get_derivative_obsolete (uint16_t *vector, int32_t len, int32_t pos) |
| virtual int32_t | get_sequence_length () |
| virtual int32_t | get_num_symbols () |
| virtual int32_t | get_num_model_parameters () |
| virtual float64_t | get_positional_log_parameter (uint16_t obs, int32_t position) |
| virtual float64_t | get_log_model_parameter (int32_t num_param) |
| virtual void | get_log_transition_probs (float64_t **dst, int32_t *num) |
| virtual bool | set_log_transition_probs (const float64_t *src, int32_t num) |
| virtual void | get_transition_probs (float64_t **dst, int32_t *num) |
| virtual bool | set_transition_probs (const float64_t *src, int32_t num) |
| virtual const char * | get_name () const |
Protected Attributes | |
| int32_t | sequence_length |
| int32_t | num_symbols |
| int32_t | num_params |
| float64_t * | transition_probs |
| float64_t * | log_transition_probs |
| CLinearHMM | ( | CStringFeatures< uint16_t > * | f | ) |
| CLinearHMM | ( | int32_t | p_num_features, | |
| int32_t | p_num_symbols | |||
| ) |
constructor
| p_num_features | number of features | |
| p_num_symbols | number of symbols in features |
Definition at line 28 of file LinearHMM.cpp.
| ~CLinearHMM | ( | ) | [virtual] |
Definition at line 36 of file LinearHMM.cpp.
| virtual float64_t get_derivative_obsolete | ( | uint16_t * | vector, | |
| int32_t | len, | |||
| int32_t | pos | |||
| ) | [virtual] |
obsolete get one example's derivative
| vector | vector | |
| len | length | |
| pos | position |
Definition at line 127 of file LinearHMM.h.
| float64_t get_likelihood_example | ( | uint16_t * | vector, | |
| int32_t | len | |||
| ) |
get one example's likelihood
| vector | the example | |
| len | length of vector |
Definition at line 201 of file LinearHMM.cpp.
| float64_t get_log_derivative | ( | int32_t | num_param, | |
| int32_t | num_example | |||
| ) | [virtual] |
get logarithm of one example's derivative's likelihood
| num_param | which example's param | |
| num_example | which example |
Implements CDistribution.
Definition at line 211 of file LinearHMM.cpp.
| virtual float64_t get_log_derivative_obsolete | ( | uint16_t | obs, | |
| int32_t | pos | |||
| ) | [virtual] |
obsolete get logarithm of one example's derivative's likelihood
| obs | observation | |
| pos | position |
Definition at line 115 of file LinearHMM.h.
| float64_t get_log_likelihood_example | ( | uint16_t * | vector, | |
| int32_t | len | |||
| ) |
get logarithm of one example's likelihood
| vector | the example | |
| len | length of vector |
Definition at line 174 of file LinearHMM.cpp.
| float64_t get_log_likelihood_example | ( | int32_t | num_example | ) | [virtual] |
get logarithm of one example's likelihood
| num_example | which example |
Implements CDistribution.
Definition at line 184 of file LinearHMM.cpp.
| virtual float64_t get_log_model_parameter | ( | int32_t | num_param | ) | [virtual] |
get logarithm of given model parameter
| num_param | which param |
Implements CDistribution.
Definition at line 169 of file LinearHMM.h.
| void get_log_transition_probs | ( | float64_t ** | dst, | |
| int32_t * | num | |||
| ) | [virtual] |
get logarithm of all transition probs
| dst | where logarithm of transition probs will be stored | |
| num | where number of logarithm of transition probs will be stored |
Definition at line 260 of file LinearHMM.cpp.
| virtual const char* get_name | ( | ) | const [virtual] |
| virtual int32_t get_num_model_parameters | ( | ) | [virtual] |
get number of model parameters
Implements CDistribution.
Definition at line 150 of file LinearHMM.h.
| virtual int32_t get_num_symbols | ( | ) | [virtual] |
get number of symbols in examples
Definition at line 144 of file LinearHMM.h.
| virtual float64_t get_positional_log_parameter | ( | uint16_t | obs, | |
| int32_t | position | |||
| ) | [virtual] |
get positional log parameter
| obs | observation | |
| position | position |
Definition at line 158 of file LinearHMM.h.
| virtual int32_t get_sequence_length | ( | ) | [virtual] |
get sequence length of each example
Definition at line 138 of file LinearHMM.h.
| void get_transition_probs | ( | float64_t ** | dst, | |
| int32_t * | num | |||
| ) | [virtual] |
get all transition probs
| dst | where transition probs will be stored | |
| num | where number of transition probs will be stored |
Definition at line 230 of file LinearHMM.cpp.
| bool set_log_transition_probs | ( | const float64_t * | src, | |
| int32_t | num | |||
| ) | [virtual] |
set logarithm of all transition probs
| src | new logarithms of transition probs | |
| num | number of logarithms of transition probs |
Definition at line 270 of file LinearHMM.cpp.
| bool set_transition_probs | ( | const float64_t * | src, | |
| int32_t | num | |||
| ) | [virtual] |
set all transition probs
| src | new transition probs | |
| num | number of transition probs |
Definition at line 240 of file LinearHMM.cpp.
| bool train | ( | const int32_t * | indizes, | |
| int32_t | num_indizes, | |||
| float64_t | pseudo_count | |||
| ) |
alternative train distribution
| indizes | indices | |
| num_indizes | number of indices | |
| pseudo_count | pseudo count |
Definition at line 111 of file LinearHMM.cpp.
| bool train | ( | CFeatures * | data = NULL |
) | [virtual] |
estimate LinearHMM distribution
| data | training data (parameter can be avoided if distance or kernel-based classifiers are used and distance/kernels are initialized with train data) |
Implements CDistribution.
Definition at line 42 of file LinearHMM.cpp.
float64_t* log_transition_probs [protected] |
logarithm of transition probs
Definition at line 223 of file LinearHMM.h.
int32_t num_params [protected] |
number of parameters
Definition at line 219 of file LinearHMM.h.
int32_t num_symbols [protected] |
number of symbols in examples
Definition at line 217 of file LinearHMM.h.
int32_t sequence_length [protected] |
examples' sequence length
Definition at line 215 of file LinearHMM.h.
float64_t* transition_probs [protected] |
transition probs
Definition at line 221 of file LinearHMM.h.