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: TreeImplementations§
Source§impl ConTree
impl ConTree
Sourcepub fn with_config(config: SearchConfig) -> Self
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.
Sourcepub 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
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.
Sourcepub fn with_random_state(self, seed: u64) -> Self
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.
Sourcepub fn fit(&mut self, dataset: &Dataset) -> Result<FitOutcome, SearchError>
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.
Sourcepub fn trajectory(&self) -> &[(f64, usize)]
pub fn trajectory(&self) -> &[(f64, usize)]
The anytime profile of the last fit: (seconds, error) at every
improvement of the root incumbent.
Sourcepub fn status(&self) -> SearchStatus
pub fn status(&self) -> SearchStatus
Why the last fit stopped.
pub fn statistics(&self) -> Statistics
pub fn select_point(&mut self, config: &SearchConfig, bound: &Bound) -> usize
Sourcepub fn get_solution_tree(&mut self)
pub fn get_solution_tree(&mut self)
Rebuilds self.tree from the cache.