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)
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 rightw
. I replace your function with mine below, which works. Let me know what you think, I can do a pull request to correct it.Yitao