genSMILEY: Generate SMILEY Data

Description Usage Arguments Value Examples

View source: R/data_genSMILEY.R

Description

Creates a smiley-face data in \mathbf{R}^2. This function is a modification of mlbench's mlbench.smiley function.

Usage

1
genSMILEY(n = 496, sd = 0.1)

Arguments

n

number of samples to be generated.

sd

additive Gaussian noise level.

Value

a list containing

data

an (n\times 2) data matrix.

label

a length-n vector(factor) for class labels.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
## Generate SMILEY Data with Difference Noise Levels
s10 = genSMILEY(200, sd=0.1)
s25 = genSMILEY(200, sd=0.25)
s50 = genSMILEY(200, sd=0.5)

## Visualize
opar <- par(no.readonly=TRUE)
par(mfrow=c(1,3), pty="s")
plot(s10$data, col=s10$label, pch=19, main="sd=0.10")
plot(s25$data, col=s25$label, pch=19, main="sd=0.25")
plot(s50$data, col=s50$label, pch=19, main="sd=0.50")
par(opar)

T4cluster documentation built on Aug. 16, 2021, 9:07 a.m.