CTOPFeatures Class Reference


Detailed Description

The class TOPFeatures implements TOP kernel features obtained from two Hidden Markov models.

It was used in

K. Tsuda, M. Kawanabe, G. Raetsch, S. Sonnenburg, and K.R. Mueller. A new discriminative kernel from probabilistic models. Neural Computation, 14:2397-2414, 2002.

which also has the details.

Note that TOP-features are computed on the fly, so to be effective feature caching should be enabled.

It inherits its functionality from CSimpleFeatures, which should be consulted for further reference.

Definition at line 68 of file TOPFeatures.h.

Inheritance diagram for CTOPFeatures:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 CTOPFeatures (int32_t size, CHMM *p, CHMM *n, bool neglin, bool poslin)
 CTOPFeatures (const CTOPFeatures &orig)
virtual ~CTOPFeatures ()
void set_models (CHMM *p, CHMM *n)
virtual float64_tset_feature_matrix ()
int32_t compute_num_features ()
bool compute_relevant_indizes (CHMM *hmm, T_HMM_INDIZES *hmm_idx)
virtual const char * get_name () const

Protected Member Functions

virtual float64_tcompute_feature_vector (int32_t num, int32_t &len, float64_t *target=NULL)
void compute_feature_vector (float64_t *addr, int32_t num, int32_t &len)

Protected Attributes

CHMMpos
CHMMneg
bool neglinear
bool poslinear
T_HMM_INDIZES pos_relevant_indizes
T_HMM_INDIZES neg_relevant_indizes

Constructor & Destructor Documentation

CTOPFeatures ( int32_t  size,
CHMM p,
CHMM n,
bool  neglin,
bool  poslin 
)

constructor

Parameters:
size cache size
p positive HMM
n negative HMM
neglin if negative HMM is of linear shape
poslin if positive HMM is of linear shape

Definition at line 18 of file TOPFeatures.cpp.

CTOPFeatures ( const CTOPFeatures orig  ) 

copy constructor

Definition at line 27 of file TOPFeatures.cpp.

~CTOPFeatures (  )  [virtual]

Definition at line 33 of file TOPFeatures.cpp.


Member Function Documentation

void compute_feature_vector ( float64_t addr,
int32_t  num,
int32_t &  len 
) [protected]

computes the feature vector to the address addr

Parameters:
addr address
num num
len len

Definition at line 93 of file TOPFeatures.cpp.

float64_t * compute_feature_vector ( int32_t  num,
int32_t &  len,
float64_t target = NULL 
) [protected, virtual]

compute feature vector

Parameters:
num num
len len
target 
Returns:
something floaty

Reimplemented from CSimpleFeatures< float64_t >.

Definition at line 77 of file TOPFeatures.cpp.

int32_t compute_num_features (  ) 

compute number of features

Returns:
number of features

Definition at line 324 of file TOPFeatures.cpp.

bool compute_relevant_indizes ( CHMM hmm,
T_HMM_INDIZES *  hmm_idx 
)

compute relevant indices

Parameters:
hmm HMM to compute for
hmm_idx HMM index
Returns:
if computing was successful

Definition at line 221 of file TOPFeatures.cpp.

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

Reimplemented from CSimpleFeatures< float64_t >.

Definition at line 114 of file TOPFeatures.h.

float64_t * set_feature_matrix (  )  [virtual]

set feature matrix

Returns:
something floaty

Definition at line 182 of file TOPFeatures.cpp.

void set_models ( CHMM p,
CHMM n 
)

set HMMs

Parameters:
p positive HMM
n negative HMM

Definition at line 53 of file TOPFeatures.cpp.


Member Data Documentation

CHMM* neg [protected]

negative HMM

Definition at line 139 of file TOPFeatures.h.

T_HMM_INDIZES neg_relevant_indizes [protected]

negative relevant indices

Definition at line 148 of file TOPFeatures.h.

bool neglinear [protected]

if negative HMM is a LinearHMM

Definition at line 141 of file TOPFeatures.h.

CHMM* pos [protected]

positive HMM

Definition at line 137 of file TOPFeatures.h.

T_HMM_INDIZES pos_relevant_indizes [protected]

positive relevant indices

Definition at line 146 of file TOPFeatures.h.

bool poslinear [protected]

if positive HMM is a LinearHMM

Definition at line 143 of file TOPFeatures.h.


The documentation for this class was generated from the following files:

SHOGUN Machine Learning Toolbox - Documentation