Skip to main content

ConTreeLds

Struct ConTreeLds 

Source
pub struct ConTreeLds { /* private fields */ }
Expand description

Anytime ConTree search based on limited discrepancy search.

The search runs in passes. Each pass explores the tree space under a discrepancy budget (how far down the Gini ranking of features it may go) and, for some point selectors, a split budget (how many thresholds per feature it may try). A BudgetSchedule widens both budgets between passes, so a good tree is available early and the last complete pass proves optimality.

Implementations§

Source§

impl ConTreeLds

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>

Runs the anytime search until it stops.

Each pass widens the discrepancy and split budgets. The search ends when a pass completes without being truncated (the tree is optimal), when the schedule has no larger budget to offer, or when the time limit is reached.

Source

pub fn with_schedule(self, schedule: ScheduleKind) -> Self

Chooses how the budget widens from pass to pass. See ScheduleKind.

Source

pub fn schedule(&self) -> ScheduleKind

The budget schedule this solver uses.

Source

pub fn config(&self) -> &SearchConfig

The configuration this solver was built with.

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 partial_fit(&mut self, root_view: &DataView<'_>) -> bool

Runs one pass of the search and returns true once the search is over. The first call initialises the cache and the budget schedule.

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) -> Tree

The tree found by the passes run so far.

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