ROCknn {smallstuff} | R Documentation |
KNN ROC curve
Description
Plot the ROC curve for a KNN model. Note that it can only be used when the response is dichotomous.
Usage
ROCknn(mod, response)
Arguments
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. |
Value
A plot with the ROC curve will be produced, nothing is returned.
Examples
yhat=class::knn(Puromycin[,c("conc","rate")],Puromycin[,c("conc","rate")],
Puromycin$state,10,prob=TRUE)
ROCknn(yhat,Puromycin$state)
[Package smallstuff version 1.0.3 Index]