STAGGERGenerator#
- class capymoa.stream.generator.STAGGERGenerator[source]#
Bases:
MOAStream
An STAGGER Generator
>>> from capymoa.stream.generator import STAGGERGenerator ... >>> stream = STAGGERGenerator() >>> stream.next_instance() LabeledInstance( Schema(generators.STAGGERGenerator ), x=[0. 1. 1.], y_index=0, y_label='false' ) >>> stream.next_instance().x array([0., 2., 1.])
- __init__(
- instance_random_seed: int = 1,
- classification_function: int = 1,
- balance_classes: bool = False,
Construct a STAGGER Generator .
- Parameters:
instance_random_seed – Seed for random generation of instances, defaults to 1
classification_function – Classification function used, as defined in the original paper.
balance – Balance the number of instances of each class.
- __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.