LasseRegin / SVM-w-SMO

Simple implementation of a Support Vector Machine using the Sequential Minimal Optimization (SMO) algorithm for training.
MIT License
117 stars 55 forks source link

calc_w function issue #3

Closed oooook0 closed 6 years ago

oooook0 commented 6 years ago

Hey Lasse,

When I tried your SVM, it seems calc_w was not working properly as alpha*y calculated the dot product of these two vectors so that your function doesn't really return the right w. I replace your function with mine below, which works. Let me know what you think, I can do a pull request to correct it.

    def calc_w(self, alpha, y, X):

        new = np.multiply(alpha,y)
        return np.dot(X.T, new)

Yitao

LasseRegin commented 6 years ago

Hi Yitao,

Thanks for noticing! Feel free to open a pull request.

/Lasse

oooook0 commented 6 years ago

Hey Lasse,

The pull request has been created, please take a look.

Yitao