pub struct RuleContext {
pub depth: usize,
pub upper_bound: f64,
pub node_lower_bound: f64,
pub node_upper_bound: f64,
pub item: usize,
pub support: usize,
pub position: usize,
pub discrepancy: usize,
pub gain: f64,
pub error: f64,
pub leaf_error: f64,
}Expand description
What the rules know about the node being evaluated.
Fields§
§depth: usizeDepth of the node (the root is at 0).
upper_bound: f64Error the subtree must beat to be of use to its parent.
node_lower_bound: f64Proven lower bound on the node’s error.
node_upper_bound: f64Upper bound the node was last solved under (infinite if never).
item: usizeThe item (feature and branch) leading to the node.
support: usizeNumber of instances in the node.
position: usizeRank of the node’s feature among its siblings.
discrepancy: usizeSum of the ranks along the path from the root.
gain: f64Accumulated heuristic score lost along the path by not taking the best-ranked feature.
error: f64Best error found so far for the node.
leaf_error: f64Error of the node as a leaf.
Implementations§
Source§impl RuleContext
impl RuleContext
pub fn depth(&mut self, depth: usize)
pub fn upper_bound(&mut self, upper_bound: f64)
pub fn node_lower_bound(&mut self, node_lower_bound: f64)
pub fn node_upper_bound(&mut self, node_upper_bound: f64)
pub fn item(&mut self, item: usize)
pub fn support(&mut self, support: usize)
pub fn position(&mut self, position: usize)
pub fn gain(&mut self, gain: f64)
pub fn error(&mut self, error: f64)
pub fn leaf_error(&mut self, error: f64)
pub fn discrepancy(&mut self, discrepancy: usize)
Trait Implementations§
Source§impl Debug for RuleContext
impl Debug for RuleContext
Auto Trait Implementations§
impl Freeze for RuleContext
impl RefUnwindSafe for RuleContext
impl Send for RuleContext
impl Sync for RuleContext
impl Unpin for RuleContext
impl UnsafeUnpin for RuleContext
impl UnwindSafe for RuleContext
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more