I am trying to classify a dataset containing two classes using different classifiers (LDA, SVM, KNN) and would like to compare their performance. I made ROC curves for the LDA, changing the a priori probability.
But how can I do the same for the KNN classifier?
I went through the documentation and found some features:
Class = knnclassify(Sample, Training, Group, k)mdl = ClassificationKNN.fit(X,Y,'NumNeighbors',i,'leaveout','On')
I can run (a) and get the confusion matrix using cross-validation of the residual option, but it is not possible to change the a priori probability of making an ROC?
I have not tried (b) yet, but this creates a model in which you can modify mdl.Prior. But I have no idea how to get the matrix of confusion.
Is there an option I missed, or someone who can explain how to fully use this function to get ROC?
source share