pub struct SvmParameterBuilder { /* private fields */ }Expand description
Fluent builder for a validated SvmParameter.
Defaults are identical to SvmParameter::default. build
constructs the parameter and calls the existing SvmParameter::validate
method; data-dependent validation remains the responsibility of
crate::types::check_parameter.
Implementations§
Source§impl SvmParameterBuilder
impl SvmParameterBuilder
Sourcepub fn svm_type(self, svm_type: SvmType) -> Self
pub fn svm_type(self, svm_type: SvmType) -> Self
Set the SVM formulation type. Default: SvmType::CSvc.
Sourcepub fn kernel_type(self, kernel_type: KernelType) -> Self
pub fn kernel_type(self, kernel_type: KernelType) -> Self
Set the kernel function type. Default: KernelType::Rbf.
Sourcepub fn gamma(self, gamma: f64) -> Self
pub fn gamma(self, gamma: f64) -> Self
Set γ for RBF, polynomial, and sigmoid kernels. Default: 0.0
(interpreted during training as 1 / num_features).
Sourcepub fn coef0(self, coef0: f64) -> Self
pub fn coef0(self, coef0: f64) -> Self
Set the independent term in polynomial and sigmoid kernels. Default: 0.0.
Sourcepub fn p(self, p: f64) -> Self
pub fn p(self, p: f64) -> Self
Set ε in the ε-insensitive loss function for ε-SVR. Default: 0.1.
Sourcepub fn cache_size(self, cache_size: f64) -> Self
pub fn cache_size(self, cache_size: f64) -> Self
Set cache memory size in MB. Default: 100.0.
Sourcepub fn shrinking(self, shrinking: bool) -> Self
pub fn shrinking(self, shrinking: bool) -> Self
Enable or disable the shrinking heuristic. Default: true.
Sourcepub fn probability(self, probability: bool) -> Self
pub fn probability(self, probability: bool) -> Self
Enable or disable probability-estimate training. Default: false.
Sourcepub fn weight(self, label: i32, weight: f64) -> Self
pub fn weight(self, label: i32, weight: f64) -> Self
Append one per-class weight override (class_label, weight). Default: empty.
Sourcepub fn weights(self, weights: Vec<(i32, f64)>) -> Self
pub fn weights(self, weights: Vec<(i32, f64)>) -> Self
Replace all per-class weight overrides. Default: empty.
Sourcepub fn build(self) -> Result<SvmParameter, SvmError>
pub fn build(self) -> Result<SvmParameter, SvmError>
Construct and validate an SvmParameter.
This calls the existing SvmParameter::validate method and does not
duplicate validation rules. Data-dependent checks stay in
crate::types::check_parameter.
Trait Implementations§
Source§impl Clone for SvmParameterBuilder
impl Clone for SvmParameterBuilder
Source§fn clone(&self) -> SvmParameterBuilder
fn clone(&self) -> SvmParameterBuilder
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SvmParameterBuilder
impl Debug for SvmParameterBuilder
Auto Trait Implementations§
impl Freeze for SvmParameterBuilder
impl RefUnwindSafe for SvmParameterBuilder
impl Send for SvmParameterBuilder
impl Sync for SvmParameterBuilder
impl Unpin for SvmParameterBuilder
impl UnsafeUnpin for SvmParameterBuilder
impl UnwindSafe for SvmParameterBuilder
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
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>
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>
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