gen2circles {TDAkit} | R Documentation |
Generate Two Intersecting Circles
Description
It generates data from two intersecting circles.
Usage
gen2circles(n = 496, sd = 0)
Arguments
n |
the total number of observations to be generated. |
sd |
level of additive white noise. |
Value
a list containing
- data
an
(n\times 2)
data matrix for row-stacked observations.- label
a length-
n
vector for class label.
Examples
## 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)
[Package TDAkit version 0.1.2 Index]