stream <- DSD_Memory(DSD_Gaussians(k = 3, d = 2), 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)
## plot resut
reset_stream(stream)
plot(two, stream, type="both")
## if we have time, evaluate additional generations. This can be
## called at any time, also between observations.
two$macro_dsc$RObj$recluster(100)
## plot improved result
reset_stream(stream)
plot(two, stream, type="both")
## 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