pub use crate::utils::kernels::Kernel;
#[derive(serde::Serialize, serde::Deserialize)]
pub struct SVRParameters {
pub(crate) eps: f32,
pub(crate) c: f32,
pub(crate) tol: f32,
pub(crate) kernel: Kernel,
}
impl SVRParameters {
#[must_use]
pub const fn with_eps(mut self, eps: f32) -> Self {
self.eps = eps;
self
}
#[must_use]
pub const fn with_c(mut self, c: f32) -> Self {
self.c = c;
self
}
#[must_use]
pub const fn with_tol(mut self, tol: f32) -> Self {
self.tol = tol;
self
}
#[must_use]
pub const fn with_kernel(mut self, kernel: Kernel) -> Self {
self.kernel = kernel;
self
}
}
impl Default for SVRParameters {
fn default() -> Self {
Self {
eps: 0.1,
c: 1.0,
tol: 1e-3,
kernel: Kernel::Linear,
}
}
}