View source: R/animate_cluster.R
animate_cluster | R Documentation |
Generates an animation of a data stream clustering process.
animate_cluster(
dsc,
dsd,
measure = NULL,
horizon = 100,
n = 1000,
type = c("auto", "micro", "macro"),
assign = "micro",
assignmentMethod = c("auto", "model", "nn"),
excludeNoise = FALSE,
wait = 0.1,
plot.args = NULL,
...
)
dsc |
a DSC |
dsd |
a DSD |
measure |
the evaluation measure that should be graphed below the
animation (see |
horizon |
the number of points displayed at once/used for evaluation. |
n |
the number of points to be plotted |
type , assign , assignmentMethod , excludeNoise |
are passed on to |
wait |
the time interval between each frame |
plot.args |
a list with plotting parameters for the clusters. |
... |
extra arguments are added to |
Animations are recorded using the library animation and can be replayed (which gives a smoother experience since the is no more computation done) and saved in various formats (see Examples section below).
Note: You need to install package animation and its system requirements.
Michael Hahsler
animation::ani.replay()
for replaying and saving animations.
Other DSC:
DSC()
,
DSC_Macro()
,
DSC_Micro()
,
DSC_R()
,
DSC_SlidingWindow()
,
DSC_Static()
,
DSC_TwoStage()
,
evaluate.DSC
,
get_assignment()
,
plot.DSC()
,
predict()
,
prune_clusters()
,
read_saveDSC
,
recluster()
Other plot:
animate_data()
,
plot.DSC()
,
plot.DSD()
Other evaluation:
evaluate
,
evaluate.DSC
if (interactive()) {
stream <- DSD_Benchmark(1)
### animate the clustering process with evaluation
### Note: we choose to exclude noise points from the evaluation
### measure calculation, even if the algorithm would assign
### them to a cluster.
dbstream <- DSC_DBSTREAM(r = .04, lambda = .1, gaptime = 100, Cm = 3,
shared_density = TRUE, alpha = .2)
animate_cluster(dbstream, stream, horizon = 100, n = 5000,
measure = "crand", type = "macro", assign = "micro",
plot.args = list(xlim = c(0, 1), ylim = c(0, 1), shared = TRUE))
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.