stream <- DSD_Gaussians(k = 3, d = 2) %>% DSD_Memory(n = 1000)
## online algorithm
dbstream <- DSC_DBSTREAM(r = 0.1)
## offline algorithm (note: we use a small number of generations
## to make this run faster.)
EA <- DSC_EA(k = 3, generations = 100)
## create pipeline and insert observations
two <- DSC_TwoStage(dbstream, EA)
update(two, stream, n = 1000)
two
## plot result
reset_stream(stream)
plot(two, stream)
## if we have time, evaluate additional generations. This can be
## called at any time, also between observations.
two$macro$RObj$recluster(100)
## plot improved result
reset_stream(stream)
plot(two, stream)
## alternatively: do not create twostage but apply directly
reset_stream(stream)
update(dbstream, stream, n = 1000)
recluster(EA, dbstream)
reset_stream(stream)
plot(EA, stream)
Run the code above in your browser using DataLab