Roc 곡선을 계산하고 선형 차별 모델로부터 AUC를 계산하고 싶습니다. 내가 어떻게 이럴 수 있니?선형 차별 분석의 Roc 곡선 R
##LDA
require(MASS)
library(MASS)
lda.fit = lda(Negative ~., trainSparse)
lda.fit
plot(lda.fit)
###prediction on the test set
lda.pred=predict(lda.fit,testSparse)
table(testSparse$Negative,lda.pred$class)
: > rocplot = 기능 (PRED, 진실, ...) {여기에 코드가있다 + predob = 예측 (pred, truth) + perf = 성능 (predob, "tpr", "fpr") +} > yhat.opt = predict (lda.fit , testSparse, 결정. 값 = TRUE) > rocplot (fitted.opt, testSparse [ "Negative"], main = "Training Data"). 그러나 다음 오류가 나타납니다. 예측 오류 (pred, truth) : 예측 형식이 유효하지 않습니다. –
[ROCR 패키지로 AUC를 계산하는 방법] (http://stackoverflow.com/questions/41523761/how-to-compute-auc-with-rocr-package) –