DSF()
# Example 1: Use as a DSD adapter
stream <- DSD_Gaussians(k = 3, d = 2) %>%
DSF_Func(func = function(x) cbind(x, Xsum = x$X1 + x$X2))
stream
get_points(stream, n = 5)
# Example 2: Use as a stream transformer
trans <- DSF_Func(func = function(x) cbind(x, Xsum = x$X1 + x$X2))
trans
update(trans, stream, n = 5)
# Example 3: Use as a DST preprocessor
clusterer <- DSF_Func(func = function(x) cbind(x, X1_squared = x$X1^2)) %>%
DST_Runner(DSC_Kmeans(k = 3))
clusterer
update(clusterer, stream, n = 100)
# Example 5: Specify a complete pipeline DSD -> DSF -> DST
pipeline <- DSD_Gaussians(k = 3, d = 2) %>%
DSF_Func(func = function(x) cbind(x, X1_squared = x$X1^2)) %>%
DST_Runner(DSC_Kmeans(k = 3))
pipeline
update(pipeline, n = 100)
plot(pipeline$dst)
Run the code above in your browser using DataLab