SHOGUN
v1.1.0
|
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 () | |
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 SGVector< float64_t > | get_log_transition_probs () |
virtual bool | set_log_transition_probs (SGVector< float64_t > probs) |
virtual SGVector< float64_t > | get_transition_probs () |
virtual bool | set_transition_probs (SGVector< float64_t > probs) |
virtual const char * | get_name () const |
![]() | |
CDistribution () | |
virtual | ~CDistribution () |
virtual int32_t | get_num_relevant_model_parameters () |
virtual float64_t | get_log_likelihood_sample () |
virtual SGVector< float64_t > | get_log_likelihood () |
virtual float64_t | get_model_parameter (int32_t num_param) |
virtual float64_t | get_derivative (int32_t num_param, int32_t num_example) |
virtual float64_t | get_likelihood_example (int32_t num_example) |
virtual void | set_features (CFeatures *f) |
virtual CFeatures * | get_features () |
virtual void | set_pseudo_count (float64_t pseudo) |
virtual float64_t | get_pseudo_count () |
![]() | |
CSGObject () | |
CSGObject (const CSGObject &orig) | |
virtual | ~CSGObject () |
virtual bool | is_generic (EPrimitiveType *generic) const |
template<class T > | |
void | set_generic () |
void | unset_generic () |
virtual void | print_serializable (const char *prefix="") |
virtual bool | save_serializable (CSerializableFile *file, const char *prefix="") |
virtual bool | load_serializable (CSerializableFile *file, const char *prefix="") |
void | set_global_io (SGIO *io) |
SGIO * | get_global_io () |
void | set_global_parallel (Parallel *parallel) |
Parallel * | get_global_parallel () |
void | set_global_version (Version *version) |
Version * | get_global_version () |
SGVector< char * > | get_modelsel_names () |
char * | get_modsel_param_descr (const char *param_name) |
index_t | get_modsel_param_index (const char *param_name) |
Protected Member Functions | |
virtual void | load_serializable_post () throw (ShogunException) |
Protected Attributes | |
int32_t | sequence_length |
int32_t | num_symbols |
int32_t | num_params |
float64_t * | transition_probs |
float64_t * | log_transition_probs |
![]() | |
CFeatures * | features |
float64_t | pseudo_count |
Additional Inherited Members | |
![]() | |
SGIO * | io |
Parallel * | parallel |
Version * | version |
Parameter * | m_parameters |
Parameter * | m_model_selection_parameters |
CLinearHMM | ( | ) |
default constructor
Definition at line 22 of file LinearHMM.cpp.
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 38 of file LinearHMM.cpp.
|
virtual |
Definition at line 48 of file LinearHMM.cpp.
|
virtual |
obsolete get one example's derivative
vector | vector |
len | length |
pos | position |
Definition at line 131 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 213 of file LinearHMM.cpp.
|
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 223 of file LinearHMM.cpp.
|
virtual |
obsolete get logarithm of one example's derivative's likelihood
obs | observation |
pos | position |
Definition at line 119 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 186 of file LinearHMM.cpp.
|
virtual |
get logarithm of one example's likelihood
num_example | which example |
Implements CDistribution.
Definition at line 196 of file LinearHMM.cpp.
|
virtual |
get logarithm of given model parameter
num_param | which param |
Implements CDistribution.
Definition at line 173 of file LinearHMM.h.
get logarithm of all transition probs
Definition at line 266 of file LinearHMM.cpp.
|
virtual |
|
virtual |
get number of model parameters
Implements CDistribution.
Definition at line 154 of file LinearHMM.h.
|
virtual |
get number of symbols in examples
Definition at line 148 of file LinearHMM.h.
|
virtual |
get positional log parameter
obs | observation |
position | position |
Definition at line 162 of file LinearHMM.h.
|
virtual |
get sequence length of each example
Definition at line 142 of file LinearHMM.h.
get all transition probs
Definition at line 242 of file LinearHMM.cpp.
|
protectedvirtual |
Can (optionally) be overridden to post-initialize some member variables which are not PARAMETER::ADD'ed. Make sure that at first the overridden method BASE_CLASS::LOAD_SERIALIZABLE_POST is called.
ShogunException | Will be thrown if an error occurres. |
Reimplemented from CSGObject.
Definition at line 290 of file LinearHMM.cpp.
set logarithm of all transition probs
probs | new logarithm transition probs |
Definition at line 271 of file LinearHMM.cpp.
set all transition probs
probs | new transition probs |
Definition at line 247 of file LinearHMM.cpp.
|
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 54 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 123 of file LinearHMM.cpp.
|
protected |
logarithm of transition probs
Definition at line 226 of file LinearHMM.h.
|
protected |
number of parameters
Definition at line 222 of file LinearHMM.h.
|
protected |
number of symbols in examples
Definition at line 220 of file LinearHMM.h.
|
protected |
examples' sequence length
Definition at line 218 of file LinearHMM.h.
|
protected |
transition probs
Definition at line 224 of file LinearHMM.h.