DSD: Data Stream Data Generator Base Classes

Description Details Author(s) See Also Examples

View source: R/DSD.R

Description

Abstract base classes for DSD (Data Stream Data Generator).

Details

The DSD class cannot be instantiated, but it serves as a abstract base class from which all DSD objects inherit.

DSD_R inherits form DSD and is the abstract parent class for DSD implemented in R. To create a new R-based implementation there are only two function that needs to be implemented for a new DSD subclass: A creator function (the name should start with DSD_) and a method get_points() for that class.

DSD provides common functionality like print(), plot(), etc.

Note that calling DSD() or DSD_R() results in an error since both are abstract classes.

Author(s)

Michael Hahsler

See Also

animate_data, animate_cluster, cluster, evaluate, get_points, plot, recluster, write_stream

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
# create data stream with three clusters in 3-dimensional space 
stream <- DSD_Gaussians(k=3, d=3)

# get points from stream
get_points(stream, n=5)  

# get points with true cluster assignment
p <- get_points(stream, n=5, cluster=TRUE)
attr(p, "cluster")
  
# plotting the data (scatter plot matrix, first and third dimension, and first
#  two principal components)
plot(stream)
plot(stream, dim=c(1,3))
plot(stream, method="pc")

Example output

Loading required package: proxy

Attaching package: 'proxy'

The following objects are masked from 'package:stats':

    as.dist, dist

The following object is masked from 'package:base':

    as.matrix

         X1        X2        X3
1 0.6082063 0.6535752 0.3584076
2 0.3196549 0.2859973 0.3875545
3 0.2661007 0.1507141 0.4854989
4 0.4951464 0.2220155 0.8257632
5 0.4497468 0.3071433 0.8819891
[1] 2 2 3 3 2

stream documentation built on May 29, 2017, 9:29 a.m.