pub struct BestFirstTreeBuilder {
pub nodes: Vec<TreeNode>,
pub node_queue: BinaryHeap<NodePriority>,
pub next_node_id: usize,
pub n_leaves: usize,
}Expand description
Best-first tree builder
Fields§
§nodes: Vec<TreeNode>Nodes in the tree
node_queue: BinaryHeap<NodePriority>Priority queue of nodes to expand (ordered by potential decrease)
next_node_id: usizeNext node ID
n_leaves: usizeCurrent number of leaves
Implementations§
Source§impl BestFirstTreeBuilder
impl BestFirstTreeBuilder
Sourcepub fn new(
x: &Array2<f64>,
y: &Array1<i32>,
config: &DecisionTreeConfig,
n_classes: usize,
) -> Self
pub fn new( x: &Array2<f64>, y: &Array1<i32>, config: &DecisionTreeConfig, n_classes: usize, ) -> Self
Create a new best-first tree builder
Sourcepub fn build_tree(
&mut self,
x: &Array2<f64>,
y: &Array1<i32>,
config: &DecisionTreeConfig,
n_classes: usize,
) -> Result<()>
pub fn build_tree( &mut self, x: &Array2<f64>, y: &Array1<i32>, config: &DecisionTreeConfig, n_classes: usize, ) -> Result<()>
Build the tree using best-first strategy
Trait Implementations§
Auto Trait Implementations§
impl Freeze for BestFirstTreeBuilder
impl RefUnwindSafe for BestFirstTreeBuilder
impl Send for BestFirstTreeBuilder
impl Sync for BestFirstTreeBuilder
impl Unpin for BestFirstTreeBuilder
impl UnwindSafe for BestFirstTreeBuilder
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more