Repository navigation
pyhctsa 2.0.0 is the first major release of pyhctsa, as a clean-room independent Python re-implementation of the hctsa time-series feature library for MATLAB. The plan is for hctsa to be frozen and for this to be the target of active subsequent development (and this has already developed beyond hctsa).
pyhctsa computes 6406 interpretable features of a univariate time series, from 1091 feature functions (parameter settings of 210 operations): 6166 features from the operations of hctsa and 240 that are new in pyhctsa.
What is in this release
- Feature extraction.
FeatureCalculator().extract(x)takes an array, a pandas Series, or a list of either, and returns a float64 DataFrame with one row per series and one column per feature.LocalDistributorruns the extraction in parallel, including when Python is embedded, for example in R through reticulate. - The feature library. 210 operations, spanning distributions, correlation structure, entropy and information theory, model fitting and forecasting, stationarity, spectral and wavelet measures, symbolic and graph-based methods, and nonlinear time-series analysis (including GARCH fits, recurrence quantification, Lyapunov exponents, persistent homology, multifractal DFA and long-memory estimation). The method list documents every operation and its outputs.
- Quality labels. After
extract, the calculator holdsquality(a code per value: good, error, NaN, Inf, -Inf, complex, empty, link error, non-scalar, rejected input),errors(one row per failing feature function or rejected series, with the message) andcalc_time(seconds per series and feature function). A feature that fails, or gives Inf or a complex number, is NaN in the results; encoded by thequalitylabel. - Short and invalid series. A series that is constant, contains NaN or Inf, or has fewer than 3 samples is marked as rejected, and the rest of the batch is computed. Each operation has its own minimum length, below which its outputs are NaN, and
extractwarns for series shorter than 20 samples. - Saving results.
FeatureCalculator.save,save_resultsandload_resultswrite and read values with their quality labels, errors, timings and metadata, as.npzor.parquet(pip install "pyhctsa[parquet]"). A saved file records the feature set that produced it (the configuration's file name, the SHA-256 of its text, any missing optional packages and the operations skipped because of them) and no file paths; the home directory in recorded error messages is replaced by~. - Custom feature sets. The default feature set is defined in
feature_config.yaml, andFeatureCalculatoraccepts the path to a custom config. Mistakes in a configuration file (e.g., an unknown parameter, two settings with the same label,zscore: 'False'as a string) raise an error naming the entry when the calculator is built. - Datasets.
get_dataset()returns Empirical1000 (doi:10.6084/m9.figshare.5436136), downloaded on first use (33 MB, cached in~/.cache/pyhctsaorPYHCTSA_DATA_DIR).get_dataset('1000x1000')returns the 1000×1000 collection, 1000 synthetic series of 1000 samples from 133 generating mechanisms (doi:10.6084/m9.figshare.34013331). Dataset names are not case-sensitive, and'Empirical1000'and'S1000'work as aliases. Downloads are checked against a SHA-256 digest.get_dataset_features('e1000')(or'1000x1000') downloads the full feature matrix that pyhctsa 2.0.0 computed for that dataset (about 40 MB), with its quality labels, errors and timings, so it need not be recomputed. These pyhctsa feature files are in the latest versions of the figshare records (Empirical1000 v12, 1000×1000 v2), next to hctsa v3.0.1 feature matrices for MATLAB users, which are a different feature set.
Installation and platforms
pip install pyhctsa- Python 3.10 to 3.14, with wheels for Linux x86_64 and aarch64 (glibc 2.28 or newer), macOS on Apple silicon and Windows x64.
- Two dependencies,
ripserandhmmlearn, underpin a few features each, and each is installed only where it publishes a wheel, so as to prevent them from stopping an pyhctsa install.ripser(8 persistent-homology features) is installed on Python 3.10 to 3.14.hmmlearn(34 hidden-Markov-model features) is installed on Python 3.10 to 3.13; it has no Python 3.14 wheels, so there a plain install gives 6372 features, andpip install "pyhctsa[hmm]"builds it from source (needs a C++ compiler). If either is missing, its features are skipped with a warning that gives the install command. - Intel Macs have no pyhctsa wheel, so pip builds it from source, which needs the Xcode Command Line Tools. Use Python 3.10 to 3.13 there:
numba, a required dependency, no longer publishes Intel Mac wheels and has none for Python 3.14.
Licence and history
Every function that depended on MATLAB code was re-implemented clean-room from the published methods, bundled third-party code is under GPL-compatible licences (THIRD_PARTY_LICENSES.md), and pyhctsa is GPL-3.0-or-later. 2.0 is therefore published from a re-created repository with a fresh history. Much of 2.0 was written with assistance from Anthropic's Claude, under the direction of the maintainers; see the README.
Citation
If you use pyhctsa, please cite the software paper:
- Moore, J. B., & Fulcher, B. D. (2026). pyhctsa: A Python package for highly comparative time-series analysis. Journal of Open Source Software, 11(123), 10581. https://doi.org/10.21105/joss.10581. Software archive: https://doi.org/10.5281/zenodo.24672350.
and the papers that introduced highly comparative time-series analysis and hctsa:
- Fulcher, B. D., & Jones, N. S. (2017). hctsa: A computational framework for automated time-series phenotyping using massive feature extraction. Cell Systems, 5(5), 527–531.e3. https://doi.org/10.1016/j.cels.2017.10.001
- Fulcher, B. D., Little, M. A., & Jones, N. S. (2013). Highly comparative time-series analysis: the empirical structure of time series and their methods. Journal of the Royal Society Interface, 10(83), 20130048. https://doi.org/10.1098/rsif.2013.0048