Learn R Programming

stream (version 2.0-1)

DSD_Mixture: Mixes Data Points from Several Streams into a Single Stream

Description

This generator mixes multiple streams given specified probabilities. The streams have to contain the same number of dimensions.

Usage

DSD_Mixture(..., prob = NULL)

Value

Returns a DSD_Mixture object.(subclass of DSD_R, DSD).

Arguments

...

DSD objects.

prob

a numeric vector with the probability for each stream that the next point will be drawn from that stream.

Author

Michael Hahsler

See Also

Other DSD: DSD_BarsAndGaussians(), DSD_Benchmark(), DSD_Cubes(), DSD_Gaussians(), DSD_MG(), DSD_Memory(), DSD_NULL(), DSD_ReadDB(), DSD_ReadStream(), DSD_Target(), DSD_UniformNoise(), DSD_mlbenchData(), DSD_mlbenchGenerator(), DSD(), DSF(), animate_data(), close_stream(), get_points(), plot.DSD(), reset_stream()

Examples

Run this code
# create data stream with three clusters in 2D
stream1 <- DSD_Gaussians(d = 2, k = 3)
stream2 <- DSD_UniformNoise(d = 2,  range = rbind(c(-.5, 1.5), c(-.5, 1.5)))

combinedStream <- DSD_Mixture(stream1, stream2, prob = c(.9, .1))
combinedStream

get_points(combinedStream, n = 20)
plot(combinedStream, n = 200)

Run the code above in your browser using DataLab