Usage Arguments Value Examples
View source: R/toy_threeGaussians.R
1 | threeGaussians(n = 200, d = 2:4, n.tr = c(20, 100), seed = NULL)
|
n |
integer. the number of test samples |
d |
vector of three integers. the distance between the three negative gaussians and the positive gaussian |
n.tr |
vector of two integer, i.e. the number of positive and unlabeled training samples |
seed |
a seed point controlling the randomness. |
a list of the toy data set with two data frames (tr
and
te
) both containing the columns y
, x1
, and x2
.
in the training set the column y
in {0, 1} indicates if a sample
belongs to the positive class (1) or if it is unlabeled (0), and in the test
set te
if it belongs to the positive class (1) or the negative class
(0). x1
and x2
are the features or predictors.
1 2 3 4 5 6 7 8 9 10 11 12 13 | ## Not run:
toy <- threeGaussians(seed=9)
### plot the test set
par(mfrow=c(1,2))
plot( toy$te[ , -1 ], pch = c( 4, 16 )[ toy$te$y + 1 ] )
legend('topright', legend=c('pos', 'neg'), pch=c(16, 4))
### plot the training set
plot( toy$tr[ , -1 ], pch = c( 4, 16 )[ toy$tr$y + 1 ] )
legend('topright', legend=c('pos', 'un'), pch=c(16, 4))
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.