Public Member Functions | Protected Member Functions | Protected Attributes

CPluginEstimate Class Reference


Detailed Description

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

\[ f({\bf x})= \log(\mbox{Pr}({\bf x}|\theta_+)) - \log(\mbox{Pr}({\bf x}|\theta_-)) \]

See also:
CLinearHMM
CDistribution

Definition at line 34 of file PluginEstimate.h.

Inheritance diagram for CPluginEstimate:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 CPluginEstimate (float64_t pos_pseudo=1e-10, float64_t neg_pseudo=1e-10)
virtual ~CPluginEstimate ()
CLabelsapply ()
virtual CLabelsapply (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

Protected Member Functions

virtual bool train_machine (CFeatures *data=NULL)

Protected Attributes

float64_t m_pos_pseudo
float64_t m_neg_pseudo
CLinearHMMpos_model
CLinearHMMneg_model
CStringFeatures< uint16_t > * features

Constructor & Destructor Documentation

CPluginEstimate ( float64_t  pos_pseudo = 1e-10,
float64_t  neg_pseudo = 1e-10 
)

default constructor

Parameters:
pos_pseudo pseudo for positive model
neg_pseudo pseudo for negative model

Definition at line 20 of file PluginEstimate.cpp.

~CPluginEstimate (  )  [virtual]

Definition at line 38 of file PluginEstimate.cpp.


Member Function Documentation

CLabels * apply (  )  [virtual]

classify objects using the currently set features

Returns:
classified labels

Implements CMachine.

Definition at line 96 of file PluginEstimate.cpp.

CLabels * apply ( CFeatures data  )  [virtual]

classify objects

Parameters:
data (test)data to be classified
Returns:
classified labels

Implements CMachine.

Definition at line 108 of file PluginEstimate.cpp.

float64_t apply ( int32_t  vec_idx  )  [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

Returns:
if one of the two models is invalid

Definition at line 195 of file PluginEstimate.h.

virtual CStringFeatures<uint16_t>* get_features (  )  [virtual]

get features

Returns:
features

Definition at line 72 of file PluginEstimate.h.

bool get_model_params ( float64_t *&  pos_params,
float64_t *&  neg_params,
int32_t &  seq_length,
int32_t &  num_symbols 
)

get model parameters

Parameters:
pos_params parameters of positive model
neg_params parameters of negative model
seq_length sequence length
num_symbols numbe of symbols
Returns:
if operation was successful

Definition at line 131 of file PluginEstimate.h.

virtual const char* get_name ( void   )  const [virtual]
Returns:
object name

Implements CSGObject.

Definition at line 201 of file PluginEstimate.h.

int32_t get_num_params (  ) 

get number of parameters

Returns:
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

Parameters:
obs observation
position position
Returns:
log odd at 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

Parameters:
obs observation
pos position
Returns:
negative log derivative

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

Parameters:
obs observation
pos position
Returns:
positive log derivative

Definition at line 107 of file PluginEstimate.h.

float64_t posterior_log_odds_obsolete ( uint16_t *  vector,
int32_t  len 
)

obsolete posterior log odds

Parameters:
vector vector
len len
Returns:
something floaty

Definition at line 83 of file PluginEstimate.h.

virtual void set_features ( CStringFeatures< uint16_t > *  feat  )  [virtual]

set features

Parameters:
feat features to set

Definition at line 61 of file PluginEstimate.h.

void set_model_params ( float64_t pos_params,
float64_t neg_params,
int32_t  seq_length,
int32_t  num_symbols 
)

set model parameters

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.

bool train_machine ( CFeatures data = NULL  )  [protected, virtual]

train plugin estimate classifier

Parameters:
data training data (parameter can be avoided if distance or kernel-based classifiers are used and distance/kernels are initialized with train data)
Returns:
whether training was successful

Reimplemented from CMachine.

Definition at line 46 of file PluginEstimate.cpp.


Member Data Documentation

CStringFeatures<uint16_t>* features [protected]

features

Definition at line 226 of file PluginEstimate.h.

float64_t m_neg_pseudo [protected]

pseudo count for negative class

Definition at line 218 of file PluginEstimate.h.

float64_t m_pos_pseudo [protected]

pseudo count for positive class

Definition at line 216 of file PluginEstimate.h.

CLinearHMM* neg_model [protected]

negative model

Definition at line 223 of file PluginEstimate.h.

CLinearHMM* pos_model [protected]

positive model

Definition at line 221 of file PluginEstimate.h.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

SHOGUN Machine Learning Toolbox - Documentation