Skip to main content

ConTree

Struct ConTree 

Source
pub struct ConTree {
    pub tree: Tree,
    /* private fields */
}
Expand description

Exact ConTree search for optimal decision trees on continuous features.

A depth-first branch-and-bound search with caching. For each feature it explores candidate thresholds by bisection over intervals, and uses the errors already found to prune whole intervals of thresholds at once.

Fields§

§tree: Tree

Implementations§

Source§

impl ConTree

Source

pub fn with_config(config: SearchConfig) -> Self

Builds a solver from a SearchConfig.

This is the preferred constructor; Self::new takes the same settings as positional arguments.

Source

pub fn new( min_sup: usize, max_depth: usize, max_time: f64, max_error: usize, split_selection_strategy: PointSelector, max_gap: usize, use_heuristic: bool, fast_d2: bool, ) -> Self

Builds a solver from positional settings. See Self::with_config.

Source

pub fn with_random_state(self, seed: u64) -> Self

Seeds the random generator used by PointSelector::Random, making runs reproducible. Unseeded solvers draw their seed from the OS.

Source

pub fn fit(&mut self, dataset: &Dataset) -> Result<FitOutcome, SearchError>

Searches for the optimal tree.

Returns the tree, the search counters, and why the search stopped. Only SearchStatus::Optimal means the tree is proven best for the given depth and minimum support.

Source

pub fn trajectory(&self) -> &[(f64, usize)]

The anytime profile of the last fit: (seconds, error) at every improvement of the root incumbent.

Source

pub fn status(&self) -> SearchStatus

Why the last fit stopped.

Source

pub fn statistics(&self) -> Statistics

Source

pub fn select_point(&mut self, config: &SearchConfig, bound: &Bound) -> usize

Source

pub fn get_solution_tree(&mut self)

Rebuilds self.tree from the cache.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V