Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is synthetic bias feature added when using liblinear as a library? #80

Open
bmccord2 opened this issue Feb 11, 2022 · 0 comments
Open

Comments

@bmccord2
Copy link

bmccord2 commented Feb 11, 2022

I am using a java version of liblinear which was autogenerated from the C++ code, so I am a little conflicted about where to ask this question, so I figured why not ask in both projects? The documentation on bias is a little unclear to me. I can see that when using the provided command-line executables, an additional bias term is automatically added to the feature set, but from what I can tell this does not appear to be the case if you use liblinear as a library for training and/or testing and prediction.

Intuitively one would assume that setting the bias param to some value would have an effect on the model, but it seems to me that if you set bias to 1, this would do nothing. In the executables the bias term is used as the synthetic feature's value, but if you are required to manually add the synthetic feature when you write your own code, is there any point in even setting bias? One could set bias to 1.0 and add a synthetic feature with any value. Additionally, it appears that this behavior, coupled with the way in which the dot product is calculated makes it difficult to even know when there is an issue as the model will typically work regardless of the input size (as I recall, it seems that features are simply being searched for as needed, and due to the sparse dot product missing features are ignored).

Maybe I am completely wrong in my analysis of the code, I am very rusty with C++. But it seems like the library does not take ownership of managing the bias despite that behavior being heavily implied. When constructing a problem it is suggested to set the bias param, manually increase the number of features, and then also manually add the feature to the inputs. So it seems the data format for a problem and of a model allows for an inconsistent state--where you are requesting bias be used, but not actually getting it or using some value other than the bias term as the synthetic feature

bwaldvogel/liblinear-java#42

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant