pysad.transform.preprocessing.InstanceUnitNormScaler¶
- class pysad.transform.preprocessing.InstanceUnitNormScaler(pow=2)[source]¶
A scaler that makes the instance feature vector’s norm equal to 1, i.e., the unit vector.
- Parameters:
pow (float) – The power, for which the norm is calculated. pow=2 is equivalent to the euclidean distance.
Methods
__init__
([pow])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 scaler.
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.
Scales particular (next) timestep's vector.
- 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 scaler.
- Parameters:
X (np.float64 array of shape (num_features,)) – 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)