On 05/06/2013 12:27 PM, [email protected] wrote:
> Hello,
>
>    I would like to use OneClassSVM for novelty detection. I have some
> 'normal' data for fitting the classifier. Then I have 'normal' and
> 'abnormal' data for testing the performance.
>
>    I would like to use the area under the ROC curve as the figure of
> merit of the detector. The function roc_curve needs the predicted
> probability. I have read that the probability can be obtained if the
> classifier is obtained with the parameter probability = True. However,
> I get an error when I try to pass this parameter.
>
>    I am using version 0.10 of sklearn.
>
>    For instance:
>
>    import sklearn
>    import sklearn.metrics
>    import scipy
>    import sklearn.svm
>
>    X = scipy.random.randn(100, 2)
>
>    X_train = scipy.r_[X + 2, X - 2]
>
>    clf = sklearn.svm.OneClassSVM(nu=0.1, kernel="rbf", gamma=0.1,
> probability=True)
>
>    Then I get an error. I have also tried
>
>    clf = sklearn.svm.OneClassSVM(nu=0.1, kernel="rbf", gamma=0.1)
>    clf.fit(X_train, probability=True)
>
>    but it is again an error.
>
>    Is that option available for OneClassSVM? If not, how could I draw
> the ROC? Could I sweep a threshold on the distance to the hyperplane
> given by clf.decision_function?
>
Yes, I think this is what you should do.
Hth,
Andy

------------------------------------------------------------------------------
Introducing AppDynamics Lite, a free troubleshooting tool for Java/.NET
Get 100% visibility into your production application - at no cost.
Code-level diagnostics for performance bottlenecks with <2% overhead
Download for free and get started troubleshooting in minutes.
http://p.sf.net/sfu/appdyn_d2d_ap1
_______________________________________________
Scikit-learn-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/scikit-learn-general

Reply via email to