$ show blue-yonder/tsfresh
tsfresh is a Python library for automatic time series feature extraction and selection, grounded in the FRESH (FeatuRe Extraction based on Scalable Hypothesis tests) algorithm. It provides over 700 feature calculators spanning statistics, signal processing, and nonlinear dynamics, along with hypothesis-testing-based feature selection using Benjamini-Hochberg or Benjamini-Yekutieli FDR control. The library is designed for integration into scikit-learn pipelines via transformers like FeatureAugmenter and RelevantFeatureAugmenter, and supports parallel/distributed execution via multiprocessing, Dask, or Spark. While primarily a software library (application), it has strong research roots with academic publications and example notebooks demonstrating classification, regression, and forecasting tasks. The codebase is well-structured with clean abstractions for data input normalization (adapters), pluggable parallelization (distributors), and feature settings reconstruction, making it a robust tool for time series feature engineering in production ML workflows.
The LLM identified 3 files worth highlighting for reuse:
Provides adapter classes (WideTsFrameAdapter, LongTsFrameAdapter, TsDictAdapter, DaskTsAdapter) that normalize various time series input formats (wide DataFrame, long DataFrame, dict of Series, Dask DataFrame) into a uniform iterable of Timeseries objects. This pattern isolates input format handling from core extraction logic, making it easy to support new data sources without modifying the extraction engine. The adapters are self-contained and could be extracted for use in other time series libraries.
Implements a DistributorBaseClass with concrete backends: MapDistributor (sequential), MultiprocessingDistributor (multiprocessing), LocalDaskDistributor, ClusterDaskDistributor, and ApplyDistributor (for pandas apply). This pattern decouples parallel execution from feature extraction logic, allowing users to switch between local, multi-core, or cluster execution transparently. The design is clean and reusable for any embarrassingly parallel workload.
Contains the from_columns() method that reconstructs feature extraction settings from an existing feature matrix (column names). This enables reproducible re-extraction of exactly the same features after selection or on new data. Also includes predefined settings classes (ComprehensiveFCParameters, EfficientFCParameters, MinimalFCParameters) and PickableSettings for serializing custom callable calculators via cloudpickle. The pattern is essential for production pipelines where feature sets must be consistent across training and inference.