SHOGUN  v1.1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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 138 of file MultitaskKernelTreeNormalizer.h.

Inheritance diagram for CTaxonomy:
Inheritance graph
[legend]

Public Member Functions

 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)
- 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)
SGIOget_global_io ()
void set_global_parallel (Parallel *parallel)
Parallelget_global_parallel ()
void set_global_version (Version *version)
Versionget_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 Attributes

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

Additional Inherited Members

- Public Attributes inherited from CSGObject
SGIOio
Parallelparallel
Versionversion
Parameterm_parameters
Parameterm_model_selection_parameters
- 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)

Constructor & Destructor Documentation

CTaxonomy ( )

default constructor

Definition at line 145 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 175 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 235 of file MultitaskKernelTreeNormalizer.h.

int32_t get_id ( std::string  name)

translates name to id

Parameters
namename of task
Returns
id

Definition at line 205 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 339 of file MultitaskKernelTreeNormalizer.h.

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

Implements CSGObject.

Definition at line 324 of file MultitaskKernelTreeNormalizer.h.

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

Definition at line 330 of file MultitaskKernelTreeNormalizer.h.

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

Definition at line 158 of file MultitaskKernelTreeNormalizer.h.

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

Definition at line 307 of file MultitaskKernelTreeNormalizer.h.

int32_t get_num_leaves ( )
Returns
number of leaves

Definition at line 291 of file MultitaskKernelTreeNormalizer.h.

int32_t get_num_nodes ( )
Returns
number of nodes

Definition at line 285 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 214 of file MultitaskKernelTreeNormalizer.h.

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

Definition at line 317 of file MultitaskKernelTreeNormalizer.h.

void set_root_beta ( float64_t  beta)

set root weight

Parameters
betaweight

Definition at line 165 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 258 of file MultitaskKernelTreeNormalizer.h.

Member Data Documentation

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

name 2 id

Definition at line 350 of file MultitaskKernelTreeNormalizer.h.

std::vector<CNode*> nodes
protected

nodes

Definition at line 352 of file MultitaskKernelTreeNormalizer.h.

CNode* root
protected

root

Definition at line 348 of file MultitaskKernelTreeNormalizer.h.

std::map<int32_t, float64_t> task_histogram
protected

task histogram

Definition at line 354 of file MultitaskKernelTreeNormalizer.h.


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

SHOGUN Machine Learning Toolbox - Documentation