Quantization¶
The documentation of the quantization module.
The pyts.quantization
module includes quantization algorithms.
-
class
pyts.quantization.
SAX
(n_bins=4, quantiles=u'gaussian')[source]¶ Symbolic Aggregate approXimation.
Parameters: - n_bins : int (default = 4)
Number of bins (also known as the size of the alphabet).
- quantiles : {‘gaussian’, ‘empirical’} (default = ‘gaussian’)
The way to compute quantiles. If ‘gaussian’, quantiles from a gaussian distribution N(0,1) are used. If ‘empirical’, empirical quantiles are used.
Methods
fit
([X, y])Pass. fit_transform
(X[, y])Fit to data, then transform it. get_params
([deep])Get parameters for this estimator. set_params
(**params)Set the parameters of this estimator. transform
(X)Quantize the time series.
-
class
pyts.quantization.
MCB
(n_bins=4, quantiles=u'gaussian')[source]¶ Multiple Coefficient Binning.
Parameters: - n_bins : int (default = 4)
The number of bins. Ignored if
quantiles='entropy'
.- quantiles : {‘gaussian’, ‘empirical’, ‘entropy’} (default = ‘gaussian’)
The way to compute quantiles. If ‘gaussian’, quantiles from a gaussian distribution N(0,1) are used. If ‘empirical’, empirical quantiles are used. If ‘entropy’, quantiles are computed using the breakpoints leading to the maximum information gain.
Methods
fit
(X[, y])Fit the model according to the given training data. fit_transform
(X[, y])Fit to data, then transform it. get_params
([deep])Get parameters for this estimator. set_params
(**params)Set the parameters of this estimator. transform
(X)Transform the provided data. -
fit
(X, y=None)[source]¶ Fit the model according to the given training data.
Parameters: - X : array-like, shape = [n_samples, n_features]
Training vector, where n_samples in the number of samples and n_features is the number of features.
- y : None or array-like, shape = [n_samples] (default = None)
Class labels for each data sample.
Returns: - self : object
-
class
pyts.quantization.
SFA
(n_coefs=None, anova=True, norm_mean=True, norm_std=True, n_bins=4, quantiles=u'entropy', variance_selection=False, variance_threshold=0.0)[source]¶ Symbolic Fourier Approximation.
Parameters: - n_coefs : None or int (default = None)
The number of Fourier coefficients to keep. If
n_coefs=None
, all Fourier coefficients are returned. Ifn_coefs
is an integer, then_coefs
most significant Fourier coefficients are returned ifanova=True
, otherwise the firstn_coefs
Fourier coefficients are returned. A even number is required (for real and imaginary values) ifanova=False
.- anova : bool (default = False)
If True, the Fourier coefficients selection is done via a one-way ANOVA test. If False, the first Fourier coefficients are selected.
- norm_mean : bool (default = True)
If True, center the data before scaling. If
norm_mean=True
andanova=False
, the first Fourier coefficient will be dropped.- norm_std : bool (default = True)
If True, scale the data to unit variance.
- n_bins : int (default = 4)
The number of bins. Ignored if
quantiles='entropy'
.- quantiles : {‘gaussian’, ‘empirical’, ‘entropy’} (default = ‘gaussian’)
The way to compute quantiles. If ‘gaussian’, quantiles from a gaussian distribution N(0,1) are used. If ‘empirical’, empirical quantiles are used. If ‘entropy’, quantiles are computed using the breakpoints leading to the maximum information gain.
- variance_selection : bool (default = False)
If True, the Fourier coefficients with low variance are removed.
- variance_threshold : float (default = 0.)
Fourier coefficients with a training-set variance lower than this threshold will be removed. Ignored if
variance_selection=False
.
Methods
fit
(X[, y])Fit the model according to the given training data. fit_transform
(X[, y])Fit to data, then transform it. get_params
([deep])Get parameters for this estimator. set_params
(**params)Set the parameters of this estimator. transform
(X)Transform the provided data. -
fit
(X, y=None)[source]¶ Fit the model according to the given training data.
Parameters: - X : array-like, shape = [n_samples, n_features]
Training vector, where n_samples in the number of samples and n_features is the number of features.
- y : None or array-like, shape = [n_samples] (default = None)
Class labels for each data sample.
Returns: - self : object