pub struct LossFactory;Expand description
Factory for creating common loss functions
Implementations§
Source§impl LossFactory
impl LossFactory
Sourcepub fn squared() -> Box<dyn LossFunction>
pub fn squared() -> Box<dyn LossFunction>
Create a squared loss (MSE)
Sourcepub fn absolute() -> Box<dyn LossFunction>
pub fn absolute() -> Box<dyn LossFunction>
Create an absolute loss (MAE)
Sourcepub fn huber(delta: Float) -> Box<dyn LossFunction>
pub fn huber(delta: Float) -> Box<dyn LossFunction>
Create a Huber loss with specified delta
Sourcepub fn logistic() -> Box<dyn LossFunction>
pub fn logistic() -> Box<dyn LossFunction>
Create a logistic loss for binary classification
Sourcepub fn hinge() -> Box<dyn LossFunction>
pub fn hinge() -> Box<dyn LossFunction>
Create a hinge loss for SVM
Sourcepub fn squared_hinge() -> Box<dyn LossFunction>
pub fn squared_hinge() -> Box<dyn LossFunction>
Create a squared hinge loss
Sourcepub fn epsilon_insensitive(epsilon: Float) -> Result<Box<dyn LossFunction>>
pub fn epsilon_insensitive(epsilon: Float) -> Result<Box<dyn LossFunction>>
Create an epsilon-insensitive loss for SVR
Auto Trait Implementations§
impl Freeze for LossFactory
impl RefUnwindSafe for LossFactory
impl Send for LossFactory
impl Sync for LossFactory
impl Unpin for LossFactory
impl UnwindSafe for LossFactory
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> 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