Skip to main content

PoolD

Python library for Optimistic Online Learning under Delay

This Python package implements algorithms for online learning under delay using optimistic hints. More details on the algorithms and their regret properties can be found in the manuscript Online Learning with Optimism and Delay.


@InProceedings{pmlr-v139-flaspohler21a,
  title = 	 {Online Learning with Optimism and Delay},
  author =       {Flaspohler, Genevieve E and Orabona, Francesco and Cohen, Judah and Mouatadid, Soukayna and Oprescu, Miruna and Orenstein, Paulo and Mackey, Lester},
  booktitle = 	 {Proceedings of the 38th International Conference on Machine Learning},
  pages = 	 {3363--3373},
  year = 	 {2021},
  editor = 	 {Meila, Marina and Zhang, Tong},
  volume = 	 {139},
  series = 	 {Proceedings of Machine Learning Research},
  month = 	 {18--24 Jul},
  publisher =    {PMLR},
  pdf = 	 {http://proceedings.mlr.press/v139/flaspohler21a/flaspohler21a.pdf},
  url = 	 {http://proceedings.mlr.press/v139/flaspohler21a.html},
  abstract = 	 {Inspired by the demands of real-time climate and weather forecasting, we develop optimistic online learning algorithms that require no parameter tuning and have optimal regret guarantees under delayed feedback. Our algorithms—DORM, DORM+, and AdaHedgeD—arise from a novel reduction of delayed online learning to optimistic online learning that reveals how optimistic hints can mitigate the regret penalty caused by delay. We pair this delay-as-optimism perspective with a new analysis of optimistic learning that exposes its robustness to hinting errors and a new meta-algorithm for learning effective hinting strategies in the presence of delay. We conclude by benchmarking our algorithms on four subseasonal climate forecasting tasks, demonstrating low regret relative to state-of-the-art forecasting models.}
}

The core of the library is the learners module. Learners can be instantiated using the create method:

import poold
model_list = ["model1", "model2"]
learner = poold.create(learner="dormplus", model_list=model_list, groups=None, T=None)

This method initializes an online learning object with an online learning History object, that performs the record keeping of plays and losses observed during online learning.

At each round t, the learner expects to receive a list of loss feedbacks losses_fb (tuples of feedback times and loss dictionaries) and an optimistic hint hint, and will produce a play w:

    w_t = learner.update_and_play(losses_fb, hint=h)

These losses and hints should be provided to the the learner. For ease of use, the library defines the Environment and Hinter abstract classes, that outline a standard interface for providing loss functions and hints to the learner respectively.

An example of online learning for subseasonal climate forecasting, as presented in Flaspohler et al. can be found in the examples directory.

Project Organization

├── LICENSE
├── Makefile           <- Makefile with commands to setup environment and run testing code
├── README.md          <- The top-level README for developers using this project.
│
├── docs               <- A default Sphinx project; see sphinx-doc.org for details
│
├── examples           <- Example code, including subseasonal forecasting data
│
├── requirements.txt   <- The requirements file for reproducing the analysis environment, e.g.
│                         generated with `pip freeze > requirements.txt`
│
├── poold              <- Source code for use in this project.
 tox.ini            <- tox file with settings for running tox; see tox.testrun.org
│   ├── __init__.py    <- Makes poold a Python module
│   │
│   ├── learners       <- Scripts implementing online learning algorithms AdaHedgeD, DUB, DORM and DORM+
│   │   └── __init__.py
│   │   └── learners.py
│   │
│   ├── environment <- Scripts outlining the basic online learning environment interface
│   │   └── __init__.py
│   │   └── environment.py
│   │
│   ├── hinters <- Scripts outlining the basic online optimistic hinting interface
│   │   └── __init__.py
│   │   └── hinters.py
│   │
│   └── utils <- Scripts implementing basic utilities, including online learning play history
│       └── __init__.py
│       └── general_utils.py
│       └── history.py
│       └── loss_utils.py
│
└── tox.ini            <- tox file with settings for running tox; see tox.testrun.org
└── setup.py           <- makes project pip installable (pip install -e .) so poold can be imported

Install

The PoolD pacakge can be installed via pip:

pip install poold

Metadata

Release files for poold 0.0.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for poold 0.0.5
File Size Uploaded Provenance
poold-0.0.5.tar.gz 20.7 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for poold 0.0.5
File Interpreter ABI Platform
poold-0.0.5-py3-none-any.whl Python 3 none any Details

Total release size: 42.2 kB

Release files / poold-0.0.5.tar.gz

Download URL poold-0.0.5.tar.gz
Size 20.7 kB
Tags Source
SHA-256 checksum
How to use checksums
9461a612ec9193357339633e8f06699acc544aeaf51c495e207444c4f91951c1
BLAKE2b-256 checksum
How to use checksums
3ea855a0d136817d383380ea21e658f1fba8607a3804099152b38d172e710fe8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.24.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.3

Release files / poold-0.0.5-py3-none-any.whl

Download URL poold-0.0.5-py3-none-any.whl
Size 21.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
39a7d934b601318fbc35e9d4c1993069b6b27e620f7ea4423e0bd7167bf4a575
BLAKE2b-256 checksum
How to use checksums
5a367f275eee02bdde512e7563f675e6ad0eb0cb84311c72b2a6df37cb4d72d9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.24.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.3

Security for poold 0.0.5

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page