2012/6/18 Ian Goodfellow <[email protected]>:
>
> On Fri, May 25, 2012 at 10:32 AM, Ian Goodfellow
> <[email protected]> wrote:
>> OK. I think I see how to do this for binary classification. For the
>> multiclass one-vs-one classification, how do we map from the decision
>> function to an actual label prediction?

I think the best way to understand how libsvm does its multiclass
one-vs-one predictions is to read the C++ source directly:

  
https://github.com/scikit-learn/scikit-learn/blob/master/sklearn/svm/src/libsvm/svm.cpp#L2765

AFAIK nobody in the scikit-learn project has tried to re-implement it
in collapsed primal form (for the linear case) using numpy so far.

I don't know how to re-implement multi-class predict_probalities using
the collapsed weight vector for the linear kernel case and the primal
formulation though. The original libsvm implementation of that
function is documented here:

  http://www.csie.ntu.edu.tw/~cjlin/papers/svmprob/svmprob.pdf (I have
not read that paper myself).

> Also, if I were to make the speedup in libsvm rather than in
> scikits-learn (to fix the problem at the source), how hard would it be
> to pull the new version of libsvm in scikits?

I think contributing a C++ collapsed prediction function that works in
the primal for the linear case directly to libsvm would be useful to
people other that scikit-learn users. Would be worth contacting the
upstream authors if you plan to do so.

Upgrading from one libsvm version to another should definitely not be
an issue as it has already been done several times in the past
(although it's not that trivial because of our support of both dense
and sparse representations which is not the case in the original
project).

The upstream dense variant of the code base is here:
http://www.csie.ntu.edu.tw/~cjlin/libsvmtools/#libsvm_for_dense_data

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

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Scikit-learn-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/scikit-learn-general

Reply via email to