pysad.transform.projection.StreamhashProjector¶
- class pysad.transform.projection.StreamhashProjector(num_components, density=0.3333333333333333)[source]¶
Streamhash projection method from Manzoor et. al.that is similar (or equivalent) to SparseRandomProjection. [BMLA18] The implementation is taken from the cmuxstream-core repository.
- Parameters:
Methods
__init__
(num_components[, density])fit
(X)Shortcut method that iteratively applies fit_partial to all instances in order.
fit_partial
(X)Fits particular (next) timestep's features to train the projector.
Shortcut method that iteratively applies fit_transform_partial to all instances in order.
Shortcut method that iteratively applies fit_partial and transform_partial, respectively.
transform
(X)Shortcut method that iteratively applies transform_partial to all instances in order.
Projects particular (next) timestep's vector to (possibly) lower dimensional space.
- fit(X)¶
Shortcut method that iteratively applies fit_partial to all instances in order.
- Parameters:
X (np.float64 array of shape (num_instances, num_features)) – Input feature vectors.
- Returns:
The fitted transformer
- Return type:
- fit_partial(X)[source]¶
Fits particular (next) timestep’s features to train the projector.
- Parameters:
X (np.float64 array of shape (n_components,)) – Input feature vector.
- Returns:
self.
- Return type:
- fit_transform(X)¶
Shortcut method that iteratively applies fit_transform_partial to all instances in order.
- Parameters:
X (np.float64 array of shape (num_instances, num_components)) – Input feature vectors.
- Returns:
Projected feature vectors.
- Return type:
np.float64 array of shape (num_instances, num_components)
- fit_transform_partial(X)¶
Shortcut method that iteratively applies fit_partial and transform_partial, respectively.
- Parameters:
X (np.float64 array of shape (num_components,)) – Input feature vector.
- Returns:
Projected feature vector.
- Return type:
transformed_X (np.float64 array of shape (num_components,))
- transform(X)¶
Shortcut method that iteratively applies transform_partial to all instances in order.
- Parameters:
X (np.float64 array of shape (num_instances, num_features)) – Input feature vectors.
- Returns:
Projected feature vectors.
- Return type:
np.float64 array of shape (num_instances, num_components)
- transform_partial(X)[source]¶
Projects particular (next) timestep’s vector to (possibly) lower dimensional space.
- Parameters:
X (np.float64 array of shape (num_features,)) – Input feature vector.
- Returns:
Projected feature vector.
- Return type:
projected_X (np.float64 array of shape (num_components,))