skmultiflow.data.
HyperplaneGenerator
Hyperplane stream generator.
Generates a problem of prediction class of a rotation hyperplane. It was used as testbed for CVFDT and VFDT in [1].
A hyperplane in d-dimensional space is the set of points \(x\) that satisfy \(\sum^{d}_{i=1} w_i x_i = w_0 = \sum^{d}_{i=1} w_i\), where \(x_i\) is the ith coordinate of \(x\). Examples for which \(\sum^{d}_{i=1} w_i x_i > w_0\), are labeled positive, and examples for which \(\sum^{d}_{i=1} w_i x_i \leq w_0\), are labeled negative.
Hyperplanes are useful for simulating time-changing concepts, because we can change the orientation and position of the hyperplane in a smooth manner by changing the relative size of the weights. We introduce change to this dataset by adding drift to each weight feature \(w_i = w_i + d \sigma\), where \(\sigma\) is the probability that the direction of change is reversed and \(d\) is the change applied to every example.
If int, random_state is the seed used by the random number generator; If RandomState instance, random_state is the random number generator; If None, the random number generator is the RandomState instance used by np.random.
The number of attributes to generate. Higher than 2.
The number of attributes with drift. Higher than 2.
Magnitude of the change for every example. From 0.0 to 1.0.
Percentage of noise to add to the data. From 0.0 to 1.0.
Percentage of probability that the direction of change is reversed. From 0.0 to 1.0.
References
G. Hulten, L. Spencer, and P. Domingos. Mining time-changing data streams. In KDD’01, pages 97–106, San Francisco, CA, 2001. ACM Press.
Methods
get_data_info(self)
get_data_info
Retrieves minimum information from the stream
get_info(self)
get_info
Collects and returns the information about the configuration of the estimator
get_params(self[, deep])
get_params
Get parameters for this estimator.
has_more_samples(self)
has_more_samples
Checks if stream has more samples.
is_restartable(self)
is_restartable
Determine if the stream is restartable.
last_sample(self)
last_sample
Retrieves last batch_size samples in the stream.
n_remaining_samples(self)
n_remaining_samples
Returns the estimated number of remaining samples.
next_sample(self[, batch_size])
next_sample
Returns next sample from the stream.
prepare_for_use()
prepare_for_use
Prepare the stream for use.
reset(self)
reset
Resets the estimator to its initial state.
restart(self)
restart
Restart the stream.
set_params(self, **params)
set_params
Set the parameters of this estimator.
Attributes
feature_names
Retrieve the names of the features.
mag_change
Retrieve the value of the value of magnitude of change.
n_cat_features
Retrieve the number of integer features.
n_drift_features
Retrieve the number of drift features.
n_features
Retrieve the number of features.
n_num_features
Retrieve the number of numerical features.
n_targets
Retrieve the number of targets
noise_percentage
Retrieve the value of the value of Noise percentage
sigma_percentage
Retrieve the value of the value of sigma percentage
target_names
Retrieve the names of the targets
target_values
Retrieve all target_values in the stream for each target.
names of the features
Used by evaluator methods to id the stream.
The default format is: ‘Stream name - n_targets, n_classes, n_features’.
Stream data information
Configuration of the estimator.
If True, will return the parameters for this estimator and contained subobjects that are estimators.
Parameter names mapped to their values.
True if stream has more samples.
True if stream is restartable.
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.
magnitude of change
The number of integer features in the stream.
The total number of drift features.
The total number of features.
The number of numerical features in the stream.
Remaining number of samples. -1 if infinite (e.g. generator)
the number of targets in the stream.
The sample generation works as follows: The features are generated with the random generator, initialized with the seed passed by the user. Then the classification function decides, as a function of the sum and weight’s sum, whether to instance belongs to class 0 or class 1. The next step is to add noise if requested by the user and than generate drift.
The number of samples to return.
Return a tuple with the features matrix and the labels matrix for the batch_size samples that were requested.
percentage of the noise
Deprecated in v0.5.0 and will be removed in v0.7.0
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.
<component>__<parameter>
percentage of the sigma
the names of the targets in the stream.
list of lists of all target_values for each target