Skip to content

07.SVM smo_objective_computation_equation #4

@iCurious-D

Description

@iCurious-D

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions