[][src]Struct sparrow::scanner::booster::learner::Learner

pub struct Learner {
    pub rho_gamma: f32,
    pub expand_node: usize,
    pub total_count: usize,
    // some fields omitted
}

Statisitics of all weak rules that are being evaluated. The objective of Learner is to find a weak rule that satisfies the condition of the stopping rule.

Fields

rho_gamma: f32expand_node: usizetotal_count: usize

Methods

impl Learner[src]

pub fn new(
    min_gamma: f32,
    default_gamma: f32,
    num_features: usize,
    bins: Vec<Bins>,
    num_splits: usize
) -> Learner
[src]

Create a Learner that search for valid weak rules. default_gamma is the initial value of the edge gamma. bins is vectors of the all thresholds on all candidate features for generating weak rules.

pub fn reset(&mut self)[src]

Reset the statistics of all candidate weak rules (except gamma, because the advantage of the root node is not likely to increase) Trigger when the model or the gamma is changed

pub fn get_max_empirical_ratio_tree_node(&self) -> TreeNode[src]

pub fn is_gamma_significant(&self) -> bool[src]

pub fn update(
    &mut self,
    tree: &Tree,
    data: &[(LabeledData<u8, i8>, (f32, f32, usize, usize))]
) -> Option<TreeNode>
[src]

Update the statistics of all candidate weak rules using current batch of training examples.

pub fn set_gamma(&mut self, gamma: f32) -> bool[src]

pub fn set_expand_node(&mut self, expand_node: usize) -> bool[src]

Trait Implementations

impl<'de> Deserialize<'de> for Learner[src]

impl Serialize for Learner[src]

Auto Trait Implementations

impl RefUnwindSafe for Learner

impl Send for Learner

impl Sync for Learner

impl Unpin for Learner

impl UnwindSafe for Learner

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> Erased for T

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 

type Err = <U as TryFrom<T>>::Err

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,