class holding the data for a node in a tree.
More...
#include <node.h>
|
| string | name |
| | full name of the node, with types
|
| |
| NodeType | node_type |
| | the node type
|
| |
| DataType | ret_type |
| | return data type
|
| |
| std::vector< DataType > | arg_types |
| | argument data types
|
| |
| std::size_t | sig_hash |
| | a hash of the signature
|
| |
| std::size_t | sig_dual_hash |
| | a hash of the dual of the signature (for NLS)
|
| |
| bool | node_is_fixed |
| | whether the node is replaceable. Weights are still optimized.
|
| |
| bool | weight_is_fixed |
| | whether the weight should be kept during variation. Notice that weight_is_fixed alows us to fix the weight of certain nodes.
|
| |
| bool | is_weighted |
| | whether this node is weighted (ignored in nodes that must have weights, such as meanLabel, constants, splits)
|
| |
| float | prob_change |
| | chance of node being selected for variation. This will take into account if the node is fixed, but not the weight (a fixed weight just gets propagated). Can be affected by node_is_fixed. should not be accessed directly.
|
| |
| float | W |
| | the weights of the node. also used for splitting thresholds.
|
| |
| bool | center_op |
| | whether to center the operator in pretty printing
|
| |
| string | feature |
| | feature name for terminals or splitting nodes
|
| |
| DataType | feature_type = DataType::ArrayF |
| | feature type for terminals or splitting nodes
|
| |
| bool | keep_split_feature = false |
| | fix the SplitBest feature when the node is fixed
|
| |
class holding the data for a node in a tree.
Definition at line 89 of file node.h.
◆ HashTuple
Initial value: std::tuple<
size_t,
bool,
string,
bool,
bool,
int
>
std::underlying_type_t< NodeType > UnderlyingNodeType
tuple type for hashing
Definition at line 130 of file node.h.
◆ Node() [1/2]
◆ Node() [2/2]
template<typename S>
| Brush::Node::Node |
( |
NodeType | type, |
|
|
S | signature, |
|
|
bool | weighted = false, |
|
|
string | feature_name = "" ) |
|
inlineexplicitnoexcept |
Constructor used by search space.
- Template Parameters
-
- Parameters
-
| type | node type |
| feature_name | name of the terminal |
| signature | signature |
Definition at line 150 of file node.h.
◆ args_type()
| std::size_t Brush::Node::args_type |
( |
| ) |
const |
|
inline |
◆ get_arg_count()
| size_t Brush::Node::get_arg_count |
( |
| ) |
const |
|
inline |
◆ get_arg_types()
| auto Brush::Node::get_arg_types |
( |
| ) |
const |
|
inline |
◆ get_feature()
| string Brush::Node::get_feature |
( |
| ) |
const |
|
inline |
◆ get_feature_type()
| DataType Brush::Node::get_feature_type |
( |
| ) |
const |
|
inline |
◆ get_is_weighted()
| bool Brush::Node::get_is_weighted |
( |
| ) |
const |
|
inline |
◆ get_keep_split_feature()
| bool Brush::Node::get_keep_split_feature |
( |
| ) |
const |
|
inline |
◆ get_model()
◆ get_name()
| auto Brush::Node::get_name |
( |
bool | include_weight = true | ) |
const |
|
noexcept |
gets a string version of the node for printing.
get the name of the node.
- Parameters
-
| include_weight | whether to include the node's weight in the output. Multiplications by one are omitted. |
- Returns
- string version of the node.
-
name
Definition at line 20 of file node.cpp.
◆ get_node_hash()
| size_t Brush::Node::get_node_hash |
( |
bool | include_const = true | ) |
const |
|
inline |
◆ get_prob_change()
| float Brush::Node::get_prob_change |
( |
| ) |
const |
|
inline |
◆ get_prob_keep()
| float Brush::Node::get_prob_keep |
( |
| ) |
const |
|
inline |
◆ get_ret_type()
| DataType Brush::Node::get_ret_type |
( |
| ) |
const |
|
inline |
◆ init()
| void Brush::Node::init |
( |
| ) |
|
|
inline |
◆ operator!=()
| auto Brush::Node::operator!= |
( |
const Node & | rhs | ) |
const -> bool
|
|
inlinenoexcept |
◆ operator<()
| auto Brush::Node::operator< |
( |
const Node & | rhs | ) |
const -> bool
|
|
inlinenoexcept |
◆ operator<=()
| auto Brush::Node::operator<= |
( |
const Node & | rhs | ) |
const -> bool
|
|
inlinenoexcept |
◆ operator==()
| auto Brush::Node::operator== |
( |
const Node & | rhs | ) |
const -> bool
|
|
inlinenoexcept |
◆ operator>()
| auto Brush::Node::operator> |
( |
const Node & | rhs | ) |
const -> bool
|
|
inlinenoexcept |
◆ operator>=()
| auto Brush::Node::operator>= |
( |
const Node & | rhs | ) |
const -> bool
|
|
inlinenoexcept |
◆ set_feature()
| void Brush::Node::set_feature |
( |
string | f | ) |
|
|
inline |
◆ set_feature_type()
| void Brush::Node::set_feature_type |
( |
DataType | ft | ) |
|
|
inline |
◆ set_is_weighted()
| void Brush::Node::set_is_weighted |
( |
bool | is_weighted | ) |
|
|
inline |
◆ set_keep_split_feature()
| void Brush::Node::set_keep_split_feature |
( |
bool | keep | ) |
|
|
inline |
◆ set_prob_change()
| void Brush::Node::set_prob_change |
( |
float | w | ) |
|
|
inline |
◆ set_signature()
template<typename S>
| void Brush::Node::set_signature |
( |
| ) |
|
|
inline |
◆ arg_types
| std::vector<DataType> Brush::Node::arg_types |
argument data types
Definition at line 99 of file node.h.
◆ center_op
| bool Brush::Node::center_op |
whether to center the operator in pretty printing
Definition at line 125 of file node.h.
◆ feature
feature name for terminals or splitting nodes
Definition at line 303 of file node.h.
◆ feature_type
feature type for terminals or splitting nodes
Definition at line 306 of file node.h.
◆ is_weighted
| bool Brush::Node::is_weighted |
whether this node is weighted (ignored in nodes that must have weights, such as meanLabel, constants, splits)
Definition at line 116 of file node.h.
◆ keep_split_feature
| bool Brush::Node::keep_split_feature = false |
fix the SplitBest feature when the node is fixed
Definition at line 309 of file node.h.
◆ name
full name of the node, with types
Definition at line 92 of file node.h.
◆ node_is_fixed
| bool Brush::Node::node_is_fixed |
whether the node is replaceable. Weights are still optimized.
Definition at line 112 of file node.h.
◆ node_type
the node type
Definition at line 94 of file node.h.
◆ prob_change
| float Brush::Node::prob_change |
chance of node being selected for variation. This will take into account if the node is fixed, but not the weight (a fixed weight just gets propagated). Can be affected by node_is_fixed. should not be accessed directly.
Definition at line 119 of file node.h.
◆ ret_type
return data type
Definition at line 97 of file node.h.
◆ sig_dual_hash
| std::size_t Brush::Node::sig_dual_hash |
a hash of the dual of the signature (for NLS)
Definition at line 103 of file node.h.
◆ sig_hash
| std::size_t Brush::Node::sig_hash |
a hash of the signature
Definition at line 101 of file node.h.
the weights of the node. also used for splitting thresholds.
Definition at line 122 of file node.h.
◆ weight_is_fixed
| bool Brush::Node::weight_is_fixed |
whether the weight should be kept during variation. Notice that weight_is_fixed alows us to fix the weight of certain nodes.
Definition at line 114 of file node.h.
The documentation for this struct was generated from the following files: