pub struct FoilLearner {
pub max_depth: usize,
pub min_gain: f64,
}Expand description
FOIL (First Order Inductive Learner) algorithm scaffolding.
Fields§
§max_depth: usizeMaximum clause depth.
min_gain: f64Minimum information gain threshold.
Implementations§
Source§impl FoilLearner
impl FoilLearner
Sourcepub fn foil_gain(&self, t: f64, p0: f64, n0: f64, p1: f64, n1: f64) -> f64
pub fn foil_gain(&self, t: f64, p0: f64, n0: f64, p1: f64, n1: f64) -> f64
FOIL information gain for a literal L. Gain(L) = t * (log2(p1/(p1+n1)) - log2(p0/(p0+n0))) where p0/n0 are positive/negative before adding L, p1/n1 after.
Sourcepub fn covering_clauses_needed(&self, num_positives: usize) -> usize
pub fn covering_clauses_needed(&self, num_positives: usize) -> usize
Greedy covering algorithm: add clauses until all positives are covered. Returns the number of clauses needed (simplified).
Auto Trait Implementations§
impl Freeze for FoilLearner
impl RefUnwindSafe for FoilLearner
impl Send for FoilLearner
impl Sync for FoilLearner
impl Unpin for FoilLearner
impl UnsafeUnpin for FoilLearner
impl UnwindSafe for FoilLearner
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