Quantcast
Channel: Data Science, Analytics and Big Data discussions - Latest topics
Viewing all articles
Browse latest Browse all 4448

ROC Curve and AUC value on SVM model

$
0
0

Hello Everyone,
I am new to ML. I have a question so I am evaluating my SVM model.
Example:

SVM_MODEL = svm.SVC()
SVM_MODEL.fit(X_train,y_train)
SVM_OUTPUT = SVM_MODEL.predict(X_test)

And I want to plot my roc curve and AUC value for it is this the correct code?

fpr1, tpr1, thresholds = metrics.roc_curve(y_valid, SVM_OUTPUT, pos_label=0)
plt.ylabel(“True Positive Rate”)
plt.xlabel(“False Positive Rate”)
plt.title(“ROC Curve”)
plt.plot(tpr1,fpr1)
plt.show()
auc = np.trapz(fpr1,tpr1)
print(‘Area Under ROC Curve:’, auc)

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 4448

Trending Articles