Intel® Distribution for Python*
Engage in discussions with community peers related to Python* applications and core computational packages.

.decision_function() or .predict_proba() method for SVM (Python API)

Matt_P_1
Beginner
2,740 Views

Hi,

Are there currently any methods implemented in the Python API (in particular for the SVM model class, or for classification models in general) which correspond to the .decision_function() method of the Scikit-Learn svm.SVC model class, or the .predict_proba() method of many Scikit-Learn models (and the multiclass.OneVsRestClassifier class, which accepts any estimator with a .fit() and one of .decision_function() or .predict_proba() methods)?

For context, I would like to create ROC curves from the prediction results of my model - but to do so requires not just a predicted class, but some measure of strength of the prediction (either the transformed value under the decision function, or the predicted probability) to set various thresholds in order to construct that curve.

Thanks,

Matt

0 Kudos
1 Reply
Preethi_V_Intel
Employee
2,740 Views

decision function is currently available only for binary class SVM algorithm. The prediction results(also the distance from the hyper plane) are in fact the decision function scores(more details in this thread - https://software.intel.com/en-us/forums/intel-data-analytics-acceleration-library/topic/742985). You can plot the roc curve using these scores. 


For your reference, I have updated and attached svm example code to plot roc curve.

0 Kudos
Reply