RecurrentConceptDriftStream#

class capymoa.stream.drift.RecurrentConceptDriftStream[source]#

Bases: DriftStream

CLI_help() str[source]#

Return cli help string for the stream.

get_drifts()[source]#
get_moa_stream() InstanceStream | None[source]#

Get the MOA stream object if it exists.

get_num_drifts()[source]#
get_schema() Schema[source]#

Return the schema of the stream.

has_more_instances() bool[source]#

Return True if the stream have more instances to read.

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.

restart()[source]#

Restart the stream to read instances from the beginning.

__init__(
concept_list: list,
max_recurrences_per_concept: int = 3,
transition_type_template: ~capymoa.stream.drift.Drift = <capymoa.stream.drift.AbruptDrift object>,
concept_name_list: list = None,
)[source]#

Initialize the stream with the specified parameters.

Parameters:
  • schema – The schema that defines the structure of the stream. Default is None.

  • CLI – Command Line Interface string used to define the stream configuration for the MOA (Massive Online Analysis) framework. Default is None.

  • moa_stream – A pre-configured ConceptDriftStream object from MOA. If specified, the stream will be instantiated directly using this object. This is useful for integrating with MOA-based streams. Default is None.

  • stream – A list that defines a composite stream consisting of various concepts and drifts. If this is set, the ConceptDriftStream object will be built according to the list of concepts and drifts specified. Default is None.

Notes:#

  • If moa_stream is specified, it takes precedence, and the stream will be instantiated directly from the provided ConceptDriftStream object.

  • The CLI and moa_stream parameters allow users to specify the stream using a ConceptDriftStream from MOA alongside its CLI. This provides flexibility for users familiar with MOA’s configuration style.

  • In the future, we might remove the functionality associated with CLI and moa_stream to simplify the code, focusing on other methods of stream configuration.