View source: R/etc_create_samples.R
create_sim_samples | R Documentation |
The create_sim_samples
function generates random samples
with different performance levels.
create_sim_samples(n_repeat, np, nn, score_names = "random")
n_repeat |
The number of iterations to make samples. |
np |
The number of positives in a sample. |
nn |
The number of negatives in a sample. |
score_names |
A character vector for the names of the following performance levels.
|
The create_sim_samples
function returns a list
with the following items.
scores: a list of numeric vectors
labels: an integer vector
modnames: a character vector of the model names
dsids: a character vector of the dataset IDs
mmdata
for formatting input data.
evalmod
for calculation evaluation measures.
##################################################
### Create a set of samples with 10 positives and 10 negatives
### for the random performance level
###
samps1 <- create_sim_samples(1, 10, 10, "random")
## Show the list structure
str(samps1)
##################################################
### Create two sets of samples with 10 positives and 20 negatives
### for the random and the poor early retrieval performance levels
###
samps2 <- create_sim_samples(2, 10, 20, c("random", "poor_er"))
## Show the list structure
str(samps2)
##################################################
### Create 3 sets of samples with 5 positives and 5 negatives
### for all 5 levels
###
samps3 <- create_sim_samples(3, 5, 5, "all")
## Show the list structure
str(samps3)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.