SHOGUN  v1.1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
List of all members | Public Member Functions | Static Public Member Functions | Friends
CParameterCombination Class Reference

Detailed Description

class that holds ONE combination of parameters for a learning machine. The structure is organized as a tree. Every node may hold a name or an instance of a Parameter class. Nodes may have children. The nodes are organized in such way, that every parameter of a model for model selection has one node and sub-parameters are stored in sub-nodes. Using a tree of this class, parameters of models may easily be set. There are these types of nodes:

-root node: no name and no Parameter instance, every tree has such a node as root. Has children.

-Parameter node: a node with no name and an instance of Parameter, filled with one or more values. There may be different elements in these Parameter instances. Parameter nodes may have children with sub-parameters.

Again: Leafs of the tree may only be Parameter nodes.

Definition at line 42 of file ParameterCombination.h.

Inheritance diagram for CParameterCombination:
Inheritance graph
[legend]

Public Member Functions

 CParameterCombination ()
void print_tree (int prefix_num=0) const
 CParameterCombination (Parameter *param)
virtual ~CParameterCombination ()
void apply_to_modsel_parameter (Parameter *parameter) const
void apply_to_machine (CMachine *machine) const
void append_child (CParameterCombination *child)
CParameterCombinationcopy_tree () const
bool has_children () const
virtual const char * get_name () const
- 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)

Static Public Member Functions

static CDynamicObjectArray
< CParameterCombination > * 
leaf_sets_multiplication (const CDynamicObjectArray< CDynamicObjectArray< CParameterCombination > > &sets, const CParameterCombination *new_root)
static DynArray< Parameter * > * parameter_set_multiplication (const DynArray< Parameter * > &set_1, const DynArray< Parameter * > &set_2)

Friends

class CModelSelectionParameters

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

constructor for a root node

Definition at line 17 of file ParameterCombination.cpp.

constructor for a Parameter node

Definition at line 22 of file ParameterCombination.cpp.

~CParameterCombination ( )
virtual

destructor also recursively destroys complete tree (SG_UNREF of child nodes)

Definition at line 39 of file ParameterCombination.cpp.

Member Function Documentation

void append_child ( CParameterCombination child)

appends a child to this node

Parameters
childchild to append

Definition at line 45 of file ParameterCombination.cpp.

void apply_to_machine ( CMachine machine) const

applies this parameter tree to a learning machine (wrapper for apply_to_modesel_parameter() method)

Parameters
machinelearning machine to apply parameter tree to

Definition at line 275 of file ParameterCombination.cpp.

void apply_to_modsel_parameter ( Parameter parameter) const

applies this parameter tree to a parameter instance Recursively iterates over all children of the tree and sets model selection parameters of children to sub-parameters

Parameters
parameterParameter instance to apply parameter tree to

Definition at line 280 of file ParameterCombination.cpp.

CParameterCombination * copy_tree ( ) const

Copies the complete tree of this node. Note that nodes are actually copied. If this is a parameter node, a NEW Parameter instance to the same data is created in the copy

Returns
copy of the tree with this node as root as described above

Definition at line 250 of file ParameterCombination.cpp.

virtual const char* get_name ( ) const
virtual
Returns
name of the SGSerializable

Implements CSGObject.

Definition at line 131 of file ParameterCombination.h.

bool has_children ( ) const

checks whether this node has children

Returns
true if node has children

Definition at line 114 of file ParameterCombination.h.

CDynamicObjectArray< CParameterCombination > * leaf_sets_multiplication ( const CDynamicObjectArray< CDynamicObjectArray< CParameterCombination > > &  sets,
const CParameterCombination new_root 
)
static

Takes a set of sets of leafs nodes (!) and produces a set of instances of this class that contain every combination of the parameters in the leaf nodes in their Parameter variables. All combinations are put into a newly created tree. The root of this tree will be a copy of a specified node

created Parameter instances are added to the result set.

Parameters
setsSet of sets of leafs to combine
new_rootroot node that is copied and put as root into all result trees
Returns
result set of tree combinations

Definition at line 129 of file ParameterCombination.cpp.

DynArray< Parameter * > * parameter_set_multiplication ( const DynArray< Parameter * > &  set_1,
const DynArray< Parameter * > &  set_2 
)
static

Returns a newly created array with pointers to newly created Parameter instances, which contain all combinations of the provided Parameters.

Parameters
set_1array of Parameter instances
set_2array of Parameter instances
Returns
result array with all combinations

Definition at line 110 of file ParameterCombination.cpp.

void print_tree ( int  prefix_num = 0) const

Prints a representation of the current node

Parameters
prefix_numnumber of tabs that will be prefixed for every output. At each recursion level, one is added.

Definition at line 50 of file ParameterCombination.cpp.

Friends And Related Function Documentation

friend class CModelSelectionParameters
friend

Definition at line 45 of file ParameterCombination.h.


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

SHOGUN Machine Learning Toolbox - Documentation