Description Usage Arguments Value Examples
View source: R/data_gen2circles.R
It generates data from two intersecting circles.
1 | gen2circles(n = 496, sd = 0)
|
n |
the total number of observations to be generated. |
sd |
level of additive white noise. |
a list containing
an (n\times 2) data matrix for row-stacked observations.
a length-n vector for class label.
1 2 3 4 5 6 7 8 9 10 11 12 13 | ## Generate Data with Different Noise Levels
nn = 200
x1 = gen2circles(n=nn, sd=0)
x2 = gen2circles(n=nn, sd=0.1)
x3 = gen2circles(n=nn, sd=0.25)
## Visualize
opar <- par(no.readonly=TRUE)
par(mfrow=c(1,3), pty="s")
plot(x1$data, pch=19, main="sd=0.00", col=x1$label)
plot(x2$data, pch=19, main="sd=0.10", col=x2$label)
plot(x3$data, pch=19, main="sd=0.25", col=x3$label)
par(opar)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.