stream <- DSD_Gaussians(k = 3, d = 2) %>% DSD_Memory(n = 500)
## init evoStream
evoStream <- DSC_evoStream(r = 0.05, k = 3,
incrementalGenerations = 1, reclusterGenerations = 500)
## insert observations
update(evoStream, stream, n = 500)
## micro clusters
get_centers(evoStream, type = "micro")
## micro weights
get_weights(evoStream, type = "micro")
## macro clusters
get_centers(evoStream, type = "macro")
## macro weights
get_weights(evoStream, type = "macro")
## plot result
reset_stream(stream)
plot(evoStream, stream)
## if we have time, then we can evaluate additional generations.
## This can be called at any time, also between observations.
## by default, 1 generation is evaluated after each observation and
## 1000 generations during reclustering but we set it here to 500
evoStream$RObj$recluster(500)
## plot improved result
reset_stream(stream)
plot(evoStream, stream)
## get assignment of micro to macro clusters
microToMacro(evoStream)
Run the code above in your browser using DataLab