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§
Sourcefn evaluate(
&self,
x: &Array2<f64>,
y_classif: Option<&Array1<i32>>,
y_regression: Option<&Array1<f64>>,
feature_mask: &[bool],
) -> SklResult<f64>
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)
Sourcefn clone_box(&self) -> Box<dyn ObjectiveFunction>
fn clone_box(&self) -> Box<dyn ObjectiveFunction>
fn
Provided Methods§
Sourcefn is_minimization(&self) -> bool
fn is_minimization(&self) -> bool
Whether this is a minimization objective (will be converted to maximization)
Trait Implementations§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".