Problems with LibLinear and coefficents in w()

16 views
Skip to first unread message

Hannes

unread,
Mar 1, 2013, 3:18:58 AM3/1/13
to mlpy-g...@googlegroups.com
I am having trouble with the definition of LibLinear.w()

When I use LibLinear.pred(x_test)
I receive [1,-1,1]
but when using the coefficients for each x vector like

np.sign(np.dot(LibLinear.w(), x_i)+LibLinear.bias())

I receive the following predictions:
[-1,1,-1]

How is the vector w defined internally?

The labels are [-1, 1]
and the number of classes is 2.

Do I really have to multiply w and bias by (-1)?

Thank you for any hint on that!

Reply all
Reply to author
Forward
0 new messages