pub struct ADMMSVM { /* private fields */ }Expand description
ADMM (Alternating Direction Method of Multipliers) SVM Solver
ADMM is a distributed optimization algorithm that decomposes the SVM problem into smaller subproblems that can be solved in parallel. It’s particularly effective for large-scale and distributed SVM training.
The algorithm solves the consensus problem: minimize f(x) + g(z) subject to Ax + Bz = c
For SVM, this becomes: minimize (1/2)||w||² + C∑ξᵢ subject to yᵢ(wᵀφ(xᵢ) + b) ≥ 1 - ξᵢ, ξᵢ ≥ 0
Reference: Boyd, S. et al. (2011). Distributed optimization and statistical learning via the alternating direction method of multipliers.
Implementations§
Source§impl ADMMSVM
impl ADMMSVM
Sourcepub fn new(config: AdvancedOptimizationConfig) -> Self
pub fn new(config: AdvancedOptimizationConfig) -> Self
Create a new ADMM SVM solver
Sourcepub fn fit(
&mut self,
x: &Array2<f64>,
y: &Array1<f64>,
) -> Result<OptimizationResult>
pub fn fit( &mut self, x: &Array2<f64>, y: &Array1<f64>, ) -> Result<OptimizationResult>
Fit the SVM using ADMM optimization
Sourcepub fn predict(
&self,
x: &Array2<f64>,
result: &OptimizationResult,
) -> Result<Array1<f64>>
pub fn predict( &self, x: &Array2<f64>, result: &OptimizationResult, ) -> Result<Array1<f64>>
Predict using the fitted model
Sourcepub fn decision_function(
&self,
x: &Array2<f64>,
result: &OptimizationResult,
) -> Result<Array1<f64>>
pub fn decision_function( &self, x: &Array2<f64>, result: &OptimizationResult, ) -> Result<Array1<f64>>
Calculate decision function values
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ADMMSVM
impl RefUnwindSafe for ADMMSVM
impl Send for ADMMSVM
impl Sync for ADMMSVM
impl Unpin for ADMMSVM
impl UnsafeUnpin for ADMMSVM
impl UnwindSafe for ADMMSVM
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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