Learn R Programming

Rdimtools (version 0.3.2)

aux.gensamples: Generate model-based samples

Description

It generates samples from predefined 3-d shapes, set by dname parameter. Also incorporated a functionality to add white noise with degree noise.

Usage

aux.gensamples(n = 496, noise = 0.1, dname = "swiss")

Arguments

n

the number of points to be generated.

noise

level of additive white noise.

dname

name of a predefined shape. Should be one of

"swiss"

swiss roll

"crown"

crown

"helix"

helix

"saddle"

manifold near saddle point

"ribbon"

ribbon

"bswiss"

broken swiss

"cswiss"

cut swiss

"twinpeaks"

two peaks

Value

an \((n\times 3)\) matrix of generated data by row.

References

van_der_maaten_dimensionality_2009Rdimtools

Examples

Run this code
# NOT RUN {
## Generate samples for three different shapes
d1 = aux.gensamples(dname="twinpeaks",noise=0.01)
d2 = aux.gensamples(dname="ribbon",noise=0.01)
d3 = aux.gensamples(dname="crown", noise=0.01)

# }
# NOT RUN {
casenames = c("swiss","crown","helix","saddle","ribbon","bswiss","cswiss","twinpeaks")
for (i in 1:length(casenames)){
  data = aux.gensamples(n=sample(1000:2000,1),noise=runif(1)[1],dname=casenames[i])
}
# }

Run the code above in your browser using DataLab