get_topk_COD: get top k ids for each row

View source: R/utils.R

get_topk_CODR Documentation

get top k ids for each row

Description

get top k ids for each row

Usage

get_topk_COD(probs, s)

Arguments

probs

a matrix where columns are causes; the entries are probabilities of causes

s

top s

Value

data frame; for each row in probs, indicating the top s causes

Examples


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)
get_topk_COD(xx,2)


zhenkewu/doubletree documentation built on Oct. 21, 2023, 7:04 a.m.