tsxtract
tsxtract.extraction
Feature extraction functions.
- tsxtract.extraction.extract_features(dataset)
Extract features using tsxtract.
- Parameters:
dataset (jax.Array) – Dataset to extract features from. Must be an array of shape (samples, channels, length).
- Returns:
Dictionary with feature names as key and extracted features as values.
- Return type:
dict[str, jax.Array]
- tsxtract.extraction.maximum(signal)
Get the maximal value in the signal.
- Return type:
Array
- tsxtract.extraction.mean(signal)
Calculate the mean value of the signal.
- Return type:
Array
- tsxtract.extraction.minimum(signal)
Get the minimal value of the signal.
- Return type:
Array
tsxtract.utils
Utility functions for tsxtract.
- tsxtract.utils.generate_random_time_series_dataset(n_samples=100, n_channels=5, sampling_rate=100, time_series_length_in_seconds=10.0, *, random_seed=None)
Generate a random time series dataset.
- Parameters:
n_samples (int, optional) – Number of samples to generate, default is 100.
n_channels (int, optional) – Number of channels per sample (1 = univariate, >1 = multivariate), defaults to 1.
sampling_rate (int, optional) – Sampling rate in Hz, default is 100 (Hz).
time_series_length_in_seconds (float, optional) – Length of each time series in seconds, defaults to 10.0 seconds.
random_seed (int | None, optional) – Random Seed for reproducibility, defaults to None, which equals to random_seed = 0.
- Returns:
Randomly sample time series dataset with shape (n_samples, n_channels, int(sampling_rate * time_series_length_in_seconds))
- Return type:
jax.Array
Notes
The data is sampled using a normal distribution.
Examples
>>> from tsxtract.utils import generate_random_time_series_dataset >>> array = generate_random_time_series_dataset(100, 3, 10, 10) >>> array.shape (100, 3, 100)