MCPcopy Create free account
hub / github.com/daniel-e/rustml / DesignMatrix

Interface DesignMatrix

src/regression.rs:168–170  ·  view source on GitHub ↗

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 ] ) )

Source from the content-addressed store, hash-verified

166/// # }
167/// ```
168pub trait DesignMatrix<T> {
169 fn design_matrix(&self) -> Self;
170}
171
172impl DesignMatrix<f64> for Matrix<f64> {
173 fn design_matrix(&self) -> Self {

Callers

nothing calls this directly

Implementers 1

regression.rssrc/regression.rs

Calls

no outgoing calls

Tested by

no test coverage detected