Skip to content

Feat/tsfresh parity extractors - #20

Merged
wilswer merged 13 commits into
mainfrom
feat/tsfresh-parity-extractors
Oct 13, 2026
Merged

wilswer merged 13 commits into
mainfrom
feat/tsfresh-parity-extractors

Conversation

@wilswer

@wilswer wilswer commented Oct 13, 2026

Copy link
Copy Markdown
Owner

No description provided.

wilswer and others added 13 commits October 12, 2026 21:04
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
mean_second_derivative_central, value_count, energy_ratio_by_chunks,
change_quantiles, benford_correlation and query_similarity_count, with
config entries (tsfresh's default parameters; query_similarity_count off
unless configured), parity cases and fuzzing against tsfresh 0.21.2.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…r_entropy

Spectral features from tsfresh v0.21.2 in a new spectral module. One rfft
and one Welch PSD per group are cached in GroupContext and shared across
the features' parameters. Parity cases from tsfresh's tests plus generated
ones; fuzzed against tsfresh with tolerances that scale with the series
(rustfft rounds differently from pocketfft). fft_coefficient gives NaN for
a series with NaN or +-inf (documented deviation).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Port tsfresh's wavelet features (pywt.cwt with the Mexican hat wavelet,
scipy.signal.find_peaks_cwt with tsfresh's Ricker wavelet) as Efficient
tier kernels in the new wavelet module. Results equal tsfresh's bit for
bit on x86-64: np.convolve's OpenBLAS ddot / small_correlate summation
order, numpy's SVML exp and pywt's pow-based wavelet table are
reproduced, since tied neighbouring coefficients are decided by rounding.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…t and augmented_dickey_fuller

Port tsfresh's statsmodels-based feature calculators (acf, pacf via
Levinson-Durbin, AutoReg OLS, adfuller with AIC/BIC/t-stat/None autolag
and MacKinnon p-values) to Rust kernels in the Efficient tier, with
config sections, parity cases and fuzz wiring against tsfresh.

Deliberate deviations: ar_coefficient gives NaN on NaN/inf (tsfresh
raises); augmented_dickey_fuller treats exact fits as zero residual
variance and breaks AIC/BIC ties from collinear lags towards the
smaller lag (statsmodels decides both by rounding noise).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ation

Drop the OpenBLAS ddot and SVML exp emulation and the CPU-feature dispatch:
one plain direct convolution, the standard exp and t * t, so results are
the same on every platform. cwt_coefficients now matches tsfresh within
rounding (TOLERANT); number_cwt_peaks can differ from tsfresh where
neighbouring coefficients tie in real arithmetic (documented deviation).
The fuzz test checks number_cwt_peaks against scipy's peak finder run on
the same portable arithmetic.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Skip ar_coefficient / augmented_dickey_fuller fuzz cases whose least
squares designs are ill-conditioned (cond > 1e6, which includes
rank-deficient designs and collinear-lag AIC/BIC ties) or contain
underflowing values; statsmodels' results there are rounding-dependent.
Compare ar_coefficient relative to the largest coefficient of its fit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Add binned_entropy, lempel_ziv_complexity, permutation_entropy,
approximate_entropy (Comprehensive tier), friedrich_coefficients and
max_langevin_fixed_point, with tsfresh's default parameters, parity
tests from tsfresh v0.21.2 and differential fuzzing.

- binned_entropy reproduces np.histogram's edges and binning; the shared
  `binned_entropy` helper is pub(crate) for fourier_entropy.
- Deliberate deviations: binned_entropy gives NaN for ±inf (tsfresh
  raises); permutation_entropy ranks ties by position (tsfresh's tie
  order depends on numpy's CPU-specific argsort).
- The Langevin features reproduce pd.qcut (incl. its interval labels),
  pandas' group-by means and np.polyfit; roots come from a balanced
  companion matrix, polished by Newton steps.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Also drop fourier_entropy's private binned_entropy/np.histogram copy in
favour of the shared entropy::binned_entropy, and silence statsmodels
warnings in the ar_coefficient fuzz comparison.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@wilswer
wilswer merged commit 027f6b7 into main Oct 13, 2026
0 of 2 checks passed
@wilswer
wilswer deleted the feat/tsfresh-parity-extractors branch October 13, 2026 06:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant