pub struct TermShape { /* private fields */ }Expand description
One term’s shape function: piecewise constant on the grid its trees cut its features into, centered to mean zero over the training rows.
Feature a of the term (features) has the cells of
axes[a]; values holds one value per
grid cell, row-major (the first feature’s cell slowest), so a main term
has axes[0].cells() values and a pair axes[0].cells() × axes[1].cells(). Built only by shape_functions and term_shape,
so the three always agree.
Implementations§
Source§impl TermShape
impl TermShape
Sourcepub fn cell(&self, x: &[f32]) -> Result<usize>
pub fn cell(&self, x: &[f32]) -> Result<usize>
The index into values of the cell holding the
feature values x (one per feature of the term; NaN is missing, a
category no split names is the axis’s “other” cell).
§Errors
HessboostError::DimensionMismatch unless x has one value per
feature of the term.
Trait Implementations§
impl StructuralPartialEq for TermShape
Auto Trait Implementations§
impl Freeze for TermShape
impl RefUnwindSafe for TermShape
impl Send for TermShape
impl Sync for TermShape
impl Unpin for TermShape
impl UnsafeUnpin for TermShape
impl UnwindSafe for TermShape
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more