CSVStream#

class capymoa.stream.CSVStream[source]#

Bases: Stream[_AnyInstance]

__init__(
csv_file_path,
dtypes: list = None,
values_for_nominal_features={},
class_index: int = -1,
values_for_class_label: list = None,
target_attribute_name=None,
target_type: str = None,
skip_header: bool = False,
delimiter=',',
dataset_name: str | None = None,
)[source]#
count_number_of_lines()[source]#
has_more_instances()[source]#

Return True if the stream have more instances to read.

next_instance() _AnyInstance[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.

get_schema()[source]#

Return the schema of the stream.

get_moa_stream()[source]#

Get the MOA stream object if it exists.

restart()[source]#

Restart the stream to read instances from the beginning.

CLI_help() str[source]#

Return a help message

__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.