# Example 1: create data stream with three clusters in 3-dimensional data space
# with 5 times sqrt(variance_limit) separation.
set.seed(1)
stream1 <- DSD_Gaussians(k = 3, d = 3)
stream1
get_points(stream1, n = 5)
plot(stream1, xlim = c(0, 1), ylim = c(0, 1))
# Example 2: create data stream with specified cluster positions,
# 5% noise in a given bounding box and
# with different densities (1 to 9 between the two clusters)
stream2 <- DSD_Gaussians(k = 2, d = 2,
mu = rbind(c(-.5, -.5), c(.5, .5)),
p = c(.1, .9),
variance_limit = c(0.02, 0.04),
noise = 0.05,
noise_limit = rbind(c(-1, 1), c(-1, 1)))
get_points(stream2, n = 5)
plot(stream2, xlim = c(-1, 1), ylim = c(-1, 1))
# Example 3: create 4 clusters and noise separated by a Mahalanobis
# distance. Distance to noise is increased to 6 standard deviations to make them
# easier detectable outliers.
stream3 <- DSD_Gaussians(k = 4, d = 2,
separation_type = "Mahalanobis",
space_limit = c(5, 20),
variance_limit = c(1, 2),
noise = 0.05,
noise_limit = c(0, 25),
noise_separation = 6
)
plot(stream3)
Run the code above in your browser using DataLab