Skip to main content

ModelBuilderData

Struct ModelBuilderData 

Source
pub struct ModelBuilderData<'a, M, Y, F>
where M: Glm, Y: Yval<M>, F: 'static + Float,
{ /* private fields */ }
Expand description

Holds the data and all the specifications for the model and provides functions to adjust the settings.

Implementations§

Source§

impl<'a, M, Y, F> ModelBuilderData<'a, M, Y, F>
where M: Glm, Y: Yval<M> + Copy, F: Float,

A builder to generate a Model object

Source

pub fn linear_offset(self, linear_offset: Array1<F>) -> Self

Represents an offset added to the linear predictor for each data point. This can be used to control for fixed effects or in multi-level models.

Source

pub fn freq_weights(self, freqs: Array1<usize>) -> Self

Frequency weights (a.k.a. counts) for each observation. Traditionally these are positive integers representing the number of times each observation appears identically.

Source

pub fn var_weights(self, weights: Array1<F>) -> Self

Variance weights (a.k.a. analytic weights) of each observation. These could represent the inverse square of the uncertainties of each measurement.

Source

pub fn no_constant(self) -> Self

Do not add a constant intercept term of 1s to the design matrix. This is rarely recommended, so you probably don’t want to use this option unless you have a very clear sense of why. Note that you can supply uniform or per-observation constant terms using ModelBuilderData::linear_offset.

Source

pub fn no_standardize(self) -> Self

Don’t perform standarization (i.e. scale to 0-mean and 1-variance) of the design matrix. Note that the standardization is handled internally, so the reported result coefficients should be compatible with the input data directly, meaning the user shouldn’t have to interact with them.

Source

pub fn build(self) -> RegressionResult<Model<M, F>, F>
where M: Glm, F: Float,

Auto Trait Implementations§

§

impl<'a, M, Y, F> Freeze for ModelBuilderData<'a, M, Y, F>

§

impl<'a, M, Y, F> RefUnwindSafe for ModelBuilderData<'a, M, Y, F>

§

impl<'a, M, Y, F> Send for ModelBuilderData<'a, M, Y, F>
where M: Send, Y: Sync,

§

impl<'a, M, Y, F> Sync for ModelBuilderData<'a, M, Y, F>
where M: Sync, Y: Sync,

§

impl<'a, M, Y, F> Unpin for ModelBuilderData<'a, M, Y, F>
where M: Unpin, F: Unpin,

§

impl<'a, M, Y, F> UnsafeUnpin for ModelBuilderData<'a, M, Y, F>

§

impl<'a, M, Y, F> UnwindSafe for ModelBuilderData<'a, M, Y, F>

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> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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 more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

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

Source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Source§

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

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
Source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
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