Re: [Scikit-learn-general] Question about using sample weights to fit an svm

2013-07-23 Thread Anne Dwyer
Thanks Daniel. On Tue, Jul 23, 2013 at 2:40 AM, Daniel Vainsencher < daniel.vainsenc...@gmail.com> wrote: > I opened the issue for the first, also mentioning the second problem. > > https://github.com/scikit-learn/scikit-learn/issues/2191 > > Daniel > > > On 07/22/2013 03:16 PM, Andreas Mueller

Re: [Scikit-learn-general] Question about using sample weights to fit an svm

2013-07-22 Thread Daniel Vainsencher
I opened the issue for the first, also mentioning the second problem. https://github.com/scikit-learn/scikit-learn/issues/2191 Daniel On 07/22/2013 03:16 PM, Andreas Mueller wrote: On 07/22/2013 02:12 PM, Anne Dwyer wrote:

Re: [Scikit-learn-general] Question about using sample weights to fit an svm

2013-07-22 Thread Andreas Mueller
On 07/22/2013 02:12 PM, Anne Dwyer wrote: > Andy, > > Shouldn't we also pull a ticket because using a uniform weight > distribution does not give the same results as running the SVM without > weights? (See my original post on the problem.) I think that should scale the C. If it doesn't, please al

Re: [Scikit-learn-general] Question about using sample weights to fit an svm

2013-07-22 Thread Anne Dwyer
Andy, Shouldn't we also pull a ticket because using a uniform weight distribution does not give the same results as running the SVM without weights? (See my original post on the problem.) Thanks, Anne On Mon, Jul 22, 2013 at 4:50 AM, Andreas Mueller wrote: > Hi Daniel. > Could you please ope

Re: [Scikit-learn-general] Question about using sample weights to fit an svm

2013-07-22 Thread Andreas Mueller
Hi Daniel. Could you please open an issue and maybe provide a sample script that demonstrates that changing the sample weights doesn't change the decision function? That sounds like a bug. Cheers, Andy On 07/21/2013 02:08 PM, Daniel Vainsencher wrote: I encountered similar problems. Weightin

Re: [Scikit-learn-general] Question about using sample weights to fit an svm

2013-07-21 Thread Daniel Vainsencher
I encountered similar problems. Weighting libsvm inputs under sklearn seems unsafe at any speed... Amusingly enough, I think the pretty demo at [1] demonstrates the problem. Notice how the white samples are really dominant... but the decision boundary is consistent with uniform weights. If you ch

Re: [Scikit-learn-general] Question about using sample weights to fit an svm

2013-07-12 Thread Anne Dwyer
Peter, I tried your suggestion. But my training error with sample weights is still not the same as without sample weights. It seems like I am missing something here. It doesn't seem to work for me. Anne Dwyer On Fri, Jul 12, 2013 at 5:19 PM, Peter Prettenhofer < peter.prettenho...@gmail.com> wr

Re: [Scikit-learn-general] Question about using sample weights to fit an svm

2013-07-12 Thread Peter Prettenhofer
try float(len(y_train)) - seems like C default is int... Am 13.07.2013 00:10 schrieb "Anne Dwyer" : > Peter, > > Thanks for your answers. When I scale C by len(y_train), I get the > following error: > > ValueError: C <= 0 > > Anne Dwyer > > > On Fri, Jul 12, 2013 at 3:34 PM, Peter Prettenhofer < >

Re: [Scikit-learn-general] Question about using sample weights to fit an svm

2013-07-12 Thread Anne Dwyer
Peter, Thanks for your answers. When I scale C by len(y_train), I get the following error: ValueError: C <= 0 Anne Dwyer On Fri, Jul 12, 2013 at 3:34 PM, Peter Prettenhofer < peter.prettenho...@gmail.com> wrote: > Hi Anne, > > I would also expect that using uniform weights should result in th

Re: [Scikit-learn-general] Question about using sample weights to fit an svm

2013-07-12 Thread Peter Prettenhofer
2013/7/12 Peter Prettenhofer > Hi Anne, > > I would also expect that using uniform weights should result in the same > solution as no weights -- but maybe there is an interaction with the C > parameter... for this we would need to know more about the internals of > libsvm and how it handles sampl

Re: [Scikit-learn-general] Question about using sample weights to fit an svm

2013-07-12 Thread Peter Prettenhofer
Hi Anne, I would also expect that using uniform weights should result in the same solution as no weights -- but maybe there is an interaction with the C parameter... for this we would need to know more about the internals of libsvm and how it handles sample weights - try scaling C by ``len(y_train

[Scikit-learn-general] Question about using sample weights to fit an svm

2013-07-12 Thread Anne Dwyer
I have been using the sonar data set (I believe this is a sample data set used in many demonstrations of machine learning.) It is a two class data set with 60 features with 208 training examples. I have a questions about using sample weights in fitting the SVM model. When I fit the model using sc