On 02/13/2012 09:49 PM, Lars Buitinck wrote:
> Hi all,
>
> After reading some papers on (approximate) polynomial kernels for NLP
> applications, I got curious and decided to do some quick experiments.
> I modified the 20 newsgroups example to benchmark vanilla SVC instead
> of LinearSVC with linear, quadratic and cubic kernels. I was quite
> surprised at the results.
>
> For reference, LinearSVC(C=1000, loss=l2, penalty=l2) obtains an
> F1-score of 0.896 on the default set of four document classes.
>
> I replaced this with
>
>      params = {'C': [.01, .1, 1, 10, 100, 1000]}
>      GridSearchCV(SVC(kernel='linear'), params, score_func=metrics.f1_score)
>
>    
That is weird.
> I verified that the features coming from text.Vectorizer are
> normalized; they're all in the range [-1, 1].
>    
I guess that is not the problem here but chi2 is only defined for 
positive input, right?

> I'm sure I did something wrong, but can anyone tell me what? Is my C
> value still not high enough? Am I missing the magic parameter that
> will make this work?
>    
I'm pretty sure you are, though I'm not sure what it is.
I would concentrate on the linear case, since something seems
to be wrong there. You should get basically the same result
with SVC(kernel='linear') then with LinearSVC.
If I understood you correctly, you couldn't do  that.

At the moment I'm not sure when and how the "C" values
are scaled by the number of examples. But as long as the optimum
classifier has a "border case" parameter, you should increase your range.

Cheers,
Andy

------------------------------------------------------------------------------
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
_______________________________________________
Scikit-learn-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/scikit-learn-general

Reply via email to