pub struct KernelOptimizer {
pub max_iter: usize,
pub learning_rate: f64,
pub tol: f64,
pub use_line_search: bool,
pub n_restarts: usize,
pub bounds: Option<Vec<(f64, f64)>>,
pub random_state: Option<u64>,
}Expand description
Kernel parameter optimizer
Fields§
§max_iter: usizeMaximum number of optimization iterations
learning_rate: f64Learning rate for gradient descent
tol: f64Tolerance for convergence
use_line_search: boolWhether to use line search
n_restarts: usizeNumber of random restarts
bounds: Option<Vec<(f64, f64)>>Bounds for parameters (optional)
random_state: Option<u64>Random state for reproducible results
Implementations§
Source§impl KernelOptimizer
impl KernelOptimizer
Sourcepub fn learning_rate(self, learning_rate: f64) -> Self
pub fn learning_rate(self, learning_rate: f64) -> Self
Set learning rate
Sourcepub fn use_line_search(self, use_line_search: bool) -> Self
pub fn use_line_search(self, use_line_search: bool) -> Self
Set whether to use line search
Sourcepub fn n_restarts(self, n_restarts: usize) -> Self
pub fn n_restarts(self, n_restarts: usize) -> Self
Set number of random restarts
Sourcepub fn random_state(self, random_state: Option<u64>) -> Self
pub fn random_state(self, random_state: Option<u64>) -> Self
Set random state
Sourcepub fn optimize_kernel(
&self,
kernel: &mut Box<dyn Kernel>,
X: ArrayView2<'_, f64>,
y: ArrayView1<'_, f64>,
) -> SklResult<OptimizationResult>
pub fn optimize_kernel( &self, kernel: &mut Box<dyn Kernel>, X: ArrayView2<'_, f64>, y: ArrayView1<'_, f64>, ) -> SklResult<OptimizationResult>
Optimize kernel parameters
Trait Implementations§
Source§impl Clone for KernelOptimizer
impl Clone for KernelOptimizer
Source§fn clone(&self) -> KernelOptimizer
fn clone(&self) -> KernelOptimizer
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 KernelOptimizer
impl Debug for KernelOptimizer
Auto Trait Implementations§
impl Freeze for KernelOptimizer
impl RefUnwindSafe for KernelOptimizer
impl Send for KernelOptimizer
impl Sync for KernelOptimizer
impl Unpin for KernelOptimizer
impl UnwindSafe for KernelOptimizer
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