SHOGUN  5.0.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules
List of all members | Public Member Functions | Protected Attributes
CTaxonomy Class Reference

Detailed Description

CTaxonomy is used to describe hierarchical structure between tasks.

Definition at line 146 of file MultitaskKernelTreeNormalizer.h.

Public Member Functions

 CTaxonomy ()
 
virtual ~CTaxonomy ()
 
CNodeget_node (int32_t task_id)
 
void set_root_beta (float64_t beta)
 
CNodeadd_node (std::string parent_name, std::string child_name, float64_t beta)
 
int32_t get_id (std::string name)
 
std::set< CNode * > intersect_root_path (CNode *node_lhs, CNode *node_rhs)
 
float64_t compute_node_similarity (int32_t task_lhs, int32_t task_rhs)
 
void update_task_histogram (std::vector< int32_t > task_vector_lhs)
 
int32_t get_num_nodes ()
 
int32_t get_num_leaves ()
 
float64_t get_node_weight (int32_t idx)
 
void set_node_weight (int32_t idx, float64_t weight)
 
virtual const char * get_name () const
 
std::map< std::string, int32_t > get_name2id ()
 
int32_t get_id_by_name (std::string name)
 

Protected Attributes

CNoderoot
 
std::map< std::string, int32_t > name2id
 
std::vector< CNode * > nodes
 
std::map< int32_t, float64_ttask_histogram
 

Constructor & Destructor Documentation

CTaxonomy ( )

default constructor

Definition at line 153 of file MultitaskKernelTreeNormalizer.h.

virtual ~CTaxonomy ( )
virtual

Definition at line 162 of file MultitaskKernelTreeNormalizer.h.

Member Function Documentation

CNode* add_node ( std::string  parent_name,
std::string  child_name,
float64_t  beta 
)

inserts additional node into taxonomy

Parameters
parent_namename of parent
child_namename of child
betaweight of child

Definition at line 192 of file MultitaskKernelTreeNormalizer.h.

float64_t compute_node_similarity ( int32_t  task_lhs,
int32_t  task_rhs 
)
Parameters
task_lhstask_id on left hand side
task_rhstask_id on right hand side
Returns
similarity between tasks

Definition at line 252 of file MultitaskKernelTreeNormalizer.h.

int32_t get_id ( std::string  name)

translates name to id

Parameters
namename of task
Returns
id

Definition at line 222 of file MultitaskKernelTreeNormalizer.h.

int32_t get_id_by_name ( std::string  name)

translate name to id

Parameters
namenode name
Returns
id

Definition at line 356 of file MultitaskKernelTreeNormalizer.h.

virtual const char* get_name ( ) const
virtual
Returns
object name

Definition at line 341 of file MultitaskKernelTreeNormalizer.h.

std::map<std::string, int32_t> get_name2id ( )
Returns
mapping from name to id

Definition at line 347 of file MultitaskKernelTreeNormalizer.h.

CNode* get_node ( int32_t  task_id)
Parameters
task_idtask identifier
Returns
node with id task_id

Definition at line 175 of file MultitaskKernelTreeNormalizer.h.

float64_t get_node_weight ( int32_t  idx)
Returns
weight of node with identifier idx

Definition at line 324 of file MultitaskKernelTreeNormalizer.h.

int32_t get_num_leaves ( )
Returns
number of leaves

Definition at line 308 of file MultitaskKernelTreeNormalizer.h.

int32_t get_num_nodes ( )
Returns
number of nodes

Definition at line 302 of file MultitaskKernelTreeNormalizer.h.

std::set<CNode*> intersect_root_path ( CNode node_lhs,
CNode node_rhs 
)

given two nodes, compute the intersection of their ancestors

Parameters
node_lhsnode of left hand side
node_rhsnode of right hand side
Returns
intersection of the two sets of ancestors

Definition at line 231 of file MultitaskKernelTreeNormalizer.h.

void set_node_weight ( int32_t  idx,
float64_t  weight 
)
Parameters
idxnode id
weightweight to set

Definition at line 334 of file MultitaskKernelTreeNormalizer.h.

void set_root_beta ( float64_t  beta)

set root weight

Parameters
betaweight

Definition at line 182 of file MultitaskKernelTreeNormalizer.h.

void update_task_histogram ( std::vector< int32_t >  task_vector_lhs)

keep track of how many elements each task has

Parameters
task_vector_lhsvector of task ids for examples

Definition at line 275 of file MultitaskKernelTreeNormalizer.h.

Member Data Documentation

std::map<std::string, int32_t> name2id
protected

name 2 id

Definition at line 367 of file MultitaskKernelTreeNormalizer.h.

std::vector<CNode*> nodes
protected

nodes

Definition at line 369 of file MultitaskKernelTreeNormalizer.h.

CNode* root
protected

root

Definition at line 365 of file MultitaskKernelTreeNormalizer.h.

std::map<int32_t, float64_t> task_histogram
protected

task histogram

Definition at line 371 of file MultitaskKernelTreeNormalizer.h.


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

SHOGUN Machine Learning Toolbox - Documentation