• Stars
    star
    398
  • Rank 108,325 (Top 3 %)
  • Language
    Python
  • License
    MIT License
  • Created almost 4 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Predict time-series with one line of code.

timemachines simplepycarettsa successor darts greykite sktime tbats simdkalman prophet statsforecastorbit neuralprophet pmd pydlm merlion merlion-prophet river divinitypycaret License: MIT

Simple prediction functions (documented and assessed)

Because why not do things in walk-forward incremental fashion with one line of code? Here yt is a vector or scalar, and we want to predict yt (or its first coordinate if a vector) three steps in advance.

 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. See skaters for choices of somepackage, somevariety and something. You can also ensemble, compose, bootstrap and do other things with one line of code.

See the docs.

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.

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, see FAQ question 1.

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) 

Contributions and capstone projects

Getting live help

  • FAQ.
  • See the Slack invite on my user page here.
  • Office hours here.
  • Learn how to deploy some of these models and try to win the daily $125 prize.

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.

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.

More Repositories

1

microprediction

If you can measure it, consider it predicted
Jupyter Notebook
331
star
2

precise

World beating online covariance and portfolio construction.
Python
150
star
3

humpday

Elo ratings for global black box derivative-free optimizers
Python
103
star
4

timeseries-notebooks

Hello world univariate examples for a variety of time series packages.
Jupyter Notebook
56
star
5

winning

Inference of relative ability from winning probabilities
Jupyter Notebook
36
star
6

m6

M6-Forecasting competition
Jupyter Notebook
30
star
7

optimizer-elo-ratings

Assigns Elo Ratings to Python Global Optimizers
19
star
8

timeseries-elo-ratings

Elo ratings for time-series forecasting packages
Python
18
star
9

monteprediction_colab_examples

Monte Carlo Submission Examples
Jupyter Notebook
16
star
10

m6entry

Python
13
star
11

microactors-causality

Examples of causality maps for time series driven by GitHub actions
Jupyter Notebook
13
star
12

muid

Memborable Unique Identifier
Python
10
star
13

building_an_open_ai_network

MIT Press
9
star
14

momentum

Running mean, variance, skew, and kurtosis
Python
9
star
15

embarrassingly

robust optimization
Python
8
star
16

pandemic

A 2d contagion model with commuting modeled as regime switching Ornstein-Uhlenbeck walks on the plane
Python
8
star
17

tuneup

Comparison of global optimization algorithms, including scipy, optuna, hyperopt, platypus, facebook-ax, pysot and others.
Python
6
star
18

gptprobe

For unmanned missions into GPT returning structured data
Python
5
star
19

offline

Demonstrates one pattern for offline estimation
Python
4
star
20

firstdown

NFL first down strategy
Jupyter Notebook
4
star
21

microactors

Examples of scheduled jobs estimating copulas at www.microprediction.org
Python
4
star
22

home

home page of sorts
4
star
23

microconventions

Conventions used at MicroPrediction.Org
Python
3
star
24

midterms

3
star
25

timemachines-testing

Testing optimizers and time-series algorithms, and assigning them Elo ratings.
Python
3
star
26

timeseries-data

static benchmarking timeseries data
Jupyter Notebook
3
star
27

monteprediction

Monte Prediction Utilities
Python
3
star
28

schooled

Experiments in what NN's can learn, or not
Python
2
star
29

csvsdataset

Dataset from multiple CSV files
Python
2
star
30

diffracting

Diffracting probability
2
star
31

chattychattybangbang

Forcing ChatGPT to do its own QA, and other strategies.
Python
2
star
32

curiouskids

questions for kids
2
star
33

rediz

Supporting community nowcasts at www.microprediction.org
Python
2
star
34

barbell

Notes on the interpretation of a barbell bond portfolio
2
star
35

autotds

Automatically generates "Towards Data Science" quality articles
Python
2
star
36

awesome-python-benchmarks

Benchmarking for python analytic packages
2
star
37

successor

Predicts the next number in a sequence, or next k
Python
1
star
38

predictionserver

Development version of microprediction server (not working yet)
Python
1
star
39

marketstacker

Financial market data in pandas using marketstack API
1
star
40

chess

Blitz and bullet chess ratings
HTML
1
star
41

realdata

Simple real time series data
Python
1
star
42

diffraction

Diffracting probability
1
star
43

helicopter

Helicopter Julia Challenge
Python
1
star
44

automl-notebooks

Quick and dirty first pass analysis
Jupyter Notebook
1
star
45

echochamber

Using an echo state network to enter a contest at microprediction.org
Python
1
star
46

awesome-hype

Listing of repositories for independent benchmarking and debunking
1
star
47

getjson

Very limited mini-package for retrieving JSON data with backoff and failover
Python
1
star
48

correlationbounds

Tiny utility for correlation bounds by brute force
Jupyter Notebook
1
star