Entering edit mode
Yadav Sapkota
▴
130
@yadav-sapkota-5156
Last seen 10.3 years ago
Hello group,
I am trying to compare the classification accuracies of multiple
classifiers using ROC curves. I have created multiple ROC plots for
each of
these classifiers but I am looking for a single graph where I can
overlay
each of these individual ROC plots. Does anyone know anything about
creating such overlapping ROC plots in one graph?
Below is the sample code I have used:
Classifier 1:
require (e1071)
require(ROCR)
train=read.table('C:/train.txt', header=T, sep='\t')
y=as.factor(train[,2])
x=train[,3:5]
require(e1071)
model=svm(x,y,type='C', kernel='linear', cross=10)
test=read.table('C:/test.txt', header=T, sep='\t')
test_x=test[,3:5]
pred=predict(model,data.frame(test_x))
pred1=prediction(as.numeric(pred),test[,2])
perf=performance(pred1,'tpr','fpr')
plot(perf, col='red')
Classifier 2:
...
...
Classifier 3:
...
...
Now, I want to combine all these plots in one so that I can better
compare.
Thanks,
Yadav
[[alternative HTML version deleted]]