SEA#
- class capymoa.stream.generator.SEA[source]#
Bases:
Stream
Generates SEA concepts functions.
>>> from capymoa.stream.generator import SEA ... >>> stream = SEA() >>> stream.next_instance() LabeledInstance( Schema(generators.SEAGenerator ), x=ndarray(..., 3), 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
- next_instance() LabeledInstance | RegressionInstance [source]#
Return the next instance in the stream.
- Raises:
ValueError – If the machine learning task is neither a regression nor a classification task.
- Returns:
A labeled instances or a regression depending on the schema.