timemachines

0.20.5last stable release 2 years ago
Complexity Score
Medium
Open Issues
78
Dependent Projects
0
Weekly Downloadsglobal
1,646

License

  • MIT
    • Yesattribution
    • Permissivelinking
    • Permissivedistribution
    • Permissivemodification
    • Nopatent grant
    • Yesprivate use
    • Permissivesublicensing
    • Notrademark grant

Downloads

Readme

timemachines (docs and leaderboards)

Univariate prediction functions from diverse packages supported in a simple stateless pure function syntax, mosty for benchmarking and application-specific selection purposes. See basic usage. Briefly: if yt is a list of floats we can feed them one at a time to a skater like so:

 from timemachines.skaters.somepackage.somevariety import something as f
 for yt in y:
     xt, xt_std, s = f(y=yt, s=s, k=3)
     

This emits a k-vector xt of forecasts, and corresponding k-vector xt_std of estimated standard errors, and the posterior state s needed for the next call. See skaters for choices of somepackage, somevariety and something. You can also ensemble, compose, bootstrap and do other things with one line of code. The f is called a skater. These are (documented and assessed). See why for motivation for doing things in walk-forward incremental functional fashion with one line of code.

Test for the following packages are expected to be working, and their use in this context reliable:

  • Statsmodels

Test for the following packages are not necessarily expected to be working:

See the docs.

What’s a “skater”?

More abstractly:

$$ f : (y_t, state; k) \mapsto ( [\hat{y}(t+1),\hat{y}(t+2),\dots,\hat{y}(t+k) ], [\sigma(t+1),\dots,\sigma(t+k)], posterior\ state)) $$

where $\sigma(t+l)$ estimates the standard error of the prediction $\hat{y}(t+l)$. If you prefer an legitimate (i.e. stateful) state machine, that’s fine but see see FAQ question 1 for how to quickly roll this yourself.

Skater function conventions

See docs/interface for description of skater inputs and outputs. Briefly:

  x, w, s = f(   y:Union[float,[float]],             # Contemporaneously observerd data, 
                                                     # ... including exogenous variables in y[1:], if any. 
            s=None,                                  # Prior state
            k:float=1,                               # Number of steps ahead to forecast. Typically integer. 
            a:[float]=None,                          # Variable(s) known in advance, or conditioning
            t:float=None,                            # Time of observation (epoch seconds)
            e:float=None,                            # Non-binding maximal computation time ("e for expiry"), in seconds
            r:float=None)                            # Hyper-parameters ("r" stands for for hype(r)-pa(r)amete(r)s) 

Contributing

  • See TFRO.md
  • See CONTRIBUTE.md and good first issues.
  • See the suggested steps for a capstone project.

Getting live help

  • Office hours are mentioned here.
  • Discord channle is mentioned here.

See also FAQ.

Install instructions

Oh what a mess the Python timeseries ecosystem is. So packages are not installed by default. See the methodical install instructions and be incremental for best results. The infamous xkcd cartoon really does describe the alternative quite well.

Links to packages used

Skaters draw on functionality from popular python time-series packages like river, pydlm, tbats, pmdarima, statsmodels.tsa, neuralprophet, Facebook Prophet, Uber’s orbit, Facebook’s greykite and more. See the docs.

Cite

Thanks

    @electronic{cottontimemachines,
        title = {{Timemachines: A Python Package for Creating and Assessing Autonomous Time-Series Prediction Algorithms}},
        year = {2021},
        author = {Peter Cotton},
        url = {https://github.com/microprediction/timemachines}
    }

or something here.

Dependencies

Loading dependencies...

CVE IssuesActive
0
Scorecards Score
3.00
Test Coverage
No Data
Follows Semver
Yes
Github Stars
368
Dependenciestotal
0
DependenciesOutdated
0
DependenciesDeprecated
0
Threat Modelling
No
Repo Audits
No

Learn how to distribute timemachines in your own private PyPI registry

pip install timemachines
Processing...
Done

Releases

Loading Version Data
PyPI on Cloudsmith

Getting started with PyPI on Cloudsmith is fast and easy.