2013/5/8 Ark <[email protected]>:
>  I am using sgdclassifier for document clasification.
[snip]
>  -is there a way to predict next best match directly?

The decision_function method returns what you want: scores for the
individual classes, which can be combined with the labels using
something like (for a single sample; untested, on the run):

    import operator

    scores = clf.decision_function(x)
    classes_with_scores = zip(clf.classes_, scores)
    classes_with_scores.sort(key=operator.itemgetter(1))

If you set loss="log", you can also (in the dev version) get
probabilities, which may be more useful than these scores if you're
working in a probabilistic framework.

HTH!

-- 
Lars Buitinck
Scientific programmer, ILPS
University of Amsterdam

------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and 
their applications. This 200-page book is written by three acclaimed 
leaders in the field. The early access version is available now. 
Download your free book today! http://p.sf.net/sfu/neotech_d2d_may
_______________________________________________
Scikit-learn-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/scikit-learn-general

Reply via email to