stream <- DSD_Gaussians(k = 3, d = 2, noise = 0.05)
sample <- DSC_Sample(k = 20)
update(sample, stream, 500)
sample
# plot micro-clusters
plot(sample, stream)
# recluster the sample with k-means
kmeans <- DSC_Kmeans(k = 3)
recluster(kmeans, sample)
plot(kmeans, stream)
# sample from an evolving stream
stream <- DSD_Benchmark(1)
sample <- DSC_Sample(k = 20)
update(sample, stream, 1000)
plot(sample, stream)
# Note: the clusters move from left to right and the sample keeps many
# outdated points
# use a biased sample to keep more recent data points
stream <- DSD_Benchmark(1)
sample <- DSC_Sample(k = 20, biased = TRUE)
update(sample, stream, 1000)
plot(sample, stream)
Run the code above in your browser using DataLab