[pymvpa] default SVM C parameter

Michael Hanke mih at debian.org
Fri Sep 16 05:47:34 UTC 2011

On Thu, Sep 15, 2011 at 08:21:17PM -0700, Mark Lescroart wrote:
> Thanks much for the responses, good to know that classification
> results aren't too fragile...
> I would like to re-iterate my question, though: does anyone have any
> idea how (specfically) the default C parameter is chosen?

Here is the code from _svmbase.py

        if self.params.kernel.__kernel_name__ == 'linear':
            datasetnorm = np.mean(np.sqrt(np.sum(data*data, axis=1)))
            if datasetnorm == 0:
                warning("Obtained degenerate data with zero norm for training "
                        "of %s.  Scaling of C cannot be done." % self)
                return 1.0
            value = 1.0/(datasetnorm**2)


Michael Hanke

More information about the Pkg-ExpPsy-PyMVPA mailing list