|
SHOGUN
v1.1.0
|
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 34 of file PluginEstimate.h.

Public Member Functions | |
| CPluginEstimate (float64_t pos_pseudo=1e-10, float64_t neg_pseudo=1e-10) | |
| virtual | ~CPluginEstimate () |
| CLabels * | apply () |
| virtual CLabels * | apply (CFeatures *data) |
| virtual void | set_features (CStringFeatures< uint16_t > *feat) |
| virtual CStringFeatures < uint16_t > * | get_features () |
| float64_t | apply (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 (float64_t *pos_params, 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 |
Public Member Functions inherited from CMachine | |
| CMachine () | |
| virtual | ~CMachine () |
| virtual bool | train (CFeatures *data=NULL) |
| virtual bool | load (FILE *srcfile) |
| virtual bool | save (FILE *dstfile) |
| virtual void | set_labels (CLabels *lab) |
| virtual CLabels * | get_labels () |
| virtual float64_t | get_label (int32_t i) |
| void | set_max_train_time (float64_t t) |
| float64_t | get_max_train_time () |
| virtual EClassifierType | get_classifier_type () |
| void | set_solver_type (ESolverType st) |
| ESolverType | get_solver_type () |
| virtual void | set_store_model_features (bool store_model) |
Public Member Functions inherited from CSGObject | |
| 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 bool | train_machine (CFeatures *data=NULL) |
Protected Member Functions inherited from CMachine | |
| virtual void | store_model_features () |
Protected Member Functions inherited from CSGObject | |
| virtual void | load_serializable_pre () throw (ShogunException) |
| virtual void | load_serializable_post () throw (ShogunException) |
| virtual void | save_serializable_pre () throw (ShogunException) |
| virtual void | save_serializable_post () throw (ShogunException) |
Protected Attributes | |
| float64_t | m_pos_pseudo |
| float64_t | m_neg_pseudo |
| CLinearHMM * | pos_model |
| CLinearHMM * | neg_model |
| CStringFeatures< uint16_t > * | features |
Protected Attributes inherited from CMachine | |
| float64_t | max_train_time |
| CLabels * | labels |
| ESolverType | solver_type |
| bool | m_store_model_features |
Additional Inherited Members | |
Public Attributes inherited from CSGObject | |
| SGIO * | io |
| Parallel * | parallel |
| Version * | version |
| Parameter * | m_parameters |
| Parameter * | m_model_selection_parameters |
| CPluginEstimate | ( | float64_t | pos_pseudo = 1e-10, |
| float64_t | neg_pseudo = 1e-10 |
||
| ) |
default constructor
| pos_pseudo | pseudo for positive model |
| neg_pseudo | pseudo for negative model |
Definition at line 20 of file PluginEstimate.cpp.
|
virtual |
Definition at line 38 of file PluginEstimate.cpp.
|
virtual |
classify objects using the currently set features
Implements CMachine.
Definition at line 96 of file PluginEstimate.cpp.
classify objects
| data | (test)data to be classified |
Implements CMachine.
Definition at line 108 of file PluginEstimate.cpp.
|
virtual |
classify the test feature vector indexed by vec_idx
Reimplemented from CMachine.
Definition at line 123 of file PluginEstimate.cpp.
| bool check_models | ( | ) |
check models
Definition at line 195 of file PluginEstimate.h.
|
virtual |
| bool 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 131 of file PluginEstimate.h.
|
virtual |
| int32_t get_num_params | ( | ) |
get number of parameters
Definition at line 186 of file PluginEstimate.h.
| float64_t get_parameterwise_log_odds | ( | uint16_t | obs, |
| int32_t | position | ||
| ) |
get log odds parameter-wise
| obs | observation |
| position | position |
Definition at line 95 of file PluginEstimate.h.
| float64_t log_derivative_neg_obsolete | ( | uint16_t | obs, |
| int32_t | pos | ||
| ) |
get obsolete negative log derivative
| obs | observation |
| pos | position |
Definition at line 118 of file PluginEstimate.h.
| float64_t log_derivative_pos_obsolete | ( | uint16_t | obs, |
| int32_t | pos | ||
| ) |
get obsolete positive log derivative
| obs | observation |
| pos | position |
Definition at line 107 of file PluginEstimate.h.
| float64_t posterior_log_odds_obsolete | ( | uint16_t * | vector, |
| int32_t | len | ||
| ) |
obsolete posterior log odds
| vector | vector |
| len | len |
Definition at line 83 of file PluginEstimate.h.
|
virtual |
| void set_model_params | ( | float64_t * | pos_params, |
| 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 159 of file PluginEstimate.h.
|
protectedvirtual |
train plugin estimate classifier
| data | training data (parameter can be avoided if distance or kernel-based classifiers are used and distance/kernels are initialized with train data) |
Reimplemented from CMachine.
Definition at line 46 of file PluginEstimate.cpp.
|
protected |
features
Definition at line 226 of file PluginEstimate.h.
|
protected |
pseudo count for negative class
Definition at line 218 of file PluginEstimate.h.
|
protected |
pseudo count for positive class
Definition at line 216 of file PluginEstimate.h.
|
protected |
negative model
Definition at line 223 of file PluginEstimate.h.
|
protected |
positive model
Definition at line 221 of file PluginEstimate.h.