50% off | Unlimited Data & AI Learning
Get 50% off unlimited learning

smallstuff (version 1.0.3)

ROCknn: 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)

Value

A plot with the ROC curve will be produced, nothing is returned.

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.

Examples

Run this code
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