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.
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) |
CParameterCombination * | copy_tree () const |
bool | has_children () const |
virtual const char * | get_name () const |
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 |
constructor for a root node
Definition at line 17 of file ParameterCombination.cpp.
CParameterCombination | ( | Parameter * | param | ) |
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.
void append_child | ( | CParameterCombination * | child | ) |
appends a child to this node
child | child 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)
machine | learning 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
parameter | Parameter 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
Definition at line 250 of file ParameterCombination.cpp.
virtual const char* get_name | ( | void | ) | const [virtual] |
Implements CSGObject.
Definition at line 131 of file ParameterCombination.h.
bool has_children | ( | ) | const |
checks whether this 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.
sets | Set of sets of leafs to combine | |
new_root | root node that is copied and put as root into all result trees |
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.
Definition at line 110 of file ParameterCombination.cpp.
void print_tree | ( | int | prefix_num = 0 |
) | const |
Prints a representation of the current node
prefix_num | number of tabs that will be prefixed for every output. At each recursion level, one is added. |
Definition at line 50 of file ParameterCombination.cpp.
friend class CModelSelectionParameters [friend] |
Definition at line 45 of file ParameterCombination.h.