Struct linregress::RegressionParameters[][src]

pub struct RegressionParameters {
    pub intercept_value: f64,
    pub regressor_names: Vec<String>,
    pub regressor_values: Vec<f64>,
}

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: f64regressor_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]

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]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

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]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.