Skip to main content

DL85

Struct DL85 

Source
pub struct DL85<C, D, E, H>{ /* private fields */ }
Expand description

DL8.5: optimal decision trees over binary features by dynamic programming with branch-and-bound and a cache of subproblems.

A subproblem is the set of instances reaching a node, identified by the itemset of tests on the path to it. The search explores features at each node, prunes children with the upper bound left by their sibling, and caches every solved subproblem so it is solved once.

The search is also anytime. Relaxable search rules (see rules) restrict each pass, and the search restarts with widened budgets until a pass completes, which proves the tree optimal.

Aglin, Nijssen and Schaus, Learning Optimal Decision Trees Using Caching Branch-and-Bound Search (AAAI 2020). Build one with DL85Builder.

Implementations§

Source§

impl<C, D, E, H> DL85<C, D, E, H>

Source

pub fn new( config: DL85Config, cache: Box<C>, depth2_search: Box<D>, error_fn: Box<E>, heuristic_fn: Box<H>, node_rules: RuleManager, search_rules: RuleManager, time_rule: TimeLimitRule, ) -> Self

Assembles a search from its parts. Prefer DL85Builder.

Source

pub fn config(&self) -> DL85Config

The configuration of the search.

Source

pub fn partial_fit(&mut self, cover: &mut Cover) -> SearchResult

Runs one pass of the search and rebuilds the tree.

The first call initialises the cache and the rules. When the result’s reason is Reason::RuleReason, a rule cut the pass short and the rules are relaxed for the next one; any other reason means the search is over.

Source

pub fn statistics(&self) -> &SearchStatistics

Counters of the search.

Source

pub fn elapsed_seconds(&self) -> f64

Seconds since the search started.

Source

pub fn time_is_exhausted(&self) -> bool

Whether the time limit is reached.

Source

pub fn cache_entry_to_tree_entry(&self, cache_entry: &CacheEntry) -> NodeInfos

Converts a cache entry into the content of a tree node.

Trait Implementations§

Source§

impl<C, D, E, H> TreeSearchAlgorithm for DL85<C, D, E, H>

Source§

fn fit(&mut self, cover: &mut Cover) -> Result<(), FitError>

Runs passes until one completes or the time limit is reached.

Source§

fn tree(&self) -> &Tree

The tree learned by the last fit.
Source§

fn error(&self) -> f64

Training error of the learned tree.
Source§

fn get_candidates( &self, cover: &mut Cover, min_sup: usize, provided_candidates: Option<&[usize]>, previous: Option<usize>, ) -> Vec<usize>

Features that can split the current node. See find_valid_split_attributes.

Auto Trait Implementations§

§

impl<C, D, E, H> !RefUnwindSafe for DL85<C, D, E, H>

§

impl<C, D, E, H> !UnwindSafe for DL85<C, D, E, H>

§

impl<C, D, E, H> Freeze for DL85<C, D, E, H>
where C: ?Sized, D: ?Sized, E: ?Sized, H: ?Sized,

§

impl<C, D, E, H> Send for DL85<C, D, E, H>
where C: Send + ?Sized, D: Send + ?Sized, E: ?Sized, H: ?Sized,

§

impl<C, D, E, H> Sync for DL85<C, D, E, H>
where C: Sync + ?Sized, D: Sync + ?Sized, E: ?Sized, H: ?Sized,

§

impl<C, D, E, H> Unpin for DL85<C, D, E, H>
where C: ?Sized, D: ?Sized, E: ?Sized, H: ?Sized,

§

impl<C, D, E, H> UnsafeUnpin for DL85<C, D, E, H>
where C: ?Sized, D: ?Sized, E: ?Sized, H: ?Sized,

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.