$ show tblume1992/ThymeBoost
ThymeBoost is a Python library for time series forecasting that applies a gradient boosting approach to decompose and predict trend, seasonality, and exogenous components. Unlike traditional additive models, it iteratively fits these components on residuals across multiple rounds, allowing flexible mixing of estimators (e.g., ARIMA for trend, Fourier for seasonality, OLS for exogenous). The library exposes a clean API through the `ThymeBoost` class with methods for fitting, predicting, optimizing hyperparameters, ensembling, and online learning. It also includes an experimental `AutoForecast` class and a set of unit tests for trend models. While it is packaged as a reusable library (application), the repository includes Jupyter notebooks and sample datasets, giving it a hybrid character that also supports data exploration and research use cases. The codebase demonstrates solid software engineering with abstract base classes for each component type, operator overloading for composing models, and a well-structured boosting loop. However, it shows signs of single-developer maintenance: incomplete error handling, commented-out code, and experimental features. The dependencies are reasonably current, but Python 3.7 compatibility may limit adoption on newer runtimes.
The LLM identified 3 files worth highlighting for reuse:
Abstract base class for all trend models. Defines a common interface (`fit`, `predict`) and implements operator overloading (`__add__`, `__mul__`, `__radd__`, `__rmul__`) to allow arithmetic composition of trend components. This pattern enables building complex trend expressions from simple models and is reusable in any time series framework that needs composable components.
A standalone module providing a set of cost functions used for split proposals and global model selection. Includes MSE, MAE, entropy for split costs and AIC, AICc, BIC, MSE for global costs with regularization penalty. The functions are pure and import only numpy, making them easily extractable for use in other model selection or changepoint detection projects.
Implements two strategies for generating changepoint candidates: gradient-based and histogram-based. The module is self-contained (imports numpy, pandas, scipy) and can be reused in any time series segmentation task. The parameterized approach allows control over number of proposals and strategy selection.