acc_topk | R Documentation |
get top k accuracy
acc_topk(pred_topk, truth)
pred_topk |
a matrix of integers; each row indicates top 1, 2, ..., k causes |
truth |
a vector of integers; its length equals the number of rows in
|
numeric; between 0 and 1; the higher the more accurate.
xx <- matrix(c(0.3,0.1,0.2,0.4,
0.4,0.1,0.3,0.2),nrow=2,ncol=4,byrow=TRUE)
pred_top2 <- get_topk_COD(xx,2)
acc_topk(pred_top2,c(4,2))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.