pub struct MultipleKernelLearning { /* private fields */ }Expand description
Multiple Kernel Learning approximation
Learns optimal weights for combining multiple kernel approximations to create a single, improved kernel approximation.
Implementations§
Source§impl MultipleKernelLearning
impl MultipleKernelLearning
Sourcepub fn new(base_kernels: Vec<BaseKernel>) -> Self
pub fn new(base_kernels: Vec<BaseKernel>) -> Self
Create a new multiple kernel learning instance
Sourcepub fn with_config(self, config: MultiKernelConfig) -> Self
pub fn with_config(self, config: MultiKernelConfig) -> Self
Set configuration
Sourcepub fn with_random_state(self, random_state: u64) -> Self
pub fn with_random_state(self, random_state: u64) -> Self
Set random state for reproducibility
Sourcepub fn fit(&mut self, x: &Array2<f64>, y: Option<&Array1<f64>>) -> Result<()>
pub fn fit(&mut self, x: &Array2<f64>, y: Option<&Array1<f64>>) -> Result<()>
Fit the multiple kernel learning model
Sourcepub fn transform(&self, x: &Array2<f64>) -> Result<Array2<f64>>
pub fn transform(&self, x: &Array2<f64>) -> Result<Array2<f64>>
Transform data using learned kernel combination
Sourcepub fn kernel_weights(&self) -> Option<&Array1<f64>>
pub fn kernel_weights(&self) -> Option<&Array1<f64>>
Get learned kernel weights
Sourcepub fn kernel_stats(&self) -> &HashMap<String, KernelStatistics>
pub fn kernel_stats(&self) -> &HashMap<String, KernelStatistics>
Get kernel statistics
Sourcepub fn important_kernels(
&self,
threshold: f64,
) -> Vec<(usize, &BaseKernel, f64)>
pub fn important_kernels( &self, threshold: f64, ) -> Vec<(usize, &BaseKernel, f64)>
Get most important kernels based on weights
Auto Trait Implementations§
impl Freeze for MultipleKernelLearning
impl RefUnwindSafe for MultipleKernelLearning
impl Send for MultipleKernelLearning
impl Sync for MultipleKernelLearning
impl Unpin for MultipleKernelLearning
impl UnwindSafe for MultipleKernelLearning
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> 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