class PluginEstimate
The class PluginEstimate takes as input two probabilistic models (of type CLinearHMM, even though general models are possible ) and classifies examples according to the rule
Definition at line 32 of file PluginEstimate.h.
Public Member Functions | |
CPluginEstimate (float64_t pos_pseudo=1e-10, float64_t neg_pseudo=1e-10) | |
virtual | ~CPluginEstimate () |
bool | train () |
CLabels * | classify (CLabels *output=NULL) |
classify all test features | |
virtual void | set_features (CStringFeatures< uint16_t > *feat) |
virtual CStringFeatures < uint16_t > * | get_features () |
float64_t | classify_example (int32_t vec_idx) |
classify the test feature vector indexed by vec_idx | |
float64_t | posterior_log_odds_obsolete (uint16_t *vector, int32_t len) |
float64_t | get_parameterwise_log_odds (uint16_t obs, int32_t position) |
float64_t | log_derivative_pos_obsolete (uint16_t obs, int32_t pos) |
float64_t | log_derivative_neg_obsolete (uint16_t obs, int32_t pos) |
bool | get_model_params (float64_t *&pos_params, float64_t *&neg_params, int32_t &seq_length, int32_t &num_symbols) |
void | set_model_params (const float64_t *pos_params, const float64_t *neg_params, int32_t seq_length, int32_t num_symbols) |
int32_t | get_num_params () |
bool | check_models () |
virtual const char * | get_name () const |
Protected Attributes | |
float64_t | m_pos_pseudo |
float64_t | m_neg_pseudo |
CLinearHMM * | pos_model |
CLinearHMM * | neg_model |
CStringFeatures< uint16_t > * | features |
default constructor
pos_pseudo | pseudo for positive model | |
neg_pseudo | pseudo for negative model |
Definition at line 19 of file PluginEstimate.cpp.
CPluginEstimate::~CPluginEstimate | ( | ) | [virtual] |
Definition at line 25 of file PluginEstimate.cpp.
bool CPluginEstimate::check_models | ( | ) |
check models
Definition at line 185 of file PluginEstimate.h.
classify all test features
Reimplemented from CClassifier.
Definition at line 70 of file PluginEstimate.cpp.
float64_t CPluginEstimate::classify_example | ( | int32_t | vec_idx | ) | [virtual] |
classify the test feature vector indexed by vec_idx
Reimplemented from CClassifier.
Definition at line 84 of file PluginEstimate.cpp.
virtual CStringFeatures<uint16_t>* CPluginEstimate::get_features | ( | ) | [virtual] |
bool CPluginEstimate::get_model_params | ( | float64_t *& | pos_params, | |
float64_t *& | neg_params, | |||
int32_t & | seq_length, | |||
int32_t & | num_symbols | |||
) |
get model parameters
pos_params | parameters of positive model | |
neg_params | parameters of negative model | |
seq_length | sequence length | |
num_symbols | numbe of symbols |
Definition at line 125 of file PluginEstimate.h.
virtual const char* CPluginEstimate::get_name | ( | ) | const [virtual] |
int32_t CPluginEstimate::get_num_params | ( | ) |
get number of parameters
Definition at line 176 of file PluginEstimate.h.
float64_t CPluginEstimate::get_parameterwise_log_odds | ( | uint16_t | obs, | |
int32_t | position | |||
) |
get log odds parameter-wise
obs | observation | |
position | position |
Definition at line 89 of file PluginEstimate.h.
float64_t CPluginEstimate::log_derivative_neg_obsolete | ( | uint16_t | obs, | |
int32_t | pos | |||
) |
get obsolete negative log derivative
obs | observation | |
pos | position |
Definition at line 112 of file PluginEstimate.h.
float64_t CPluginEstimate::log_derivative_pos_obsolete | ( | uint16_t | obs, | |
int32_t | pos | |||
) |
get obsolete positive log derivative
obs | observation | |
pos | position |
Definition at line 101 of file PluginEstimate.h.
float64_t CPluginEstimate::posterior_log_odds_obsolete | ( | uint16_t * | vector, | |
int32_t | len | |||
) |
obsolete posterior log odds
vector | vector | |
len | len |
Definition at line 77 of file PluginEstimate.h.
virtual void CPluginEstimate::set_features | ( | CStringFeatures< uint16_t > * | feat | ) | [virtual] |
void CPluginEstimate::set_model_params | ( | const float64_t * | pos_params, | |
const float64_t * | neg_params, | |||
int32_t | seq_length, | |||
int32_t | num_symbols | |||
) |
set model parameters
pos_params | parameters of positive model | |
neg_params | parameters of negative model | |
seq_length | sequence length | |
num_symbols | numbe of symbols |
Definition at line 153 of file PluginEstimate.h.
bool CPluginEstimate::train | ( | ) | [virtual] |
train the estimate
Reimplemented from CClassifier.
Definition at line 33 of file PluginEstimate.cpp.
CStringFeatures<uint16_t>* CPluginEstimate::features [protected] |
features
Definition at line 205 of file PluginEstimate.h.
float64_t CPluginEstimate::m_neg_pseudo [protected] |
pseudo count for negative class
Definition at line 197 of file PluginEstimate.h.
float64_t CPluginEstimate::m_pos_pseudo [protected] |
pseudo count for positive class
Definition at line 195 of file PluginEstimate.h.
CLinearHMM* CPluginEstimate::neg_model [protected] |
negative model
Definition at line 202 of file PluginEstimate.h.
CLinearHMM* CPluginEstimate::pos_model [protected] |
positive model
Definition at line 200 of file PluginEstimate.h.