[][src]Struct smartcore::linear::linear_regression::LinearRegression

pub struct LinearRegression<T: RealNumber, M: Matrix<T>> { /* fields omitted */ }

Linear Regression

Implementations

impl<T: RealNumber, M: Matrix<T>> LinearRegression<T, M>[src]

pub fn fit(
    x: &M,
    y: &M::RowVector,
    parameters: LinearRegressionParameters
) -> Result<LinearRegression<T, M>, Failed>
[src]

Fits Linear Regression to your data.

  • x - NxM matrix with N observations and M features in each observation.
  • y - target values
  • parameters - other parameters, use Default::default() to set parameters to default values.

pub fn predict(&self, x: &M) -> Result<M::RowVector, Failed>[src]

Predict target values from x

  • x - KxM data where K is number of observations and M is number of features.

pub fn coefficients(&self) -> &M[src]

Get estimates regression coefficients

pub fn intercept(&self) -> T[src]

Get estimate of intercept

Trait Implementations

impl<T: Debug + RealNumber, M: Debug + Matrix<T>> Debug for LinearRegression<T, M>[src]

impl<'de, T: RealNumber, M: Matrix<T>> Deserialize<'de> for LinearRegression<T, M> where
    T: Deserialize<'de>,
    M: Deserialize<'de>, 
[src]

impl<T: RealNumber, M: Matrix<T>> PartialEq<LinearRegression<T, M>> for LinearRegression<T, M>[src]

impl<T: RealNumber, M: Matrix<T>> Predictor<M, <M as BaseMatrix<T>>::RowVector> for LinearRegression<T, M>[src]

impl<T: RealNumber, M: Matrix<T>> Serialize for LinearRegression<T, M> where
    T: Serialize,
    M: Serialize
[src]

impl<T: RealNumber, M: Matrix<T>> SupervisedEstimator<M, <M as BaseMatrix<T>>::RowVector, LinearRegressionParameters> for LinearRegression<T, M>[src]

Auto Trait Implementations

impl<T, M> RefUnwindSafe for LinearRegression<T, M> where
    M: RefUnwindSafe,
    T: RefUnwindSafe
[src]

impl<T, M> Send for LinearRegression<T, M> where
    M: Send,
    T: Send
[src]

impl<T, M> Sync for LinearRegression<T, M> where
    M: Sync,
    T: Sync
[src]

impl<T, M> Unpin for LinearRegression<T, M> where
    M: Unpin,
    T: Unpin
[src]

impl<T, M> UnwindSafe for LinearRegression<T, M> where
    M: UnwindSafe,
    T: UnwindSafe
[src]

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> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

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

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

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.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,