10D Random Instances

Ver. 1.0.0 (2022-12-13)

This module provides the native stream class StreamMLProRnd10D. This stream provides 1000 instances with 10-dimensional random feature data and 2-dimensional random label data.

class mlpro.bf.streams.streams.rnd10d.StreamMLProRnd10D(p_logging=True, **p_kwargs)

Bases: StreamMLProBase

Demo stream consisting of 1000 instances with 10-dimensional random feature data and 2-dimensional label data. All values are in range defined by attribute C_BOUNDARIES.

C_NUM_INSTANCES = 1000

Number of instances.

C_BOUNDARIES    = [-10,10]

Boundaries for all random values.

C_ID = 'Rnd10Dx1000'
C_NAME = 'Random 10D x 1000'
C_VERSION = '1.0.0'
C_NUM_INSTANCES = 1000
C_SCIREF_ABSTRACT = 'Demo stream of 1000 instances with 10-dimensional random feature data and 2-dimensional label data.'
C_BOUNDARIES = [-10, 10]
_setup_feature_space() MSpace

Custom method to set up the feature space of the stream. It is called by method get_feature_space().

Returns:

feature_space – Feature space of the stream.

Return type:

MSpace

_setup_label_space() MSpace

Custom method to set up the label space of the stream. It is called by method get_label_space().

Returns:

label_space – Label space of the stream.

Return type:

MSpace

_init_dataset()

Custom method to generate stream data as a numpy array named self._dataset.

set_random_seed(p_seed=None)

Resets the internal random generator using the given seed.

_get_next() Instance

Custom method to determine the next data stream instance. At the end of the stream exception StopIteration is to be raised. See method __next__() for more details.

Returns:

instance – Next instance of data stream or None.

Return type:

Instance