pub struct FixedSamples<T, const M: usize, const N: usize>where
T: Numeric,{ /* private fields */ }Expand description
Fixed-size dataset with compile-time shape checking
Implementations§
Source§impl<T, const M: usize, const N: usize> FixedSamples<T, M, N>where
T: Numeric,
impl<T, const M: usize, const N: usize> FixedSamples<T, M, N>where
T: Numeric,
Sourcepub fn new(data: [[T; N]; M]) -> FixedSamples<T, M, N>
pub fn new(data: [[T; N]; M]) -> FixedSamples<T, M, N>
Create from nested array
Sourcepub fn from_flat_slice(
slice: &[T],
) -> Result<FixedSamples<T, M, N>, SklearsError>
pub fn from_flat_slice( slice: &[T], ) -> Result<FixedSamples<T, M, N>, SklearsError>
Create from flat slice, checking length at runtime
Sourcepub const fn sample_count() -> usize
pub const fn sample_count() -> usize
Get sample count at compile time
Sourcepub const fn feature_count() -> usize
pub const fn feature_count() -> usize
Get feature count at compile time
Sourcepub fn sample(&self, index: usize) -> FixedFeatures<T, N>where
T: FloatBounds,
pub fn sample(&self, index: usize) -> FixedFeatures<T, N>where
T: FloatBounds,
Get a sample as FixedFeatures
Sourcepub fn from_array2(
array: &ArrayBase<OwnedRepr<T>, Dim<[usize; 2]>>,
) -> Result<FixedSamples<T, M, N>, SklearsError>
pub fn from_array2( array: &ArrayBase<OwnedRepr<T>, Dim<[usize; 2]>>, ) -> Result<FixedSamples<T, M, N>, SklearsError>
Create from Array2, checking shape at runtime
Trait Implementations§
Source§impl<T, const M: usize, const N: usize> Clone for FixedSamples<T, M, N>
impl<T, const M: usize, const N: usize> Clone for FixedSamples<T, M, N>
Source§fn clone(&self) -> FixedSamples<T, M, N>
fn clone(&self) -> FixedSamples<T, M, N>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<T, const M: usize, const N: usize> Index<usize> for FixedSamples<T, M, N>where
T: Numeric,
impl<T, const M: usize, const N: usize> Index<usize> for FixedSamples<T, M, N>where
T: Numeric,
Source§impl<T, const M: usize, const N: usize> IndexMut<usize> for FixedSamples<T, M, N>where
T: Numeric,
impl<T, const M: usize, const N: usize> IndexMut<usize> for FixedSamples<T, M, N>where
T: Numeric,
Source§impl<T, const M: usize, const N: usize> MinFeatures<1> for FixedSamples<T, M, N>where
T: Numeric,
impl<T, const M: usize, const N: usize> MinFeatures<1> for FixedSamples<T, M, N>where
T: Numeric,
const FEATURE_COUNT: usize = N
const SATISFIES_MIN_FEATURES: bool = _
Source§impl<T, const M: usize, const N: usize> MinSamples<1> for FixedSamples<T, M, N>where
T: Numeric,
impl<T, const M: usize, const N: usize> MinSamples<1> for FixedSamples<T, M, N>where
T: Numeric,
const SAMPLE_COUNT: usize = M
const SATISFIES_MIN_SAMPLES: bool = _
Source§impl<T, const M: usize, const N: usize> ValidDimensions for FixedSamples<T, M, N>where
T: Numeric,
impl<T, const M: usize, const N: usize> ValidDimensions for FixedSamples<T, M, N>where
T: Numeric,
impl<T, const M: usize, const N: usize> StructuralPartialEq for FixedSamples<T, M, N>where
T: Numeric,
Auto Trait Implementations§
impl<T, const M: usize, const N: usize> Freeze for FixedSamples<T, M, N>where
T: Freeze,
impl<T, const M: usize, const N: usize> RefUnwindSafe for FixedSamples<T, M, N>where
T: RefUnwindSafe,
impl<T, const M: usize, const N: usize> Send for FixedSamples<T, M, N>
impl<T, const M: usize, const N: usize> Sync for FixedSamples<T, M, N>
impl<T, const M: usize, const N: usize> Unpin for FixedSamples<T, M, N>where
T: Unpin,
impl<T, const M: usize, const N: usize> UnsafeUnpin for FixedSamples<T, M, N>where
T: UnsafeUnpin,
impl<T, const M: usize, const N: usize> UnwindSafe for FixedSamples<T, M, N>where
T: UnwindSafe,
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.