Statistical-Learning-Methods icon indicating copy to clipboard operation
Statistical-Learning-Methods copied to clipboard

07.SVM smo_objective_computation_equation

Open iCurious-D opened this issue 1 year ago • 0 comments

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.

iCurious-D avatar Sep 13 '24 07:09 iCurious-D