skika.data.stream_generator#
Classes
|
Generates a stream with recurrent concept drifts. |
- class skika.data.stream_generator.RecurrentDriftStream(generator='agrawal', stable_period=3000, position=3000, concepts=[4, 0, 8], width=1, lam=1.0, has_noise=False, all_concepts=[4, 0, 8, 6, 2, 1, 3, 5, 7, 9], concept_shift_step=- 1, concept_shift_sample_intervals=[200000, 250000, 300000], stable_period_lam=- 1, stable_period_start=1000, stable_period_base=200, stable_period_logger=None, random_state=0)#
Generates a stream with recurrent concept drifts.
- Parameters
generator – a stream generator
- property feature_names#
Retrieve the names of the features.
- Returns
names of the features
- Return type
list
- get_data_info()#
Retrieves minimum information from the stream
Used by evaluator methods to id the stream.
The default format is: ‘Stream name - n_targets, n_classes, n_features’.
- Returns
Stream data information
- Return type
string
- get_info()#
Collects and returns the information about the configuration of the estimator
- Returns
Configuration of the estimator.
- Return type
string
- get_params(deep=True)#
Get parameters for this estimator.
- Parameters
deep (boolean, optional) – If True, will return the parameters for this estimator and contained subobjects that are estimators.
- Returns
params – Parameter names mapped to their values.
- Return type
mapping of string to any
- has_more_samples()#
Checks if stream has more samples.
- Returns
True if stream has more samples.
- Return type
Boolean
- is_restartable()#
Determine if the stream is restartable. :returns: True if stream is restartable. :rtype: Boolean
- last_sample()#
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
- property n_cat_features#
Retrieve the number of integer features.
- Returns
The number of integer features in the stream.
- Return type
int
- property n_features#
Retrieve the number of features.
- Returns
The total number of features.
- Return type
int
- property n_num_features#
Retrieve the number of numerical features.
- Returns
The number of numerical features in the stream.
- Return type
int
- n_remaining_samples()#
Returns the estimated number of remaining samples.
- Returns
Remaining number of samples. -1 if infinite (e.g. generator)
- Return type
int
- property n_targets#
Retrieve the number of targets
- Returns
the number of targets in the stream.
- Return type
int
- next_sample(batch_size=1)#
Returns the next batch_size samples.
- Parameters
batch_size (int) – The number of samples to return.
- Returns
Return a tuple with the features matrix for the batch_size samples that were requested.
- Return type
tuple or tuple list
- prepare_for_use()#
Prepares the stream for use.
Notes
This functions should always be called after the stream initialization.
- reset()#
Resets the estimator to its initial state.
- Return type
self
- restart()#
Restart the stream.
- set_params(**params)#
Set the parameters of this estimator.
The method works on simple estimators as well as on nested objects (such as pipelines). The latter have parameters of the form
<component>__<parameter>
so that it’s possible to update each component of a nested object.- Return type
self
- property target_names#
Retrieve the names of the targets
- Returns
the names of the targets in the stream.
- Return type
list
- property 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