Learn R Programming

stream (version 2.0-1)

DSC_TwoStage: TwoStage Clustering Process

Description

Combines an online clustering component (DSC_Micro) and an offline reclustering component (DSC_Macro) into a single process.

Usage

DSC_TwoStage(micro, macro)

Value

An object of class DSC_TwoStage (subclass of DSC, DSC_Macro) which is a named list with elements:

  • description: a description of the clustering algorithms.

  • micro: The DSD used for creating micro clusters in the online component.

  • macro: The DSD for offline reclustering.

  • state: an environment storing state information needed for reclustering.

with the two clusterers. The names are ``

Arguments

micro

Clustering algorithm used in the online stage (DSC_Micro)

macro

Clustering algorithm used for reclustering in the offline stage (DSC_Macro)

Author

Michael Hahsler

Details

update() runs the online micro-clustering stage and only when macro cluster centers/weights are requested using get_centers() or get_weights(), then the offline stage reclustering is automatically performed.

Available clustering methods can be found in the See Also section below.

See Also

Other DSC_TwoStage: DSC_DBSTREAM(), DSC_DStream(), DSC_evoStream()

Other DSC: DSC_Macro(), DSC_Micro(), DSC_R(), DSC_SlidingWindow(), DSC_Static(), DSC(), animate_cluster(), evaluate.DSC, get_assignment(), plot.DSC(), predict(), prune_clusters(), read_saveDSC, recluster()

Examples

Run this code
stream <- DSD_Gaussians(k = 3, d = 2)

# Create a clustering process that uses a window for the online stage and
# k-means for the offline stage (reclustering)
win_km <- DSC_TwoStage(
  micro = DSC_Window(horizon = 100),
  macro = DSC_Kmeans(k = 3)
  )
win_km

update(win_km, stream, 200)
win_km
win_km$micro
win_km$macro

plot(win_km, stream)
evaluate_static(win_km, stream, assign = "macro")

Run the code above in your browser using DataLab