|
Brush C++ API
A flexible interpretable machine learning framework
|
class holding the data for a node in a tree. More...
#include <node.h>

Public Types | |
| using | HashTuple |
| tuple type for hashing | |
Public Member Functions | |
| Node ()=default | |
| template<typename S> | |
| Node (NodeType type, S signature, bool weighted=false, string feature_name="") noexcept | |
| Constructor used by search space. | |
| template<typename S> | |
| void | set_signature () |
| void | init () |
| string | get_name (bool include_weight=true) const noexcept |
| gets a string version of the node for printing. | |
| string | get_model (const vector< string > &) const noexcept |
| DataType | get_ret_type () const |
| std::size_t | args_type () const |
| auto | get_arg_types () const |
| size_t | get_arg_count () const |
| size_t | get_node_hash (bool include_const=true) const |
| auto | operator== (const Node &rhs) const noexcept -> bool |
| auto | operator!= (const Node &rhs) const noexcept -> bool |
| auto | operator< (const Node &rhs) const noexcept -> bool |
| auto | operator<= (const Node &rhs) const noexcept -> bool |
| auto | operator> (const Node &rhs) const noexcept -> bool |
| auto | operator>= (const Node &rhs) const noexcept -> bool |
| float | get_prob_change () const |
| void | set_prob_change (float w) |
| float | get_prob_keep () const |
| void | set_feature (string f) |
| string | get_feature () const |
| void | set_feature_type (DataType ft) |
| DataType | get_feature_type () const |
| void | set_keep_split_feature (bool keep) |
| bool | get_keep_split_feature () const |
| bool | get_is_weighted () const |
| void | set_is_weighted (bool is_weighted) |
Public Attributes | |
| 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 | |
| using Brush::Node::HashTuple |
tuple type for hashing
|
default |

|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
noexcept |
gets a string version of the node for printing.
get the name of the node.
| include_weight | whether to include the node's weight in the output. Multiplications by one are omitted. |
Definition at line 20 of file node.cpp.


|
inline |
|
inline |
|
inline |
|
inline |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inline |
|
inline |
|
inline |
| std::vector<DataType> Brush::Node::arg_types |
| bool Brush::Node::center_op |
| string Brush::Node::feature |
| DataType Brush::Node::feature_type = DataType::ArrayF |
| bool Brush::Node::is_weighted |
| bool Brush::Node::keep_split_feature = false |
| bool Brush::Node::node_is_fixed |
| float Brush::Node::prob_change |
| std::size_t Brush::Node::sig_dual_hash |
| float Brush::Node::W |
| bool Brush::Node::weight_is_fixed |