2012/10/26  <paul.czodrow...@merckgroup.com>:
> I think that I have to re-phrase my post, since I discovered an awkward
> behavior using SVC and the linear kernel - exactly THIS kernel takes ages
> on my dataset.
>
> E.g. the "RBF" kernel runs perfect, and so does the GridSearch! :)
> Exclusion of the "linear" kernel from GridSearch gives now the following:
>
> "
> # Tuning hyper-parameters for precision
>
> Best parameters set found on development set:
>
> SVC(C=1, cache_size=200, class_weight=None, coef0=0.0, degree=3, gamma=0.0,
>   kernel=rbf, probability=False, shrinking=True, tol=0.001, verbose=False)
>
> Grid scores on development set:
>
> 0.000 (+/-0.000) for {'kernel': 'rbf', 'C': 1}
> 0.000 (+/-0.000) for {'kernel': 'rbf', 'C': 10}
> 0.000 (+/-0.000) for {'kernel': 'rbf', 'C': 100}
> 0.000 (+/-0.000) for {'kernel': 'rbf', 'C': 1000}
> 0.000 (+/-0.000) for {'kernel': 'sigmoid', 'C': 1}
> 0.000 (+/-0.000) for {'kernel': 'sigmoid', 'C': 10}
> 0.000 (+/-0.000) for {'kernel': 'sigmoid', 'C': 100}
> 0.000 (+/-0.000) for {'kernel': 'sigmoid', 'C': 1000}

When you grid search C for rbf with non linear kernels (such as RBF)
you should always also grid search for the optimal value of the kernel
parameters (e.g. gamma for RBF kernels). The zero scores you get
probably stem from a default value of gamma that does not work at all
for your data.

See for instance:
http://scikit-learn.org/stable/auto_examples/grid_search_digits.html

As for the linear kernel that takes ages, maybe you are dealing with a
convergence issue of libsvm. The master branch has a fix to stop the
convergence in some pathological situations. Such convergence issues
can happen when the data is not properly scaled. Have you scaled you
data? If not have a look at the preprocessing module:

http://scikit-learn.org/stable/modules/preprocessing.html

-- 
Olivier
http://twitter.com/ogrisel - http://github.com/ogrisel

------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_sfd2d_oct
_______________________________________________
Scikit-learn-general mailing list
Scikit-learn-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/scikit-learn-general

Reply via email to