-
Notifications
You must be signed in to change notification settings - Fork 281
Description
in the class defination:
class SVM:
...
def _smo_objective(self, i, j):
alpha, Y, K = self.alpha, self.Y, self.K
return (alpha[i] * Y[i] * alpha * K[i:] * Y).sum() + (alpha[j] * Y[j] * alpha * K[j:] * Y).sum()
- .5 * alpha[i] ** 2 * K[i, i] - .5 * alpha[j] ** 2 * K[j, j] - alpha[i] * alpha[j] * Y[i] * Y[j] * K[i, j]
- alpha[i] - alpha[j]
...
while the quation in the book(7.101) is more like this :
(alpha[i] * Y[i] * alpha * K[i:] * Y).sum() + (alpha[j] * Y[j] * alpha * K[j:] * Y).sum()
\ + .5 * alpha[i] ** 2 * K[i, i] + .5 * alpha[j] ** 2 * K[j, j] + alpha[i] * alpha[j] * Y[i] * Y[j] * K[i, j]
\ - alpha[i] - alpha[j]
I'm not sure about that , hopefully I am not confused by those complex equations.
Thank you and really learned a lot from your project.