TopKSample | R Documentation |
Sampler to generate N top-k lists according to p. A function wrapping to a native C implementation is available as well.
TopKSample(p, N) TopKSample.c(p, N)
p |
Matrix of dimension n*(k+1), n is the number of items (to be ranked) and k is the top elements in the joint ranking. Each column is a multinomial probability vector. |
N |
The number of samples |
A pure R implementation TopKSample
and a native C method TopKSample.c
are available.
N TopKlists
By default the C implementation is used due to its better performance.
Jie Ding <jding@jimmy.harvard.edu>
set.seed(1234) rank.pool <- 1:10 a <- sample(rank.pool, 10) b <- sample(rank.pool, 10) c <- sample(rank.pool, 10) M <- cbind(a, b, c) TopKSample.c(M, 4)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.