WaveformGenerator#
- class capymoa.stream.generator.WaveformGenerator[source]#
Bases:
MOAStream
An Waveform Generator
>>> from capymoa.stream.generator import WaveformGenerator ... >>> stream = WaveformGenerator() >>> stream.next_instance() LabeledInstance( Schema(generators.WaveformGenerator ), x=[-0.092 -0.362 1.163 ... 2.825 0.765 -0.187], y_index=0, y_label='class1' ) >>> stream.next_instance().x array([-0.35222814, -0.65631772, 1.66984311, 1.3552564 , 1.95122954, 3.34644007, 4.75457662, 2.72801084, 3.40907743, 2.41282297, 3.34658027, 2.42282518, 2.08432716, 0.78783527, 0.94201874, 0.75833533, -0.82178614, -1.23317608, -0.52710197, -0.44639196, -2.026593 ])
- __init__(instance_random_seed: int = 1, noise: bool = False)[source]#
Construct a WaveForm Generator .
- Parameters:
instance_random_seed – Seed for random generation of instances, defaults to 1
noise – Adds noise for a total of 40 attributes
- __iter__() Iterator[_AnyInstance] [source]#
Get an iterator over the stream.
This will NOT restart the stream if it has already been iterated over. Please use the
restart()
method to restart the stream.- Yield:
An iterator over the stream.
- __next__() _AnyInstance [source]#
Get the next instance in the stream.
- Returns:
The next instance in the stream.