Skip to content

Objective function in SMO SVM #1

@kilianFatras

Description

@kilianFatras

Hello jonchar,

I was reading your notebook on solving SVM with SMO algorithm. Unfortunately there is a part that I might misunderstand and looks as an error to me. When you define your objective function, you return :
``return np.sum(alphas) - 0.5 * np.sum(target * target * kernel(X_train, X_train) * alphas * alphas)

However, I think the term (target * target) is target^2 (element wise multiplication) instead of a matrix composed of target_i * target_j. To agree with the theory, I would have coded target[:,None] * target[None,:] to get such matrix.

One more time, I might be wrong, and I would really appreciate your feedback on it.

Best,

Kilian

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