clean of unnecessary checks, imports, calls (#7993)

This commit is contained in:
Mark Mayo
2022-11-21 00:00:27 +13:00
committed by GitHub
parent a25c53e8b0
commit f32d611689
27 changed files with 44 additions and 57 deletions

View File

@ -388,16 +388,10 @@ class SmoSVM:
return (data - self._min) / (self._max - self._min)
def _is_unbound(self, index):
if 0.0 < self.alphas[index] < self._c:
return True
else:
return False
return bool(0.0 < self.alphas[index] < self._c)
def _is_support(self, index):
if self.alphas[index] > 0:
return True
else:
return False
return bool(self.alphas[index] > 0)
@property
def unbound(self):