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: f64
regressor_names: Vec<String>
regressor_values: Vec<f64>
Implementations
impl RegressionParameters
[src]
impl RegressionParameters
[src]pub fn pairs(&self) -> Vec<(&str, f64)>
[src]
Returns the parameters as a Vec of tuples of the form (name: &str, 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", -0.0370370370370372)); assert_eq!(pairs[1], ("X2", 0.9629629629629629));
Trait Implementations
impl Clone for RegressionParameters
[src]
impl Clone for RegressionParameters
[src]fn clone(&self) -> RegressionParameters
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[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<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
[src]
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
[src]