theodore-weld / microprediction

Client for Microprediction.Org

Home Page:http://www.microprediction.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

microprediction Downloads tests deploy

Looking for microprediction, m6 or timemachines? Github made this a user page so hi, this is my dog. This is my blog. I run a slack channel for those interested in open-source time-series prediction (invite) and informal Google Meets twice a week announced in the Slack (usually Tue 8pm and Fri noon EST).

Microprediction TLDR: Algorithms come to you.

  • You publish live data repeatedly, like this say, and it creates a stream like this one.
  • Algorithms like this guy compete to make distributional predictions 1 min ahead, 5 min ahead, 15 min ahead and 1 hr ahead.

In this way you can:

  • Get live prediction of public data for free
  • Avoid trying out hundreds of packages from Github of uncertain quality.
  • Avoid model deployment hassles
  • Avoid the endless cycle of model improvement

On the flip side you can :

  • Contribute algorithms and win beer money (see competitions)
  • Automatically benchmark your work or find unexpected uses for it (see streams)

Microprediction Python client

The client assists use of the microprediction api. If you don't know about the live algorithm frenzy at microprediction.org making this possible, an extremely simple way to grok it is to open this colab notebook and run it on Google's dime. This will create an identity for you and enter your algorithm in an ongoing contest to predict the next roll of a die. There are only four API methods you really need to know about initially to understand the system.

Task Method or function Full code example Video tutorial
A Create a write_key new_key enter_die_contest_one_off.py python-1: Your first submission
B Publish one scalar value at a time, usually representing a live measurement. MicroWriter.set() creating_a_stream.py python-4: Creating a stream
C Send 225 guesses of the next value of a stream, after a fixed quarantine period. MicroWriter.submit() enter_die_contest_one_off.py python-2: Creating your first crawler
D Retrieve community predictions (PDF) 1min, 5min, 15min or 1hr ahead. MicroWriter.get_own_predictions() defassa_dog.py colab example

Someone wanting something predicted performs A, B and D. Someone providing predictions performs A and C (mindful of the reward mechanism explained in Collective Distributional Prediction).

TimeMachines and related packages

The timemachines package provides autonomous time-series prediction algorithms in a simple functional form. They are benchmarked using a subset of the microprediction streams and thus, Elo ratings are published.

I also maintain a few other repos required for the microprediction platform

  • MUID - Memorable Unique Identifiers explained in this video.
  • microconventions - common to client and server may answer many of your questions.
  • rediz - Server side code, for the brave.
  • getjson, momentum and other rats and mice.

M6 and other time-series related packages

If you are chasing the $300,000 in M6 prizes...

  • m6 - Some utilities for the M6 Forecasting competition (fast numerical rank probabilities without Monte Carlo)
  • Winning - A recently published fast algorithm for inferring relative ability from win probability (used by M6).
  • HumpDay - Derivative-free optimizers in canonical form, with Elo ratings, potentially useful for hyper-parameters.
  • Embarrassingly - A speculative approach to robust optimization that sends impure objective functions to optimizers.

Unrelated:

  • Pandemic - Ornstein-Uhlenbeck epidemic simulation (related paper)
  • FirstDown - The repo that might ruin the great game of football.

Microprediction versus TimeMachines

The TimeMachines package is traditional open-source software for point-estimates and confidence, whereas the Microprediction client offers live crowd based distributional prediction.

Hundreds of algorithms compete at Microprediction and quite a few of the TimeMachines algorithms (see /skaters) are involved, drawn from packages like river, pydlm, tbats, pmdarima, statsmodels.tsa, neuralprophet, Facebook Prophet, Uber's orbit, Facebook's greykite and more. Some are open source (look for CODE badges on leaderboards) but others are private to their author.

One bridge between the /skaters and the microprediction leaderboards is provided by the StreamSkater class in the microprediction package, illustrated in the StreamSkater examples folder. This makes it trivial to use any skater from the TimeMachines package in a MicroCrawler (a live algorithm).

More about the Microprediction Python Client

See also README_EXAMPLES.md or README_LONGER.md

Class Hierarchy

Use MicroReader if you just need to get data and don't care to use a key (or pull directly).

MicroReader
   |
MicroWriter ----------------------------
   |                                   |
MicroPoll                         MicroCrawler
(feed creator)               (self-navigating algorithm)

Scheduled submissions versus "crawling"

The MicroWriter class can publish data or submit predictions. However if you intend to run a continuous process you might consider the MicroCrawler class or its derivatives.

Type Suggestion Example More examples
Scheduled submission MicroWriter Ambassy Fox submission_examples_transition
Running process MicroCrawler Malaxable Fox crawler_examples
Running process using timemachines StreamSkater Shole Gazelle crawler_skater_examples

A more complete picture would include SimpleCrawler, RegularCrawler, OnlineHorizonCrawler, OnlineStreamCrawler and ReportingCrawler.

Publishing absolute quantities versus changes

It is often better to publish changes in values than actual values of live quantities, to avoid race conditions or latency issues. There is a discussion in the README_LONGER.md.

Certainly it is easy to publish live quantities using only the MicroWriter as shown in traffic_live.py. However you might consider:

The former contains the blog, a knowledge center with video tutorials, details of competitions and prizemoney, and so forth. The latter is browser for humans looking to see how their algorithms are are performing, or whether their streams are updating.

Slack & Google Meets Tue 8pm/ Fri noon EST

Most people looking to contribute to this open initiative (and win beer money) join the microprediction slack. If that invite fails there might be one in the knowledge center that hasn't expired. There you will find Google Meet invite details for our regular informal chats.

Microprediction bookmarks

Data: stream list | stream explanations | csv Client: client | reader | writer | crawler | crawler examples | notebook examples Resources: popular timeseries packages | knowledge center | faq | linked-in | microprediction.org (dashboard) | microprediction.com (resources) | what | blog | contact | competitions | make-predictions | get-predictions | applications | collective epidemiology Video tutorials : 1: non-registration | 2: first crawler |3: retrieving historical data | 4: creating a data stream | 5: modifying your crawler's algorithm | 6: modifying crawler navigation Colab notebooks creating a new key | listing current prizes | submitting a prediction | choosing streams | retrieving historical data Related humpday | timemachines | timemachines-testing | microconventions | muid | causality graphs | embarrassingly | key maker | real data| chess ratings prediction Eye candy copula plots | causality plots | electricity case study

Probably best to start in the knowledge center and remember Dorothy, You're Not in Kaggle Anymore.

Cite

See CITE.md

FAQ:

FAQ

Video tutorials

See the Knowledge Center

Hey, where did the old README go?

README_LONGER.md

About

Client for Microprediction.Org

http://www.microprediction.org


Languages

Language:Jupyter Notebook 88.3%Language:Python 11.7%Language:Shell 0.0%