Skip to main content

ObjectiveFunction

Trait ObjectiveFunction 

Source
pub trait ObjectiveFunction:
    Send
    + Sync
    + Debug {
    // Required methods
    fn evaluate(
        &self,
        x: &Array2<f64>,
        y_classif: Option<&Array1<i32>>,
        y_regression: Option<&Array1<f64>>,
        feature_mask: &[bool],
    ) -> SklResult<f64>;
    fn name(&self) -> &str;
    fn clone_box(&self) -> Box<dyn ObjectiveFunction>;

    // Provided method
    fn is_minimization(&self) -> bool { ... }
}
Expand description

Trait for objective functions in multi-objective optimization

Required Methods§

Source

fn evaluate( &self, x: &Array2<f64>, y_classif: Option<&Array1<i32>>, y_regression: Option<&Array1<f64>>, feature_mask: &[bool], ) -> SklResult<f64>

Evaluate the objective for a given feature subset Returns higher values for better solutions (maximization)

Source

fn name(&self) -> &str

Get the name of this objective

Source

fn clone_box(&self) -> Box<dyn ObjectiveFunction>

fn

Provided Methods§

Source

fn is_minimization(&self) -> bool

Whether this is a minimization objective (will be converted to maximization)

Trait Implementations§

Source§

impl Clone for Box<dyn ObjectiveFunction>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§