pub struct FittedMultiOutputLinearRegression<F> { /* private fields */ }Expand description
Fitted multi-output ordinary least squares linear regression model.
The 2-D-target companion to FittedLinearRegression: produced by
Fit<Array2<F>, Array2<F>> when fitting a 2-D Y of shape
(n_samples, n_targets). Mirrors scikit-learn’s multi-output
LinearRegression (MultiOutputMixin, _base.py:465), whose coef_ is a
2-D array of shape (n_targets, n_features) and intercept_ an array of
shape (n_targets,) (_base.py:499/:511). Stored in sklearn’s coef_
orientation (target rows), so coefficients() maps directly onto
sklearn.coef_.
Implementations§
Source§impl<F: Float> FittedMultiOutputLinearRegression<F>
impl<F: Float> FittedMultiOutputLinearRegression<F>
Sourcepub fn coefficients(&self) -> &Array2<F>
pub fn coefficients(&self) -> &Array2<F>
Learned coefficient matrix, shape (n_targets, n_features) (sklearn
coef_, _base.py:499).
Sourcepub fn intercepts(&self) -> &Array1<F>
pub fn intercepts(&self) -> &Array1<F>
Learned per-target intercepts, shape (n_targets,) (sklearn
intercept_, _base.py:511).
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).
Trait Implementations§
Source§impl<F: Clone> Clone for FittedMultiOutputLinearRegression<F>
impl<F: Clone> Clone for FittedMultiOutputLinearRegression<F>
Source§fn clone(&self) -> FittedMultiOutputLinearRegression<F>
fn clone(&self) -> FittedMultiOutputLinearRegression<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 FittedMultiOutputLinearRegression<F>
impl<F: Debug> Debug for FittedMultiOutputLinearRegression<F>
Source§impl<F: Float + Send + Sync + ScalarOperand + 'static> Predict<ArrayBase<OwnedRepr<F>, Dim<[usize; 2]>>> for FittedMultiOutputLinearRegression<F>
impl<F: Float + Send + Sync + ScalarOperand + 'static> Predict<ArrayBase<OwnedRepr<F>, Dim<[usize; 2]>>> for FittedMultiOutputLinearRegression<F>
Source§fn predict(&self, x: &Array2<F>) -> Result<Array2<F>, FerroError>
fn predict(&self, x: &Array2<F>) -> Result<Array2<F>, FerroError>
Predict 2-D target values for the given feature matrix.
Computes X @ coefficients.T + intercepts (broadcasting the per-target
intercepts over rows), shape (n_samples, n_targets), mirroring sklearn’s
2-D _decision_function arm X @ coef_.T + self.intercept_
(_base.py:290).
§Errors
Returns FerroError::ShapeMismatch if the number of features does not
match the fitted model.
Source§type Output = ArrayBase<OwnedRepr<F>, Dim<[usize; 2]>>
type Output = ArrayBase<OwnedRepr<F>, Dim<[usize; 2]>>
ndarray::Array1<F> or ndarray::Array1<usize>).Source§type Error = FerroError
type Error = FerroError
predict.Auto Trait Implementations§
impl<F> Freeze for FittedMultiOutputLinearRegression<F>
impl<F> RefUnwindSafe for FittedMultiOutputLinearRegression<F>where
F: RefUnwindSafe,
impl<F> Send for FittedMultiOutputLinearRegression<F>where
F: Send,
impl<F> Sync for FittedMultiOutputLinearRegression<F>where
F: Sync,
impl<F> Unpin for FittedMultiOutputLinearRegression<F>
impl<F> UnsafeUnpin for FittedMultiOutputLinearRegression<F>
impl<F> UnwindSafe for FittedMultiOutputLinearRegression<F>where
F: 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