【发布时间】:2017-06-02 07:46:20
【问题描述】:
性能错误(pred,“tpr”,“fpr”):错误的参数类型: 第一个参数必须是“预测”类型;第二个和可选的第三个 参数必须是可用的性能度量!
s <- svm(Column20 ~ ., data =train)
pred <- predict(s, test[,-20])
x <-table( pred, test$Column20)
P <- performance(x, "tpr", "fpr")
如果我将这行代码更改为 x
Error in prediction(pred, test$Column20) :
Format of predictions is invalid.
我没有正确理解错误。你能解释一下我做错了什么吗? 提前致谢
【问题讨论】:
-
你应该使用
x <- prediction( pred, test$Column20)然后P <- performance(x, "tpr", "fpr") -
s
标签: r