Description Usage Arguments Details Value See Also Examples
View source: R/generate_labels.R
Function to generate a vector of random labels
1 | generate_labels(n, pos_rate)
|
n |
number of labels to be generated |
pos_rate |
rate of expected positive labels |
This function generates "n" random labels in -1, 1 drawn from the binomial distribution B(n, pos_rate)
-1/1 vector of length "n" containing the generated labels
1 2 3 4 5 | pos_rate <- 0.3;
n <- 100;
## generating n random labels with 0.3 expected rate of positive labels
random_labels <- generate_labels(n, pos_rate);
sum(random_labels > 0);
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.