NumpyStream#
- class capymoa.stream.NumpyStream[source]#
Bases:
Stream
A datastream originating from a numpy array.
- __init__(
- X: ndarray,
- y: ndarray,
- dataset_name='No_Name',
- feature_names=None,
- target_name=None,
- target_type: str = None,
Construct a NumpyStream object from a numpy array.
- Parameters:
X – Numpy array of shape (n_samples, n_features) with the feature values
y – Numpy array of shape (n_samples,) with the target values
dataset_name – The name to give to the datastream, defaults to “No_Name”
feature_names – The names given to the features, defaults to None
target_name – The name given to target values, defaults to None
target_type – ‘categorical’ or ‘numeric’ target, defaults to None
- 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.