pub struct FairLoss {
pub c: Option<f64>,
}Expand description
Fair Loss objective.
c * |y - yhat| - c^2 * ln(|y - yhat| / c + 1).
Fields§
§c: Option<f64>The threshold constant c.
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for FairLoss
impl<'de> Deserialize<'de> for FairLoss
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl ObjectiveFunction for FairLoss
impl ObjectiveFunction for FairLoss
Source§fn loss(
&self,
y: &[f64],
yhat: &[f64],
sample_weight: Option<&[f64]>,
_group: Option<&[u64]>,
) -> Vec<f32>
fn loss( &self, y: &[f64], yhat: &[f64], sample_weight: Option<&[f64]>, _group: Option<&[u64]>, ) -> Vec<f32>
Per-sample loss. Read more
Source§fn gradient(
&self,
y: &[f64],
yhat: &[f64],
sample_weight: Option<&[f64]>,
_group: Option<&[u64]>,
) -> (Vec<f32>, Option<Vec<f32>>)
fn gradient( &self, y: &[f64], yhat: &[f64], sample_weight: Option<&[f64]>, _group: Option<&[u64]>, ) -> (Vec<f32>, Option<Vec<f32>>)
Per-sample gradient and (optional) hessian. Read more
Source§fn default_metric(&self) -> Metric
fn default_metric(&self) -> Metric
Default evaluation metric for this objective. Read more
Source§fn requires_batch_evaluation(&self) -> bool
fn requires_batch_evaluation(&self) -> bool
Whether this objective requires batch evaluation (e.g. for Python custom objectives). Read more
Source§fn initial_value(
&self,
y: &[f64],
sample_weight: Option<&[f64]>,
_group: Option<&[u64]>,
) -> f64
fn initial_value( &self, y: &[f64], sample_weight: Option<&[f64]>, _group: Option<&[u64]>, ) -> f64
Initial prediction (base score) before any trees are added. Read more
Auto Trait Implementations§
impl Freeze for FairLoss
impl RefUnwindSafe for FairLoss
impl Send for FairLoss
impl Sync for FairLoss
impl Unpin for FairLoss
impl UnsafeUnpin for FairLoss
impl UnwindSafe for FairLoss
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> 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