pub struct GLMResults {Show 22 fields
pub coefficients: ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>>,
pub std_errors: ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>>,
pub z_values: ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>>,
pub p_values: ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>>,
pub fitted_values: ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>>,
pub residuals: ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>>,
pub pearson_residuals: ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>>,
pub hat_matrix_diag: ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>>,
pub scale: f64,
pub deviance: f64,
pub null_deviance: f64,
pub df_residual: usize,
pub df_null: usize,
pub aic: f64,
pub bic: f64,
pub converged: bool,
pub iterations: usize,
pub family: Family,
pub link: Link,
pub intercept: bool,
pub n_obs: usize,
pub n_params: usize,
}Expand description
Results from fitting a Generalized Linear Model
Fields§
§coefficients: ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>>Estimated coefficients
std_errors: ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>>Standard errors of coefficients
z_values: ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>>z-statistics for coefficients (Wald test)
p_values: ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>>p-values for coefficients
fitted_values: ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>>Fitted values (on response scale)
residuals: ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>>Residuals (response scale)
pearson_residuals: ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>>Pearson residuals
hat_matrix_diag: ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>>Diagonal of hat matrix (leverage)
scale: f64Scale/dispersion parameter
deviance: f64Residual deviance
null_deviance: f64Null deviance
df_residual: usizeResidual degrees of freedom
df_null: usizeNull degrees of freedom
aic: f64Akaike Information Criterion
bic: f64Bayesian Information Criterion
converged: boolWhether IRLS converged
iterations: usizeNumber of IRLS iterations
family: FamilyDistribution family
link: LinkLink function
intercept: boolWhether intercept was included
n_obs: usizeNumber of observations
n_params: usizeNumber of parameters
Implementations§
Source§impl GLMResults
impl GLMResults
Sourcepub fn summary(&self, feature_names: &[String]) -> String
pub fn summary(&self, feature_names: &[String]) -> String
Create a summary string similar to R’s summary.glm()
Sourcepub fn coefficients_with_names(
&self,
feature_names: &[String],
) -> Vec<(String, f64)>
pub fn coefficients_with_names( &self, feature_names: &[String], ) -> Vec<(String, f64)>
Get the coefficients as a vector with names
Sourcepub fn confidence_intervals(
&self,
alpha: f64,
feature_names: &[String],
) -> Vec<(String, f64, f64)>
pub fn confidence_intervals( &self, alpha: f64, feature_names: &[String], ) -> Vec<(String, f64, f64)>
Get confidence intervals for coefficients
Sourcepub fn deviance_residuals(
&self,
y: &ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>>,
) -> ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>>
pub fn deviance_residuals( &self, y: &ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>>, ) -> ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>>
Compute deviance residuals
Sourcepub fn cooks_distance(&self) -> ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>>
pub fn cooks_distance(&self) -> ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>>
Compute Cook’s distances for influence diagnostics
Sourcepub fn standardized_pearson_residuals(
&self,
) -> ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>>
pub fn standardized_pearson_residuals( &self, ) -> ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>>
Compute standardized Pearson residuals
Sourcepub fn overdispersion_test(&self) -> (f64, f64)
pub fn overdispersion_test(&self) -> (f64, f64)
Test for overdispersion (for Poisson and Binomial)
Sourcepub fn log_likelihood(
&self,
y: &ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>>,
) -> f64
pub fn log_likelihood( &self, y: &ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>>, ) -> f64
Compute log-likelihood (up to a constant)
Sourcepub fn pseudo_r_squared(&self) -> (f64, f64, f64)
pub fn pseudo_r_squared(&self) -> (f64, f64, f64)
Compute pseudo R-squared measures
Sourcepub fn likelihood_ratio_test(&self) -> (f64, f64)
pub fn likelihood_ratio_test(&self) -> (f64, f64)
Perform likelihood ratio test against null model
Sourcepub fn model_info(&self) -> String
pub fn model_info(&self) -> String
Get model information as a string
Trait Implementations§
Source§impl Clone for GLMResults
impl Clone for GLMResults
Source§fn clone(&self) -> GLMResults
fn clone(&self) -> GLMResults
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for GLMResults
impl Debug for GLMResults
Source§impl<'de> Deserialize<'de> for GLMResults
impl<'de> Deserialize<'de> for GLMResults
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<GLMResults, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<GLMResults, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl Serialize for GLMResults
impl Serialize for GLMResults
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Auto Trait Implementations§
impl Freeze for GLMResults
impl RefUnwindSafe for GLMResults
impl Send for GLMResults
impl Sync for GLMResults
impl Unpin for GLMResults
impl UnsafeUnpin for GLMResults
impl UnwindSafe for GLMResults
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> DistributionExt for Twhere
T: ?Sized,
impl<T> DistributionExt for Twhere
T: ?Sized,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.