FABBA
fABBA - An efficient symbolic aggregate approximation for temporal data.
fABBA_[1] is a dimensionality reduction technique that works by making symbolic approximation of temporal data, it well-suited for tasks such as compression, clustering, and classification. It converts time series data to sequence of tuples by adaptive polygonal chain approximation. It then uses clustering methods on these tuples and assigns symbols to the clusters. The core implementation is derived from the fABBA library_[2].
Schnellstart
from sktime.transformations.fabba import FABBA
estimator = FABBA(method: str='agg', tolerance: float=0.2, alpha: float | None=0.5, auto_digitize: bool=False, sorting: str | None='norm', k: int=2, batch_size: int=1024, scl: float=1.0, max_iter: int=2, if_partition: bool=False, partition_rate: float | None=None, num_partition: int | None=None, partition_idx: list [int ] | int | None=None, max_len: int | None=None, random_state: int | None=None, return_as_strings: bool=False, return_start_values: bool=False, alphabet_set: int | list=0, n_jobs: int=-1)Parameter(19)
- methodstr, optional (default=”agg”, {“agg”, “kmeans”, “mini-kmeans”})
- clustering method to use for symbolization
- tolerancefloat, optional (default=0.2, greater than 0)
- tolerance for polygonal chain approximation
- alphafloat, optional (default=0.5, greater than 0)
- distance threshold for aggregation used only if method is “agg” and auto_digitize is False if auto_digitize is True, alpha is determined automatically
- auto_digitizebool, optional (default=False)
- whether to automatically determine alpha for aggregation used only if method is “agg” if auto_digitize is True, alpha is determined automatically and input alpha is ignored
- sortingstr, optional (default=”norm”, {“norm”, “pca”, None})
- sorting method to use for aggregation/clustering used only if method is “agg”
- kint, optional (default=2, greater equal 2)
- number of clusters to form, used only if method is “kmeans” or “mini-kmeans”
- batch_sizeint, optional (default=1024, greater equal 1)
- number of samples per batch for MiniBatchKMeans used only if method is “mini-kmeans”
- max_iterint, optional (default=2, greater equal 1)
- maximum number of iterations for clustering methods used only if method is “kmeans” or “mini-kmeans”
- sclfloat, optional (default=1, greater equal 0)
- scaling factor for length in clustering
- if_parition: bool, optinal(default=False)
- determines if to parition series for parallel processing used only if input is a single series uses parition_rate or num_partition or parition_idx
- partition_ratefloat, optional (default=None, greater equal 0)
- rate to determine number of partitions for parallel processing used only if input is a single series and if_parition is True if partition_rate is None, number of partitions is set to number of processors
- num_partitionint, optional (default=None, greater equal 1)
- number of partitions for parallel processing used only if input is a single series and if_parition is True if partition is None, number of partitions is set based on partition_rate
- partition_idxlist(int), optional (default=None, list of int greater equal 0)
- indexes to partition on for parallel processing used only if input is a single series and if_parition is True if partition_idx is None, number of partitions is set based on parition
- max_lenint, optional (default=np.inf, greater equal 1 or -1)
- maximum length of segments for polygonal chain approximation -1 means no limit
- random_stateint, optional (default=None)
- random state for clustering methods used only if method is “kmeans” or “mini-kmeans”
- return_as_stringsbool, optional (default=False)
- whether to return symbolized series as strings or integer labels
- return_start_valuesbool, optional (default=False)
- whether to return the start values of each series start value is returned as first value in transformed data necessary for inverse transform
- alphabet_setint or list, optional (default=0, {0, 1} or list of strings)
- alphabet set to use for symbolization if int 0 uses mixed case, if int 1 uses upper case then lower case if list uses the provided list of strings as alphabet set
- n_jobsint, optional (default=-1)
- number of parallel jobs to run, -1 means using all processors
Beispiele
>>> from sktime.transformations.fabba import FABBA
>>> from sktime.datasets import load_airline
>>> y = load_airline ()
>>> transformer = FABBA (
... n_jobs = 1,
... random_state = 42,
... return_start_values = True,
... method = "agg",
... tolerance = 0.001,
... alpha = 0.05,
... )
>>> y_transformed = transformer. fit_transform (y)
>>> y_reconstructed = transformer. inverse_transform (y_transformed)Referenzen
Chen.
An efficient aggregation method for the symbolic representation of temporal data. arXiv preprint arXiv:2201.05697 (2022). https://arxiv.org/abs/2201.05697
Chen and S. Güttel.
fABBA: A Python library for the fast symbolic approximation of time series. Journal of Open Source Software (2024). https://joss.theoj.org/papers/10.21105/joss.06294
Chen and S. Güttel.
An Efficient Aggregation Method for the Symbolic Representation of Temporal Data. ACM Trans. Knowl. Discov. Data (2023). https://dl.acm.org/doi/abs/10.1145/3532622
Elsworth and S. Güttel.
ABBA: adaptive Brownian bridge-based symbolic aggregation of time serie. https://arxiv.org/abs/2003.12469