pub struct FittedLinearRegression<F> { /* private fields */ }Expand description
Fitted ordinary least squares linear regression model.
Stores the learned coefficients and intercept. Implements Predict
to generate predictions and HasCoefficients for introspection.
Implementations§
Source§impl<F: Float> FittedLinearRegression<F>
impl<F: Float> FittedLinearRegression<F>
Sourcepub fn rank(&self) -> usize
pub fn rank(&self) -> usize
Effective rank of the design matrix (sklearn rank_, _base.py:505).
The rank of the matrix actually solved by linalg.lstsq — the
centered X when fit_intercept is true, the raw X otherwise
(_base.py:687).
Sourcepub fn singular_values(&self) -> &Array1<F>
pub fn singular_values(&self) -> &Array1<F>
Singular values of the design matrix (sklearn singular_,
_base.py:508).
The singular values of the matrix actually solved by linalg.lstsq
— the centered X when fit_intercept is true, the raw X
otherwise (_base.py:687).
Trait Implementations§
Source§impl<F: Clone> Clone for FittedLinearRegression<F>
impl<F: Clone> Clone for FittedLinearRegression<F>
Source§fn clone(&self) -> FittedLinearRegression<F>
fn clone(&self) -> FittedLinearRegression<F>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<F: Debug> Debug for FittedLinearRegression<F>
impl<F: Debug> Debug for FittedLinearRegression<F>
Source§impl<F> FittedPipelineEstimator<F> for FittedLinearRegression<F>
impl<F> FittedPipelineEstimator<F> for FittedLinearRegression<F>
Source§fn predict_pipeline(&self, x: &Array2<F>) -> Result<Array1<F>, FerroError>
fn predict_pipeline(&self, x: &Array2<F>) -> Result<Array1<F>, FerroError>
Source§fn predict_proba_pipeline(
&self,
x: &ArrayBase<OwnedRepr<F>, Dim<[usize; 2]>>,
) -> Result<ArrayBase<OwnedRepr<F>, Dim<[usize; 2]>>, FerroError>
fn predict_proba_pipeline( &self, x: &ArrayBase<OwnedRepr<F>, Dim<[usize; 2]>>, ) -> Result<ArrayBase<OwnedRepr<F>, Dim<[usize; 2]>>, FerroError>
(n_samples, n_classes). Read moreSource§fn decision_function_pipeline(
&self,
x: &ArrayBase<OwnedRepr<F>, Dim<[usize; 2]>>,
) -> Result<ArrayBase<OwnedRepr<F>, Dim<[usize; 2]>>, FerroError>
fn decision_function_pipeline( &self, x: &ArrayBase<OwnedRepr<F>, Dim<[usize; 2]>>, ) -> Result<ArrayBase<OwnedRepr<F>, Dim<[usize; 2]>>, FerroError>
(n_samples, n_classes) (or (n_samples,) for binary, per the
estimator’s contract). Read moreSource§impl<F: Float + Send + Sync + ScalarOperand + 'static> HasCoefficients<F> for FittedLinearRegression<F>
impl<F: Float + Send + Sync + ScalarOperand + 'static> HasCoefficients<F> for FittedLinearRegression<F>
Source§impl<F: Float + Send + Sync + ScalarOperand + 'static> Predict<ArrayBase<OwnedRepr<F>, Dim<[usize; 2]>>> for FittedLinearRegression<F>
impl<F: Float + Send + Sync + ScalarOperand + 'static> Predict<ArrayBase<OwnedRepr<F>, Dim<[usize; 2]>>> for FittedLinearRegression<F>
Source§fn predict(&self, x: &Array2<F>) -> Result<Array1<F>, FerroError>
fn predict(&self, x: &Array2<F>) -> Result<Array1<F>, FerroError>
Predict target values for the given feature matrix.
Computes X @ coefficients + intercept.
§Errors
Returns FerroError::ShapeMismatch if the number of features
does not match the fitted model.
Source§type Output = ArrayBase<OwnedRepr<F>, Dim<[usize; 1]>>
type Output = ArrayBase<OwnedRepr<F>, Dim<[usize; 1]>>
ndarray::Array1<F> or ndarray::Array1<usize>).Source§type Error = FerroError
type Error = FerroError
predict.Auto Trait Implementations§
impl<F> Freeze for FittedLinearRegression<F>where
F: Freeze,
impl<F> RefUnwindSafe for FittedLinearRegression<F>where
F: RefUnwindSafe,
impl<F> Send for FittedLinearRegression<F>where
F: Send,
impl<F> Sync for FittedLinearRegression<F>where
F: Sync,
impl<F> Unpin for FittedLinearRegression<F>where
F: Unpin,
impl<F> UnsafeUnpin for FittedLinearRegression<F>where
F: UnsafeUnpin,
impl<F> UnwindSafe for FittedLinearRegression<F>where
F: UnwindSafe + RefUnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> DistributionExt for Twhere
T: ?Sized,
impl<T> DistributionExt for Twhere
T: ?Sized,
impl<T, U> Imply<T> for U
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more