ROCknn: KNN ROC curve

View source: R/statLearn.R

ROCknnR 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)

smallstuff documentation built on June 2, 2022, 5:06 p.m.