You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
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
The text was updated successfully, but these errors were encountered: