powered by
Plot the ROC curve for a KNN model. Note that it can only be used when the response is dichotomous.
ROCknn(mod, response)
A plot with the ROC curve will be produced, nothing is returned.
The output of the knn function, run with prob=TRUE
A vector with responses for the testing dataset used to run the knn function.
yhat=class::knn(Puromycin[,c("conc","rate")],Puromycin[,c("conc","rate")], Puromycin$state,10,prob=TRUE) ROCknn(yhat,Puromycin$state)
Run the code above in your browser using DataLab