pub struct SampleRef<'a> {
pub features: &'a [f64],
pub target: f64,
pub weight: f64,
}Expand description
A borrowed observation that avoids Vec<f64> allocation.
Use this when features are already available as a contiguous slice (e.g., from Arrow arrays, memory-mapped data, or pre-allocated buffers).
Fields§
§features: &'a [f64]Borrowed feature slice.
target: f64Target value.
weight: f64Sample weight (default 1.0).
Implementations§
Trait Implementations§
Source§impl<'a> Observation for SampleRef<'a>
impl<'a> Observation for SampleRef<'a>
impl<'a> Copy for SampleRef<'a>
Auto Trait Implementations§
impl<'a> Freeze for SampleRef<'a>
impl<'a> RefUnwindSafe for SampleRef<'a>
impl<'a> Send for SampleRef<'a>
impl<'a> Sync for SampleRef<'a>
impl<'a> Unpin for SampleRef<'a>
impl<'a> UnsafeUnpin for SampleRef<'a>
impl<'a> UnwindSafe for SampleRef<'a>
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