-
-
Notifications
You must be signed in to change notification settings - Fork 25.8k
sample_weight feature in LinearSVC (BaseLibLinear/SparseBaseLibLinear)) #409
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
Comments
SVC(kernel='linear') supports sample weights just in case ... |
Yes, but I am working on sparse data and I wish to use the decision_function method. Since that method is not implemented for svm.sparse.SVC..i have to use LinearSVC...is there any other way to overcome this? |
LinearSVC does not rely on libsvm, but on liblinear. Thus it would be necessary to add support for sample weights to liblinear, which is a sizeable amount of work. |
Well, according to the following link |
No, that's the LibSVM docs. To repeat what Gael said, |
Okay. Thanks. |
There does seem to be a LIBLINEAR fork supporting sample weights... http://www.csie.ntu.edu.tw/~cjlin/libsvmtools/#weights_for_data_instances Supporting I just noticed the same comment was made by @aabbi, but I don't understand why it was rejected. The code there is indeed a modified version of |
Seeing as scikit-learn has adopted the nonstandard LibSVM with sample weights, I assume the changes to LIBLINEAR should indeed be merged, so I'm reopening this Issue (and am willing to be shot down for doing so!). The differences can be viewed at http://github.com/jnothman/scikit-learn/tree/liblinear-sample_weight (particularly jnothman@54ec588). I have based this on the commit before Lars imported liblinear 0.91; there was no record of the diff from the downloaded LIBLINEAR 0.91 to that commit, which should have involved a branch and merge. I haven't (yet) modified our |
We already have class weights. You want to add sample weights in extra, Should the class_weights be then refactored to use the sample_weights? It The trick business here will be to make really sure that all the patches |
For symmetry with LibSVM if nothing else.
It looks like that liblinear fork supports both independently.
I've tried the merge that should apply them; there are 15 blocks with conflicts in |
fixed at some point since then. |
Currently, there does not seem to be a way to specify sample_weights when using svm.LinearSVC or svm.sparse.LinearSVC.
Can that feature be implemented? or Is there an existing way to do that?
libsvm contains the feature in http://www.csie.ntu.edu.tw/~cjlin/libsvmtools/#weights_for_data_instances
The text was updated successfully, but these errors were encountered: