pub struct Sample {
pub features: Vec<f64>,
pub target: f64,
pub weight: f64,
}Available on crate feature
alloc only.Expand description
A single owned observation with feature vector and target value.
For regression, target is the continuous value to predict.
For binary classification, target is 0.0 or 1.0.
For multi-class, target is the class index as f64 (0.0, 1.0, 2.0, …).
Fields§
§features: Vec<f64>Feature values for this observation.
target: f64Target value (regression) or class label (classification).
weight: f64Optional sample weight (default 1.0).
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Sample
impl<'de> Deserialize<'de> for Sample
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Observation for &Sample
impl Observation for &Sample
Source§impl Observation for Sample
impl Observation for Sample
Auto Trait Implementations§
impl Freeze for Sample
impl RefUnwindSafe for Sample
impl Send for Sample
impl Sync for Sample
impl Unpin for Sample
impl UnsafeUnpin for Sample
impl UnwindSafe for Sample
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