SEA#
- class capymoa.stream.generator.SEA[source]#
Bases:
MOAStream
Generates SEA concepts functions.
>>> from capymoa.stream.generator import SEA ... >>> stream = SEA() >>> stream.next_instance() LabeledInstance( Schema(generators.SEAGenerator ), x=[7.309 4.101 2.077], y_index=1, y_label='groupB' ) >>> stream.next_instance().x array([6.58867239, 7.10739628, 1.52736201])
Street, W. N., & Kim, Y. (2001). A streaming ensemble algorithm (SEA) for large-scale classification. doi:10.1145/502512.502568
- __init__(
- instance_random_seed: int = 1,
- function: int = 1,
- balance_classes: bool = False,
- noise_percentage: int = 10,
Construct a SEA datastream generator.
- Parameters:
instance_random_seed – Seed for random generation of instances, defaults to 1
function – Classification function used, as defined in the original paper, defaults to 1
balance_classes – Balance the number of instances of each class, defaults to False
noise_percentage – Percentage of noise to add to the data, defaults to 10
- __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.