pub struct DL85<C, D, E, H>where
C: Caching + ?Sized,
D: OptimalDepth2Tree + ?Sized,
E: ErrorWrapper + ?Sized,
H: Heuristic + ?Sized,{ /* 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>where
C: Caching + ?Sized,
D: OptimalDepth2Tree + ?Sized,
E: ErrorWrapper + ?Sized,
H: Heuristic + ?Sized,
impl<C, D, E, H> DL85<C, D, E, H>where
C: Caching + ?Sized,
D: OptimalDepth2Tree + ?Sized,
E: ErrorWrapper + ?Sized,
H: Heuristic + ?Sized,
Sourcepub 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
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.
Sourcepub fn config(&self) -> DL85Config
pub fn config(&self) -> DL85Config
The configuration of the search.
Sourcepub fn partial_fit(&mut self, cover: &mut Cover) -> SearchResult
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.
Sourcepub fn statistics(&self) -> &SearchStatistics
pub fn statistics(&self) -> &SearchStatistics
Counters of the search.
Sourcepub fn elapsed_seconds(&self) -> f64
pub fn elapsed_seconds(&self) -> f64
Seconds since the search started.
Sourcepub fn time_is_exhausted(&self) -> bool
pub fn time_is_exhausted(&self) -> bool
Whether the time limit is reached.
Sourcepub fn cache_entry_to_tree_entry(&self, cache_entry: &CacheEntry) -> NodeInfos
pub fn cache_entry_to_tree_entry(&self, cache_entry: &CacheEntry) -> NodeInfos
Converts a cache entry into the content of a tree node.