Skip to main content

Utilities to help play the Bird Game at crunchdao.com

Project description

birdgame tests_312

Utilities for the Bird Game at crunchdao.com. Your task is to track the dove location.

Install

pip install birdgame

Visualize the challenge

Run animatebirds.py to get a quick sense.

Create your Tracker

To create your tracker, you need to define a class that implements the TrackerBase interface. Specifically, your class must implement the following methods:

  1. tick(self, payload)
    This method is called at every time step to process new payloads. Use this method to update your internal state or logic as needed.

    Payload Example:

     {
       "falcon_location": 21.179864629354732,
       "time": 230.96231205799998,
       "dove_location": 19.164986723324326,
       "falcon_id": 1
     }
    
  2. predict(self)
    This method should return your prediction of the dove's location at a future time step. Ensure that the return format complies with the density_pdf specification.

You can refer to the Tracker examples for guidance.

Challenge your Tracker against the benchmark

To compare your Tracker's performance against the benchmark Tracker, use the test_run method provided in the TrackerBase class. This method evaluates your Tracker's efficiency over a series of time steps using density_pdf scoring. A higher score reflects more accurate predictions.

Usage Example:

from birdgame.tracker import TrackerBase

class MyTracker(TrackerBase):
    def tick(self, payload):
        # Process the payload and update internal state
        pass
   
    def predict(self):
        # Return the predicted dove location
        pass
   
# Instantiate your Tracker
tracker = MyTracker()

# Run the test to compare against the benchmark Tracker
tracker.test_run(
    live=True, # Set to True to use live streaming data; set to False to use data from a CSV file
    step_print=1000 # Print the score and progress every 1000 steps
)

Tracker examples

See Tracker examples. There are:

  • Quickstarter Notebooks
  • Self-contained examples
  • Examples that build on provided classes

or Trackers (Self-contained trackers)

Take your pick!

General Bird Game Advice

The Bird Game challenges you to predict the dove's location using probabilistic forecasting.

Probabilistic Forecasting

Probabilistic forecasting provides a distribution of possible future values rather than a single point estimate, allowing for uncertainty quantification. Instead of predicting only the most likely outcome, it estimates a range of potential outcomes along with their probabilities by outputting a probability distribution.

A probabilistic forecast models the conditional probability distribution of a future value $(Y_t)$ given past observations $(\mathcal{H}_{t-1})$. This can be expressed as:

$$P(Y_t \mid \mathcal{H}_{t-1})$$

where $(\mathcal{H}_{t-1})$ represents the historical data up to time $(t-1)$. Instead of a single prediction $(\hat{Y}t)$, the model estimates a full probability distribution $(f(Y_t \mid \mathcal{H}{t-1}))$, which can take different parametric forms, such as a Gaussian:

$$Y_t \mid \mathcal{H}_{t-1} \sim \mathcal{N}(\mu_t, \sigma_t^2)$$

where $(\mu_t)$ is the predicted mean and $(\sigma_t^2)$ represents the uncertainty in the forecast.

Probabilistic forecasting can be handled through various approaches, including variance forecasters, quantile forecasters, interval forecasters or distribution forecasters, each capturing uncertainty differently.

For example, you can try to forecast the target location by a gaussian density function (or a mixture), thus the model output follows the form:

{"density": {
                "name": "normal",
                "params": {"loc": y_mean, "scale": y_var}
            },
 "weight": weight
}

A mixture density, such as the gaussion mixture $\sum_{i=1}^{K} w_i \mathcal{N}(Y_t | \mu_i, \sigma_i^2)$ allows for capturing multi-modal distributions and approximate more complex distributions.

Additional Resources

Column Names and Tool Tips

Column Description
Model
Active Wealth The wealth that is currently at risk.
Cumulative Prize Active Wealth is prevented from growing too large by withdrawals (prizes).
Total Wealth The sum of cumulative prizes and active wealth, and thus a measure of overall success.
Longevity The number of observations since a player entered the game.
Log Likelihood An exponentially weighted average of ex-post log-likelihood.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

birdgame-0.0.14.tar.gz (36.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

birdgame-0.0.14-py3-none-any.whl (49.9 kB view details)

Uploaded Python 3

File details

Details for the file birdgame-0.0.14.tar.gz.

File metadata

  • Download URL: birdgame-0.0.14.tar.gz
  • Upload date:
  • Size: 36.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.10

File hashes

Hashes for birdgame-0.0.14.tar.gz
Algorithm Hash digest
SHA256 0026e7e517d9f5c0a6853eb96e6b726114b3bd9ec2d99742baee09cb3f4729d5
MD5 334bbbd9a105238ef517af2efcd1944d
BLAKE2b-256 aeed5b99ac261b74da95639785dbe94ba51d5aef0ce2f1c25f44b040e320fb2f

See more details on using hashes here.

File details

Details for the file birdgame-0.0.14-py3-none-any.whl.

File metadata

  • Download URL: birdgame-0.0.14-py3-none-any.whl
  • Upload date:
  • Size: 49.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.10

File hashes

Hashes for birdgame-0.0.14-py3-none-any.whl
Algorithm Hash digest
SHA256 4db1220f2ceaba017c16ec4e5f6c25fe2edc1d9c21d647bce27abe795af4ca8d
MD5 d16bfc21acca3b329a6cedc3eed27aaa
BLAKE2b-256 e86f59721ae1ead7eb65e464b04181a9d4bae347137ce56f5670b8b3d627b8d6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page