Shrinkage

shrinkage::CoefficientLayout

Shrinkage for Rust · rust · 0.3.0

pub struct CoefficientLayout

A feature-by-response coefficient matrix stored in response-major order.

Each response owns a contiguous vector of feature coefficients. Entry (feature, response) has index response * nfeatures + feature. Intercepts are separate and never appear in this layout. This CPU layout is provisional.

Inherent implementation

impl CoefficientLayout

index

pub fn index(self, feature: usize, response: usize) -> Option<usize>

Flat index of a feature and response, or None for an invalid axis index.

is_empty

pub fn is_empty(self) -> bool

Whether there are no feature coefficients.

len

pub fn len(self) -> usize

Number of coefficient entries, excluding intercepts.

new

pub fn new(nfeatures: usize, nresponses: usize) -> Result<Self, FitError>

Specify both axes, allowing zero features but requiring a response.

Errors

Reject zero responses or a coefficient count that overflows usize.

nfeatures

pub fn nfeatures(self) -> usize

Number of training features.

nresponses

pub fn nresponses(self) -> usize

Number of responses.

Implementation of Clone

impl Clone for CoefficientLayout

clone

fn clone(&self) -> Self

Implementation of Copy

impl Copy for CoefficientLayout

Implementation of Debug

impl Debug for CoefficientLayout

fmt

fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result

Implementation of Eq

impl Eq for CoefficientLayout

Implementation of PartialEq

impl PartialEq for CoefficientLayout

eq

fn eq(&self, other: &Self) -> bool

Implementation of StructuralPartialEq

impl StructuralPartialEq for CoefficientLayout

Implementation of Freeze

impl Freeze for CoefficientLayout

Implementation of RefUnwindSafe

impl RefUnwindSafe for CoefficientLayout

Implementation of Send

impl Send for CoefficientLayout

Implementation of Sync

impl Sync for CoefficientLayout

Implementation of Unpin

impl Unpin for CoefficientLayout

Implementation of UnsafeUnpin

impl UnsafeUnpin for CoefficientLayout

Implementation of UnwindSafe

impl UnwindSafe for CoefficientLayout

Implementation of Any

impl<T> Any for T where T: 'static + ?Sized

Implementation of Boilerplate

impl<T> Boilerplate for T where T: Copy + Send + Sync + Debug + PartialEq + 'static

Implementation of Borrow

impl<T> Borrow<T> for T where T: ?Sized

Implementation of BorrowMut

impl<T> BorrowMut<T> for T where T: ?Sized

Implementation of ByRef

impl<T> ByRef<T> for T

Implementation of CastableFrom

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT where ST: ?Sized, DT: ?Sized

Implementation of CastableFrom

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT where ST: ?Sized, DT: ?Sized

Implementation of CloneToUninit

impl<T> CloneToUninit for T where T: Clone

Implementation of Equivalent

impl<Q, K> Equivalent<K> for Q where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized

Implementation of Equivalent

impl<Q, K> Equivalent<K> for Q where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized

Implementation of From

impl<T> From<T> for T

Implementation of Imply

impl<T, U> Imply<T> for U where T: ?Sized, U: ?Sized

Implementation of Into

impl<T, U> Into<U> for T where U: From<T>

Implementation of IntoEither

impl<T> IntoEither for T

Implementation of Pointable

impl<T> Pointable for T

Implementation of Read

impl<T> Read<Exclusive, BecauseExclusive> for T where T: ?Sized

Implementation of Same

impl<T> Same for T

Implementation of Scalar

impl<T> Scalar for T where T: 'static + Clone + PartialEq + Debug

Implementation of SupersetOf

impl<SS, SP> SupersetOf<SS> for SP where SS: SubsetOf<SP>

Implementation of ToOwned

impl<T> ToOwned for T where T: Clone

Implementation of TryFrom

impl<T, U> TryFrom<U> for T where U: Into<T>

Implementation of TryInto

impl<T, U> TryInto<U> for T where U: TryFrom<T>