Struct ndarray_glm::model::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
sourceimpl<F> Dataset<F> where
F: Float,
impl<F> Dataset<F> where
F: Float,
sourcepub fn linear_predictor(&self, regressors: &Array1<F>) -> Array1<F>
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
sourcepub fn hat(&self) -> RegressionResult<Ref<'_, Array2<F>>>
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.
sourcepub fn leverage(&self) -> RegressionResult<Array1<F>>
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> !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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more