fix: fixes a bug in Eq implementation for SVC and SVR
This commit is contained in:
+1
-1
@@ -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> {
|
impl<T: RealNumber, M: Matrix<T>, K: Kernel<T, M::RowVector>> PartialEq for SVC<T, M, K> {
|
||||||
fn eq(&self, other: &Self) -> bool {
|
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.w.len() != other.w.len()
|
||||||
|| self.instances.len() != other.instances.len()
|
|| self.instances.len() != other.instances.len()
|
||||||
{
|
{
|
||||||
|
|||||||
+1
-1
@@ -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> {
|
impl<T: RealNumber, M: Matrix<T>, K: Kernel<T, M::RowVector>> PartialEq for SVR<T, M, K> {
|
||||||
fn eq(&self, other: &Self) -> bool {
|
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.w.len() != other.w.len()
|
||||||
|| self.instances.len() != other.instances.len()
|
|| self.instances.len() != other.instances.len()
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user