Closed daslu closed 10 years ago
Agreed, this seems like a very reasonable addition. A pull request would be awesome. My only request is that you handle the case of true/false inputs by converting to 1 or 0, respectively to maintain backwards compatibility for existing callers.
Hi,
I have seen the deprecation notice, so I guess the pull request is not relevant here anymore. I am fixing this at my fork.
Let us keep in touch in case you are interested in it again, one day.
Again, many thanks for this very nice project.
Will do, I'll contact you about a redesign if that is ever in the cards.
Hey daslu, (2) would be the same thing as simply leaving the bias feature out since w*0=0.
Thanks, yes, this seems to be true for all the various objective functions supported by liblinear-java. I have no idea why liblinear-java supports adding a zero column.
The liblinear bias parameter is defined as follows (README.md at commit 7b6c6a56c1 of liblinear java): https://github.com/bwaldvogel/liblinear-java/blob/master/README.md "if bias >= 0, instance x becomes [x; bias]; if < 0, no bias term added (default -1)".
clj-liblinear does support the use of bias (thanks to #4 by @akhudek).
Currently in clj-liblinear, the only supported bias values are 0 and 1: https://github.com/lynaghk/clj-liblinear/blob/master/src/clj_liblinear/core.clj#L54 Also, the bias=0 case results in not adding the extra featue: https://github.com/lynaghk/clj-liblinear/blob/master/src/clj_liblinear/core.clj#L64
I suggest to the following changes: (1) Support all bias values. (2) Let the bias=0 case behave like documented in liblinear-java: adding an extra feature of value 0.
Reasons for the change:
If desired, I can suggest a pull request with these changes. What do you think?