Learn R Programming

stream (version 0.1-1)

animation: Animates the plotting of a DSD and the clustering process

Description

Generates an animation of a data stream or a data steam clustering.

Usage

animate_data(dsd, n=1000, interval=.1, 
    pointInterval=100, horizon=5*pointInterval, 
    outdir=NULL,...)
animate_cluster(dsc, dsd, macro=NULL, n=1000, interval=.1, 
    pointInterval=100, horizon=5*pointInterval, 
    evaluationMethod=NULL, outdir=NULL,...)

Arguments

dsd
a DSD object
dsc
a DSC object
macro
a DSC_macro object used for reclustering when performing evaluations.
n
the number of points to be plotted
interval
the time interval between each frame
pointInterval
the number of new points needed before a new frame is created
horizon
the max number of data points to be shown at a time
evaluationMethod
the evaluation method that should be graphed below the animation
outdir
the location of where the animation (animated gif) should be saved
...
extra arguments for plot.

Details

It generates several plots and strings them together to form an animation. This is particularly useful to see the behavior of moving data sets. If no outdir is specified the function will animate the progress while clustering.

See Also

evaluate_cluster for stream evaluation without animation.

Examples

Run this code
dsd <- DSD_GaussianMoving()
animate_data(dsd, 500,  xlim=c(-.2,1.2), ylim=c(-.2,1.2), 
    pointInterval=20)

reset_stream(dsd)
dsc <- DSC_tNN(.1, alpha=.2, lambda=.03, decay_interval=1, minweight=.1)

### Note: type is a parameter passed on to plot (for DSC)
reset_stream(dsd)
animate_cluster(dsc, dsd, n=500, interval=.01,
       pointInterval=10, xlim=c(-.5,1.5),ylim=c(-.5,1.5), 
       type="macro")

reset_stream(dsd)
animate_cluster(dsc, dsd, n=600, interval=.01,
       pointInterval=20, xlim=c(-.5,1.5),ylim=c(-.5,1.5), 
       type="macro", eval="crand")

Run the code above in your browser using DataLab