skmultiflow.data.base_stream

Classes

Stream()

The abstract class setting up the minimum requirements of a stream, so that it can work along the other modules in the scikit-multiflow framework.

class skmultiflow.data.base_stream.Stream[source][source]

The abstract class setting up the minimum requirements of a stream, so that it can work along the other modules in the scikit-multiflow framework.

Raises

NotImplementedError – This is an abstract class.:

feature_names

Retrieve the names of the features.

Returns

names of the features

Return type

list

get_class_type()[source][source]

The class type is a string that identifies the type of object generated by that module.

Returns

Return type

The class type

get_data_info()[source][source]

get_name

Gets the name of the plot, which is a string that will appear in evaluation methods, to represent the stream.

The default format is: ‘Stream name - x labels’.

Returns

A string representing the plot name.

Return type

string

get_info()[source]

A sum-up of all important characteristics of a class.

The default format of the return string is as follows: ClassName: attribute_one: value_one - attribute_two: value_two - info_one: info_one_value

Returns

  • string

  • A string with the class’ relevant information.

has_more_samples()[source][source]

Checks if stream has more samples.

Returns

True if stream has more samples.

Return type

Boolean

is_restartable()[source][source]

Determine if the stream is restartable. :returns: True if stream is restartable. :rtype: Boolean

last_sample()[source][source]

Retrieves last batch_size samples in the stream.

Returns

A numpy.ndarray of shape (batch_size, n_features) and an array-like of shape (batch_size, n_targets), representing the next batch_size samples.

Return type

tuple or tuple list

n_cat_features

Retrieve the number of integer features.

Returns

The number of integer features in the stream.

Return type

int

n_features

Retrieve the number of features.

Returns

The total number of features.

Return type

int

n_num_features

Retrieve the number of numerical features.

Returns

The number of numerical features in the stream.

Return type

int

n_remaining_samples()[source][source]

Returns the estimated number of remaining samples.

Returns

Remaining number of samples. -1 if infinite (e.g. generator)

Return type

int

n_targets

Retrieve the number of targets

Returns

the number of targets in the stream.

Return type

int

next_sample(batch_size=1)[source][source]

Generates or returns next batch_size samples in the stream.

Parameters

batch_size (int) – How many samples at a time to return.

Returns

A numpy.ndarray of shape (batch_size, n_features) and an array-like of size n_targets, representing the next batch_size samples.

Return type

tuple or tuple list

prepare_for_use()[source][source]

Prepare the stream for use. Can be the reading of a file, or the generation of a function, or anything necessary for the stream to work after its initialization.

Notes

Every time a stream is created this function has to be called.

random_state

Retrieve the random state of the stream.

Returns

Return type

RandomState

restart()[source][source]

Restart the stream.

target_names

Retrieve the names of the targets

Returns

the names of the targets in the stream.

Return type

list

target_values

Retrieve all target_values in the stream for each target.

Returns

list of lists of all target_values for each target

Return type

list