pub struct TreeNode {
pub tree_id: u64,
pub node_id: u64,
pub node_behavior: i32,
pub branch_feature_index: u64,
pub branch_feature_value: f64,
pub true_child_node_id: u64,
pub false_child_node_id: u64,
pub missing_value_tracks_true_child: bool,
pub evaluation_info: Vec<EvaluationInfo>,
pub relative_hit_rate: f64,
}Fields§
§tree_id: u64§node_id: u64§node_behavior: i32The branch mode parameters.
If branch is false, then the parameters in this section must be filled in to determine how the branching functions.
branch_feature_index: u64If the node behavior mode is a branch mode, then these values must be filled in.
branch_feature_value: f64§true_child_node_id: u64§false_child_node_id: u64§missing_value_tracks_true_child: bool§evaluation_info: Vec<EvaluationInfo>§relative_hit_rate: f64The relative hit rate of a node for optimization purposes.
This value has no effect on the accuracy of the result; it allows the tree to optimize for frequent branches. The value is relative, compared to the hit rates of other branch nodes.
You typically use a proportion of training samples that reached this node or some similar metric to derive this value.
Implementations§
Source§impl TreeNode
impl TreeNode
Sourcepub fn node_behavior(&self) -> TreeNodeBehavior
pub fn node_behavior(&self) -> TreeNodeBehavior
Returns the enum value of node_behavior, or the default if the field is set to an invalid enum value.
Sourcepub fn set_node_behavior(&mut self, value: TreeNodeBehavior)
pub fn set_node_behavior(&mut self, value: TreeNodeBehavior)
Sets node_behavior to the provided enum value.
Trait Implementations§
Source§impl Message for TreeNode
impl Message for TreeNode
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Returns the encoded length of the message without a length delimiter.
Source§fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
Encodes the message to a buffer. Read more
Source§fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Encodes the message to a newly allocated buffer.
Source§fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
Encodes the message with a length-delimiter to a buffer. Read more
Source§fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Encodes the message with a length-delimiter to a newly allocated buffer.
Source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Decodes an instance of the message from a buffer. Read more
Source§fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Decodes a length-delimited instance of the message from the buffer.
Source§fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
Decodes an instance of the message from a buffer, and merges it into
self. Read moreSource§fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
Decodes a length-delimited instance of the message from buffer, and
merges it into
self.impl StructuralPartialEq for TreeNode
Auto Trait Implementations§
impl Freeze for TreeNode
impl RefUnwindSafe for TreeNode
impl Send for TreeNode
impl Sync for TreeNode
impl Unpin for TreeNode
impl UnsafeUnpin for TreeNode
impl UnwindSafe for TreeNode
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more