Skip to main content

LGDTBuilder

Struct LGDTBuilder 

Source
pub struct LGDTBuilder<D>{ /* private fields */ }
Expand description

Builder for LGDT. A depth-2 solver is required.

use dtrees_rs::algorithms::greedy::factories::with_error_minimizer;

let lgdt = with_error_minimizer().max_depth(5).min_support(5).build();
assert!(lgdt.is_ok());

Implementations§

Source§

impl<D> LGDTBuilder<D>

Source

pub fn with_default_info_gain_maximizer() -> LGDTBuilder<InfoGainMaximizer<NativeError>>

A builder whose lookahead maximises information gain.

Source

pub fn with_default_error_minimizer() -> LGDTBuilder<ErrorMinimizer<NativeError>>

A builder whose lookahead minimises the error.

Source

pub fn min_support(self, value: usize) -> Self

Minimum number of instances in each leaf.

Source

pub fn max_depth(self, value: usize) -> Self

Maximum depth of the tree.

Source

pub fn max_error(self, value: f64) -> Self

Only trees with a lower error are accepted.

Source

pub fn max_time(self, value: f64) -> Self

Time limit in seconds.

Source

pub fn search(self, value: Box<D>) -> Self

The depth-2 solver used for the lookahead.

Source

pub fn build(self) -> Result<LGDT<D>, String>

Builds the learner, or says which required part is missing.

Trait Implementations§

Source§

impl<D> Default for LGDTBuilder<D>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl<D> Freeze for LGDTBuilder<D>
where D: ?Sized,

§

impl<D> RefUnwindSafe for LGDTBuilder<D>
where D: RefUnwindSafe + ?Sized,

§

impl<D> Send for LGDTBuilder<D>
where D: Send + ?Sized,

§

impl<D> Sync for LGDTBuilder<D>
where D: Sync + ?Sized,

§

impl<D> Unpin for LGDTBuilder<D>
where D: ?Sized,

§

impl<D> UnsafeUnpin for LGDTBuilder<D>
where D: ?Sized,

§

impl<D> UnwindSafe for LGDTBuilder<D>
where D: UnwindSafe + ?Sized,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

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

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

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

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.