pub trait Heuristic: Send + Sync {
// Required method
fn compute(
&self,
cover: &mut Cover,
candidates: &mut Vec<usize>,
) -> Vec<f64>;
// Provided method
fn compute_with_scorer(
&self,
parent_entropy: f64,
cover: &mut Cover,
candidates: &mut Vec<usize>,
scorer: Box<dyn Fn(&[usize], &[usize], &[usize], f64) -> f64>,
lower_is_better: bool,
) -> Vec<f64> { ... }
}Expand description
Ranks candidate features at a node.
Required Methods§
Provided Methods§
Sourcefn compute_with_scorer(
&self,
parent_entropy: f64,
cover: &mut Cover,
candidates: &mut Vec<usize>,
scorer: Box<dyn Fn(&[usize], &[usize], &[usize], f64) -> f64>,
lower_is_better: bool,
) -> Vec<f64>
fn compute_with_scorer( &self, parent_entropy: f64, cover: &mut Cover, candidates: &mut Vec<usize>, scorer: Box<dyn Fn(&[usize], &[usize], &[usize], f64) -> f64>, lower_is_better: bool, ) -> Vec<f64>
Scores each candidate with scorer and sorts them, ascending when
lower_is_better and descending otherwise.
Trait Implementations§
Source§impl From<SearchHeuristic> for Box<dyn Heuristic>
impl From<SearchHeuristic> for Box<dyn Heuristic>
Source§fn from(value: SearchHeuristic) -> Self
fn from(value: SearchHeuristic) -> Self
Converts to this type from the input type.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".