Hot answers tagged

1

The roc function in the pROC package allows you to extract the sensitivity and specificity values. I will give an example below. Keep in mind that the $y$-axis is sensitivity, but the $x$-axis is $1 - specificity$. library(pROC) set.seed(2021) N <- 1000 x1 <- rnorm(N) x2 <- rnorm(N) x3 <- rnorm(N) z <- x1 + x2 + x3 pr <- 1/(1 + exp(-z)) y &...


1

You can use the general train from caret to train the model The new entry needs to be added in the form of the Train set, only then it will be able to predict I would have done this like this: library(caret) model_knn<-train(Species ~ ., data = db_class[row_train,], method = "knn",tuneLength = 10) #You can select any other tune length too. ...


Only top voted, non community-wiki answers of a minimum length are eligible