dsd <- DSD_Gaussians(k=3, noise=0.05)
dsc <- DSC_Sample(k=20)
cluster(dsc, dsd, 500)
dsc
# plot micro-clusters
plot(dsc, dsd)
# reclustering (Kmeans is sufficient because DSC_Sample does not return weights)
kmeans <- DSC_Kmeans(3)
recluster(kmeans,dsc)
plot(kmeans, dsd, type="both")
# sample from an evolving stream
dsd <- DSD_Benchmark(1)
dsc <- DSC_Sample(k=100)
cluster(dsc, dsd, 2000)
plot(dsc, dsd)
# 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
dsd <- DSD_Benchmark(1)
dsc <- DSC_Sample(k=100, biased=TRUE)
cluster(dsc, dsd, 2000)
plot(dsc, dsd)
Run the code above in your browser using DataLab