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,
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.