DSC()
set.seed(1000)
stream <- DSD_Gaussians(k = 3, d = 2, noise = 0.05)
dstream <- DSC_DStream(gridsize = .1, gaptime = 100)
update(dstream, stream, 500)
dstream
# get micro-cluster centers
get_centers(dstream)
# get the micro-cluster weights
get_weights(dstream)
# get the number of clusters
nclusters(dstream)
# get the whole model as a data.frame
get_model(dstream)
# D-Stream also has macro-clusters
get_weights(dstream, type = "macro")
get_centers(dstream, type = "macro")
# plot the clustering result
plot(dstream, stream)
plot(dstream, stream, type = "both")
# predict macro clusters for new points (see predict())
points <- get_points(stream, n = 5)
points
predict(dstream, points, type = "macro")
Run the code above in your browser using DataLab