pub struct CowDataset<'a, T = f64>where
T: Clone,{
pub features: ZeroCopyArray<'a, T>,
pub target: Cow<'a, ArrayBase<OwnedRepr<T>, Dim<[usize; 1]>>>,
}Expand description
Zero-copy features and target pair
Fields§
§features: ZeroCopyArray<'a, T>§target: Cow<'a, ArrayBase<OwnedRepr<T>, Dim<[usize; 1]>>>Implementations§
Source§impl<'a, T> ZeroCopyDataset<'a, T>where
T: Clone,
impl<'a, T> ZeroCopyDataset<'a, T>where
T: Clone,
Sourcepub fn from_owned(
features: ArrayBase<OwnedRepr<T>, Dim<[usize; 2]>>,
target: ArrayBase<OwnedRepr<T>, Dim<[usize; 1]>>,
) -> ZeroCopyDataset<'a, T>
pub fn from_owned( features: ArrayBase<OwnedRepr<T>, Dim<[usize; 2]>>, target: ArrayBase<OwnedRepr<T>, Dim<[usize; 1]>>, ) -> ZeroCopyDataset<'a, T>
Create from owned data
Sourcepub fn from_borrowed(
features: ArrayBase<ViewRepr<&'a T>, Dim<[usize; 2]>>,
target: &'a ArrayBase<OwnedRepr<T>, Dim<[usize; 1]>>,
) -> ZeroCopyDataset<'a, T>
pub fn from_borrowed( features: ArrayBase<ViewRepr<&'a T>, Dim<[usize; 2]>>, target: &'a ArrayBase<OwnedRepr<T>, Dim<[usize; 1]>>, ) -> ZeroCopyDataset<'a, T>
Create from borrowed data
Sourcepub fn is_fully_zero_copy(&self) -> bool
pub fn is_fully_zero_copy(&self) -> bool
Check if both features and target are zero-copy
Sourcepub fn n_features(&self) -> usize
pub fn n_features(&self) -> usize
Get number of features
Sourcepub fn validate(&self) -> Result<(), SklearsError>
pub fn validate(&self) -> Result<(), SklearsError>
Validate that features and target have consistent sample counts
Trait Implementations§
Auto Trait Implementations§
impl<'a, T> Freeze for ZeroCopyDataset<'a, T>
impl<'a, T> RefUnwindSafe for ZeroCopyDataset<'a, T>where
T: RefUnwindSafe,
impl<'a, T> Send for ZeroCopyDataset<'a, T>
impl<'a, T> Sync for ZeroCopyDataset<'a, T>where
T: Sync,
impl<'a, T> Unpin for ZeroCopyDataset<'a, T>
impl<'a, T> UnwindSafe for ZeroCopyDataset<'a, T>where
T: RefUnwindSafe,
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> 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