pub struct LinearSVR<F> {
pub c: F,
pub epsilon: F,
pub max_iter: usize,
pub tol: F,
pub loss: LinearSVRLoss,
}Expand description
Linear Support Vector Regressor (primal formulation).
Solves the L2-regularized epsilon-insensitive or squared epsilon-insensitive loss via coordinate descent in the primal.
§Type Parameters
F: The floating-point type (f32orf64).
Fields§
§c: FInverse regularization strength.
epsilon: FWidth of the epsilon-insensitive tube.
max_iter: usizeMaximum number of coordinate descent iterations.
tol: FConvergence tolerance on the change in weight vector.
loss: LinearSVRLossLoss function to use.
Implementations§
Source§impl<F: Float> LinearSVR<F>
impl<F: Float> LinearSVR<F>
Sourcepub fn new() -> Self
pub fn new() -> Self
Create a new LinearSVR with default settings.
Defaults: C = 1.0, epsilon = 0.1, max_iter = 1000,
tol = 1e-4, loss = EpsilonInsensitive.
Sourcepub fn with_epsilon(self, epsilon: F) -> Self
pub fn with_epsilon(self, epsilon: F) -> Self
Set the epsilon tube width.
Sourcepub fn with_max_iter(self, max_iter: usize) -> Self
pub fn with_max_iter(self, max_iter: usize) -> Self
Set the maximum number of iterations.
Sourcepub fn with_loss(self, loss: LinearSVRLoss) -> Self
pub fn with_loss(self, loss: LinearSVRLoss) -> Self
Set the loss function.
Trait Implementations§
Source§impl<F: Float + Send + Sync + ScalarOperand + 'static> Fit<ArrayBase<OwnedRepr<F>, Dim<[usize; 2]>>, ArrayBase<OwnedRepr<F>, Dim<[usize; 1]>>> for LinearSVR<F>
impl<F: Float + Send + Sync + ScalarOperand + 'static> Fit<ArrayBase<OwnedRepr<F>, Dim<[usize; 2]>>, ArrayBase<OwnedRepr<F>, Dim<[usize; 1]>>> for LinearSVR<F>
Source§fn fit(
&self,
x: &Array2<F>,
y: &Array1<F>,
) -> Result<FittedLinearSVR<F>, FerroError>
fn fit( &self, x: &Array2<F>, y: &Array1<F>, ) -> Result<FittedLinearSVR<F>, FerroError>
Fit the linear SVR model using coordinate descent.
§Errors
FerroError::ShapeMismatch— sample count mismatch.FerroError::InvalidParameter—Cnot positive or epsilon negative.FerroError::InsufficientSamples— no samples provided.
Source§type Fitted = FittedLinearSVR<F>
type Fitted = FittedLinearSVR<F>
The fitted model type returned by
fit.Source§type Error = FerroError
type Error = FerroError
The error type returned by
fit.Source§impl<F> PipelineEstimator<F> for LinearSVR<F>
impl<F> PipelineEstimator<F> for LinearSVR<F>
Source§fn fit_pipeline(
&self,
x: &Array2<F>,
y: &Array1<F>,
) -> Result<Box<dyn FittedPipelineEstimator<F>>, FerroError>
fn fit_pipeline( &self, x: &Array2<F>, y: &Array1<F>, ) -> Result<Box<dyn FittedPipelineEstimator<F>>, FerroError>
Fit this estimator on the given data. Read more
Auto Trait Implementations§
impl<F> Freeze for LinearSVR<F>where
F: Freeze,
impl<F> RefUnwindSafe for LinearSVR<F>where
F: RefUnwindSafe,
impl<F> Send for LinearSVR<F>where
F: Send,
impl<F> Sync for LinearSVR<F>where
F: Sync,
impl<F> Unpin for LinearSVR<F>where
F: Unpin,
impl<F> UnsafeUnpin for LinearSVR<F>where
F: UnsafeUnpin,
impl<F> UnwindSafe for LinearSVR<F>where
F: UnwindSafe,
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
Mutably borrows from an owned value. Read more
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,
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>
Converts
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>
Converts
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