fix: fixes a bug in Eq implementation for SVC and SVR

This commit is contained in:
Volodymyr Orlov
2020-10-31 14:43:52 -07:00
parent 81395bcbb7
commit a9446c00c2
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -247,7 +247,7 @@ impl<T: RealNumber, M: Matrix<T>, K: Kernel<T, M::RowVector>> SVC<T, M, K> {
impl<T: RealNumber, M: Matrix<T>, K: Kernel<T, M::RowVector>> PartialEq for SVC<T, M, K> {
fn eq(&self, other: &Self) -> bool {
if self.b != other.b
if (self.b - other.b).abs() > T::epsilon() * T::two()
|| self.w.len() != other.w.len()
|| self.instances.len() != other.instances.len()
{
+1 -1
View File
@@ -204,7 +204,7 @@ impl<T: RealNumber, M: Matrix<T>, K: Kernel<T, M::RowVector>> SVR<T, M, K> {
impl<T: RealNumber, M: Matrix<T>, K: Kernel<T, M::RowVector>> PartialEq for SVR<T, M, K> {
fn eq(&self, other: &Self) -> bool {
if self.b != other.b
if (self.b - other.b).abs() > T::epsilon() * T::two()
|| self.w.len() != other.w.len()
|| self.instances.len() != other.instances.len()
{