pub struct LogisticLoss;Expand description
Logistic (binary cross-entropy) loss.
Targets must be 0.0 or 1.0. Predictions are raw logits (unbounded).
The sigmoid transform maps logits to probabilities in [0, 1].
Trait Implementations§
Source§impl Clone for LogisticLoss
impl Clone for LogisticLoss
Source§fn clone(&self) -> LogisticLoss
fn clone(&self) -> LogisticLoss
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for LogisticLoss
impl Debug for LogisticLoss
Source§impl Loss for LogisticLoss
impl Loss for LogisticLoss
Source§fn n_outputs(&self) -> usize
fn n_outputs(&self) -> usize
Number of output dimensions (1 for regression/binary, C for multiclass).
Source§fn gradient(&self, target: f64, prediction: f64) -> f64
fn gradient(&self, target: f64, prediction: f64) -> f64
First derivative of the loss with respect to prediction: dL/df.
Source§fn hessian(&self, _target: f64, prediction: f64) -> f64
fn hessian(&self, _target: f64, prediction: f64) -> f64
Second derivative of the loss with respect to prediction: d^2L/df^2.
Source§fn predict_transform(&self, raw: f64) -> f64
fn predict_transform(&self, raw: f64) -> f64
Transform raw model output to final prediction (identity for regression, sigmoid for binary).
Source§fn initial_prediction(&self, targets: &[f64]) -> f64
fn initial_prediction(&self, targets: &[f64]) -> f64
Initial constant prediction (before any trees). Typically the optimal constant
that minimizes sum of losses over the given targets.
impl Copy for LogisticLoss
Auto Trait Implementations§
impl Freeze for LogisticLoss
impl RefUnwindSafe for LogisticLoss
impl Send for LogisticLoss
impl Sync for LogisticLoss
impl Unpin for LogisticLoss
impl UnsafeUnpin for LogisticLoss
impl UnwindSafe for LogisticLoss
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