### wrap 1000 points from a dsd
dsd <- DSD_Gaussians(k=3, d=2)
replayer <- DSD_Wrapper(dsd, k=3, n=1000)
replayer
plot(replayer)
# creating 2 clusterers of different algorithms
dsc1 <- DSC_tNN(r=0.1)
dsc2 <- DSC_DStream(gridsize=0.1)
# clustering the same data in 2 DSC objects
reset_stream(replayer) # resetting the replayer to the first position
cluster(dsc1, replayer, 500)
reset_stream(replayer)
cluster(dsc2, replayer, 500)
# plot the resulting clusterings
reset_stream(replayer)
plot(dsc1, replayer, main="tNN")
reset_stream(replayer)
plot(dsc2, replayer, main="D-Stream")
### use a data.frame to create a stream (3rd col. contains the assignment)
df <- data.frame(x=runif(100), y=runif(100),
assignment=sample(1:3, 100, replace=TRUE))
head(df)
dsd <- DSD_Wrapper(df, assignment=3)
dsd
plot(dsd, n=100)
Run the code above in your browser using DataLab