Trait PrimalProblem

Source
pub trait PrimalProblem: ProblemBase {
    // Required methods
    fn loss(&self, i: usize, ti: f64) -> f64;
    fn d_loss(&self, i: usize, ti: f64) -> f64;
    fn d2_loss(&self, i: usize, ti: f64) -> f64;

    // Provided method
    fn objective(&self, status: &Status) -> f64 { ... }
}
Expand description

Base for the definition of a primal training problem

Required Methods§

Source

fn loss(&self, i: usize, ti: f64) -> f64

Computes the ith loss function.

Source

fn d_loss(&self, i: usize, ti: f64) -> f64

Computes the first derivative of the ith loss function.

Source

fn d2_loss(&self, i: usize, ti: f64) -> f64

Computes the second derivative of the ith loss function.

Provided Methods§

Source

fn objective(&self, status: &Status) -> f64

Computes the primal and dual objective function values.

Implementors§