Skip to content

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

@bmccord2

Description

@bmccord2

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions