build: fix compilation without default features (#218)
* build: fix compilation with optional features * Remove unused config from Cargo.toml * Fix cache keys Co-authored-by: Luis Moreno <morenol@users.noreply.github.com>
This commit is contained in:
+3
-1
@@ -52,6 +52,7 @@ impl<'a> Debug for dyn Kernel<'_> + 'a {
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "serde")]
|
||||
impl<'a> Serialize for dyn Kernel<'_> + 'a {
|
||||
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
|
||||
where
|
||||
@@ -64,7 +65,8 @@ impl<'a> Serialize for dyn Kernel<'_> + 'a {
|
||||
}
|
||||
|
||||
/// Pre-defined kernel functions
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct Kernels {}
|
||||
|
||||
impl<'a> Kernels {
|
||||
|
||||
+1
-1
@@ -133,7 +133,7 @@ pub struct SVCParameters<
|
||||
pub struct SVC<'a, TX: Number + RealNumber, TY: Number + Ord, X: Array2<TX>, Y: Array1<TY>> {
|
||||
classes: Option<Vec<TY>>,
|
||||
instances: Option<Vec<Vec<TX>>>,
|
||||
#[serde(skip)]
|
||||
#[cfg_attr(feature = "serde", serde(skip))]
|
||||
parameters: Option<&'a SVCParameters<'a, TX, TY, X, Y>>,
|
||||
w: Option<Vec<TX>>,
|
||||
b: Option<TX>,
|
||||
|
||||
+1
-1
@@ -92,7 +92,7 @@ pub struct SVRParameters<'a, T: Number + RealNumber> {
|
||||
pub c: T,
|
||||
/// Tolerance for stopping criterion.
|
||||
pub tol: T,
|
||||
#[serde(skip_deserializing)]
|
||||
#[cfg_attr(feature = "serde", serde(skip_deserializing))]
|
||||
/// The kernel function.
|
||||
pub kernel: Option<&'a dyn Kernel<'a>>,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user