Struct Dataset

Source
pub struct Dataset<F>
where F: Float,
{ pub y: Array1<F>, pub x: Array2<F>, pub linear_offset: Option<Array1<F>>, pub weights: Option<Array1<F>>, /* private fields */ }

Fields§

§y: Array1<F>

the observation of response data by event

§x: Array2<F>

the design matrix with events in rows and instances in columns

§linear_offset: Option<Array1<F>>

The offset in the linear predictor for each data point. This can be used to fix the effect of control variables.

§weights: Option<Array1<F>>

The weight of each observation

Implementations§

Source§

impl<F> Dataset<F>
where F: Float,

Source

pub fn linear_predictor(&self, regressors: &Array1<F>) -> Array1<F>

Returns the linear predictors, i.e. the design matrix multiplied by the regression parameters. Each entry in the resulting array is the linear predictor for a given observation. If linear offsets for each observation are provided, these are added to the linear predictors

Source

pub fn hat(&self) -> RegressionResult<Ref<'_, Array2<F>>>

Returns the hat matrix of the dataset of covariate data, also known as the “projection” or “influence” matrix.

Source

pub fn leverage(&self) -> RegressionResult<Array1<F>>

Returns the leverage for each observation. This is given by the diagonal of the projection matrix and indicates the sensitivity of each prediction to its corresponding observation.

Auto Trait Implementations§

§

impl<F> !Freeze for Dataset<F>

§

impl<F> !RefUnwindSafe for Dataset<F>

§

impl<F> Send for Dataset<F>
where F: Send,

§

impl<F> !Sync for Dataset<F>

§

impl<F> Unpin for Dataset<F>

§

impl<F> UnwindSafe for Dataset<F>
where F: RefUnwindSafe,

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

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

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

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

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

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

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V