pub struct SVM {
pub loss_function: LossFunctionType,
pub activation_function: ActivationFunctionType,
pub kernel_function: KernelFunctionType,
pub intercept: f64,
pub coefficients: Vec<f64>,
}Expand description
A struct that defines a support vector machine.
§Example
let model = Model::SVM::new();
model.fit(&x, &y, num_epochs, learning_rate);
let y_pred = model.predict(&x);
Fields§
§loss_function: LossFunctionType§activation_function: ActivationFunctionType§kernel_function: KernelFunctionType§intercept: f64§coefficients: Vec<f64>Implementations§
Trait Implementations§
Source§impl SupervisedModeller for SVM
impl SupervisedModeller for SVM
Source§fn fit(
&mut self,
x: &DataFrame,
y: &Series,
num_epochs: u32,
learning_rate: f64,
) -> Result<(), PolarsError>
fn fit( &mut self, x: &DataFrame, y: &Series, num_epochs: u32, learning_rate: f64, ) -> Result<(), PolarsError>
Fit the model to the data.
§Example
let model = SVM::new();
model.fit(&x, &y, num_epochs, learning_rate);Auto Trait Implementations§
impl Freeze for SVM
impl RefUnwindSafe for SVM
impl Send for SVM
impl Sync for SVM
impl Unpin for SVM
impl UnwindSafe for SVM
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