Repository navigation
What's new
This release ports the core of ForeCA (Goerg, JMLR 2013) into s2generator.utils.forecastability: spectral entropy, the Omega forecastability score, multivariate spectra, ZCA whitening, Slow Feature Analysis, and EM-based forecastable components. utils is also split into subpackages, and examples are now Sphinx-Gallery .py scripts.
Forecastability (ForeCA)
Series are (T,) or (T, K) with time on axis 0.
omega/spectral_entropy— Shannon entropy of the normalized spectrum, reported as Omega in[0, 100](white noise low, sinusoid high)mvspectrum— univariate periodogram / Welch, or Hermitian CSD tensors for multivariate serieswhiten— ZCA whiteningSlowFeatureAnalysis— slowest-first features fromcov(diff(U))after whiteningForeCA— EM that minimises spectral entropy; successive components are orthogonal in the whitened space- Plots:
plot_omega,plot_spectrum,plot_foreca,plot_sfa
Examples: examples/tools/omega_spectral_entropy.py, examples/tools/foreca_components.py, examples/tools/sfa_vs_foreca.py
from s2generator.utils import ForeCA, omega
om = omega(X, method="welch") # (K,) scores in [0, 100]
model = ForeCA(n_comp=2, n_starts=4, random_state=0)
scores = model.fit_transform(X) # (T, n_comp)
print(model.omega) # descending Omega of each ForeCUtils layout
Helpers now live under distance, correlation, decomposition, smooth, data, tools, visualization, and forecastability. from s2generator.utils import … still works.
Docs and examples
Notebooks under examples/ are replaced by Sphinx-Gallery scripts; docs use the PyData Sphinx theme.
Install
pip install s2generator==0.0.23Full Changelog: v0.0.22...v0.0.23