Struct vikos::model::Linear
[−]
[src]
pub struct Linear<V: Vector> { pub m: V, pub c: V::Scalar, }
Models the target as y = m * x + c
Fields
m: V
Slope
c: V::Scalar
Offset
Trait Implementations
impl<V: Debug + Vector> Debug for Linear<V> where V::Scalar: Debug
[src]
impl<V: Clone + Vector> Clone for Linear<V> where V::Scalar: Clone
[src]
fn clone(&self) -> Linear<V>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl<V: Default + Vector> Default for Linear<V> where V::Scalar: Default
[src]
impl<V: Decodable + Vector> Decodable for Linear<V> where V::Scalar: Decodable
[src]
impl<V: Encodable + Vector> Encodable for Linear<V> where V::Scalar: Encodable
[src]
impl<V> Model for Linear<V> where V: Vector<Scalar=f64>
[src]
type Input = V
Input features
fn predict(&self, input: &V) -> V::Scalar
Predicts a target for the inputs based on the internal coefficents
fn num_coefficents(&self) -> usize
The number of internal coefficents this model depends on
fn gradient(&self, coefficent: usize, input: &V) -> V::Scalar
Value predict derived by the n-th coefficent
at input
fn coefficent(&mut self, coefficent: usize) -> &mut V::Scalar
Mutable reference to the n-th coefficent