Struct linregress::RegressionParameters [−][src]
A parameter of a fitted RegressionModel
given for the intercept and each regressor.
The values and names of the regressors are given in the same order.
You can obtain name value pairs using pairs
.
Fields
intercept_value: f64
regressor_names: Vec<String>
regressor_values: Vec<f64>
Implementations
impl RegressionParameters
[src]
pub fn pairs(self) -> Vec<(String, f64)>
[src]
Returns the parameters as a Vec of tuples of the form (name: String, value: f64)
.
Usage
use linregress::{FormulaRegressionBuilder, RegressionDataBuilder}; let y = vec![1.,2. ,3. , 4.]; let x1 = vec![4., 3., 2., 1.]; let x2 = vec![1., 2., 3., 4.]; let data = vec![("Y", y), ("X1", x1), ("X2", x2)]; let data = RegressionDataBuilder::new().build_from(data)?; let model = FormulaRegressionBuilder::new().data(&data).formula("Y ~ X1 + X2").fit()?; let pairs = model.parameters.pairs(); assert_eq!(pairs[0], ("X1".to_string(), -0.0370370370370372)); assert_eq!(pairs[1], ("X2".to_string(), 0.9629629629629629));
Trait Implementations
impl Clone for RegressionParameters
[src]
fn clone(&self) -> RegressionParameters
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for RegressionParameters
[src]
Auto Trait Implementations
impl RefUnwindSafe for RegressionParameters
impl Send for RegressionParameters
impl Sync for RegressionParameters
impl Unpin for RegressionParameters
impl UnwindSafe for RegressionParameters
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
[src]
type Output = T
Should always be Self
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
[src]
SS: SubsetOf<SP>,
pub fn to_subset(&self) -> Option<SS>
[src]
pub fn is_in_subset(&self) -> bool
[src]
pub unsafe fn to_subset_unchecked(&self) -> SS
[src]
pub fn from_subset(element: &SS) -> SP
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,