pub struct Dataset { /* private fields */ }Expand description
A named, typed, immutable table of columns.
Build one with Dataset::from_columns; tests then refer to columns by
their integer index (see Dataset::index_of).
Implementations§
Source§impl Dataset
impl Dataset
Sourcepub fn from_columns(
cols: Vec<(String, ColumnKind, Vec<f64>)>,
) -> Result<Self, CIError>
pub fn from_columns( cols: Vec<(String, ColumnKind, Vec<f64>)>, ) -> Result<Self, CIError>
Build a dataset from (name, kind, values) triples.
Discrete columns are factorized into contiguous codes (0..cardinality)
in first-seen order; -0.0/0.0 are grouped together.
Continuous columns store their raw values.
§Errors
Returns CIError::DimensionMismatch if the columns do not all share a
common length, or if two columns share a name (names must be unique).
Returns CIError::MissingData if a discrete column contains NaN, or a
continuous column contains any non-finite value (NaN or ±inf).
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Dataset
impl RefUnwindSafe for Dataset
impl Send for Dataset
impl Sync for Dataset
impl Unpin for Dataset
impl UnsafeUnpin for Dataset
impl UnwindSafe for Dataset
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