ROCknn | R Documentation |
Plot the ROC curve for a KNN model. Note that it can only be used when the response is dichotomous.
ROCknn(mod, response)
mod |
The output of the knn function, run with prob=TRUE |
response |
A vector with responses for the testing dataset used to run the knn function. |
A plot with the ROC curve will be produced, nothing is returned.
yhat=class::knn(Puromycin[,c("conc","rate")],Puromycin[,c("conc","rate")],
Puromycin$state,10,prob=TRUE)
ROCknn(yhat,Puromycin$state)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.