Trait to create the design matrix of a matrix of features, i.e. a new column is inserted at the left of the matrix where all elements are equal to one. ``` # #[macro_use] extern crate rustml; use rustml::*; use rustml::regression::DesignMatrix; # fn main() { let m = mat![ 2.0, 3.0, 4.0; 5.0, 6.0, 7.0 ]; let d = m.design_matrix(); assert!( d.eq( &mat![ 1.0, 2.0, 3.0, 4.0; 1.0, 5.0, 6.0, 7.0 ] ) )
| 166 | /// # } |
| 167 | /// ``` |
| 168 | pub trait DesignMatrix<T> { |
| 169 | fn design_matrix(&self) -> Self; |
| 170 | } |
| 171 | |
| 172 | impl DesignMatrix<f64> for Matrix<f64> { |
| 173 | fn design_matrix(&self) -> Self { |
nothing calls this directly
no outgoing calls
no test coverage detected