4
要繪製ROC曲線:R:xgboost情節ROC曲線
library(ROCR)
<data cleaning/scrubbing>
<train data>
.....
.....
rf.perf = performance(rf.prediction, "tpr", "fpr") #for RF
logit.perf = performance (logit.prediction, "tpr", "fpr") #for logistic reg
tree.perf = performance(tree.prediction, "tpr", "fpr") #for cart tree
...
plot(re.perf) #a RF roc curve
如果我想運行一個xgboost
分類,然後繪製ROC: 目標= 「二進制:物流」
我很困惑與xgboost的參數指標「auc」(頁碼9的CRAN manual),它表示區域。 如何用tpr和fpr繪製曲線進行模型比較?
我試過搜索網和github,最重視功能重要性圖(對於xgboost
)。
感謝
只是爲了澄清,該AUC是面積UND呃接收者操作符曲線(ROC)的曲線。這是0-1之間的度量。對我而言,你所問的問題並不完全清楚。我猜你只是想繪製中華民國,但這樣做有困難?也許包括一個[可重現的例子](http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example),這可能有所幫助。 – BlankUsername