It generates nested donuts, which are just hollow circles. For flexible
testing, the parameter k
controls the number of circles of varying
radii where n
controls the number of observations for each circle.
genDONUTS(n = 50, k = 2, sd = 0.1)
n | the number of data points for each hollow circle (default: 50). |
---|---|
k | the number of circles (default: 2). |
sd | magnitude of white noise (default: 0.1). |
a named list containing with \(m = nk\):
an \((m\times 2)\) data matrix.
a length-\(m\) vector(factor) for class labels.
# \donttest{ ## generate data donut2 = genDONUTS(k=2) donut3 = genDONUTS(k=3) donut4 = genDONUTS(k=4) ## visualize opar <- par(no.readonly=TRUE) par(mfrow=c(1,3), pty="s") plot(donut2$data, col=donut2$label, pch=19, main="k=2") plot(donut3$data, col=donut3$label, pch=19, main="k=3") plot(donut4$data, col=donut4$label, pch=19, main="k=4")