Skip to main content

AI forecasting and research tools to help humans reason about and forecast the future

Project description

Last Update: Oct 25 2024

Overview

This repository contains forecasting and research tools built with Python and Streamlit. The project aims to assist users in making predictions, conducting research, and analyzing data related to hard to answer questions (especially those from Metaculus). Find the demo website here: https://mokoresearch.streamlit.app/

Here are the key components and features of the project:

  • General Forecaster that integrates with the Metaculus AI benchmarking competition
  • Historical Base Rate Researcher
  • Niche List Researcher
  • Fermi Estimator
  • Key Factors Analysis

Getting Set Up

Environment Variables

The environment variables from .env.template are needed to run. Copy this template as .env and fill it in. Talk to the project owner to get the correct values for some of the more project specific variables.

Docker Dev Container

To get your development environment up and running, you need to have Docker Engine installed and running. Once you do, you can use the VSCode dev container pop-up to automatically set up everything for you

Install Docker

For Windows and Mac, you will download Docker Desktop. For Linux, you will download Docker Engine. (NOTE: These instructions might be outdated).

First download and setup Docker Engine using the instructions at the link below for your OS:

  • Windows: windows-install
  • Mac: mac-install
  • Linux: install
    • Note: DO NOT install Docker Desktop for Linux, rather, select your Linux distribution on the left sidebar and follow the distribution specific instructions for Docker engine. Docker Desktop runs with a different environment in Linux. (TODO: Check if this restriction still applies)
    • Remember to follow the post-installation steps for Linux: linux-postinstall

Starting the container

Once Docker is installed, when you open up the project folder in VSCode, you will see a pop up noting that you have a setup for dev containers, and asking if you would like to open the folder in a container. You will want to click "open in container". This will automatically set up everything you need and bring you into the container. If the docker process times out in the middle of installing python packages you can run the postinstall.sh manually. You also may need to have the VSCode Docker extension and/or devcontainer extension downloaded

You may need to reinstall some vscode extensions in the dev environment if you are opening it for the first time, but this should only be for the first time running it.

Some extensions are installed automatically (e.g. linting). You may need to reload the window after all of these extensions are installed.

Managing Docker

There are many ways to manager Docker containers, but generally if you download the vscode docker extension, you will be able to stop/start/remove all containers and images.

Alternatives to Docker

If you choose not to run docker, use a python virtual environment so these packages don't conflict with local packages. To set this up run

python -m venv .venv

If you use a virtual environment, install python packages and their dependencies to the virtual environment via the command

pip install --require-virtualenv -r requirements.txt

Running the Front End

You can run any front end folder in the front_end directory by executing streamlit run front_end/[site_file_name]/Home.py. This will start a development server for you that you can run.

Testing

This repository uses pytest and pytest-xdist. xdist spreads out all the tests between multiple threads that are each run on a separate CPU. Currently its setup to create a thread per CPU. Configuration for this is in pytest.ini. The tests are gathered afresh from each thread, so any initialization done in imports, globals, or class variables are done for each thread. Additionally, global state is not reset between tests on the same thread. When making tests, assume unknown values for globals and especially class variables (though try to avoid using these at all).

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

forecasting_tools-0.1.0.tar.gz (1.5 MB view details)

Uploaded Source

Built Distribution

forecasting_tools-0.1.0-py3-none-any.whl (1.5 MB view details)

Uploaded Python 3

File details

Details for the file forecasting_tools-0.1.0.tar.gz.

File metadata

  • Download URL: forecasting_tools-0.1.0.tar.gz
  • Upload date:
  • Size: 1.5 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.4 CPython/3.10.15 Linux/6.9.3-76060903-generic

File hashes

Hashes for forecasting_tools-0.1.0.tar.gz
Algorithm Hash digest
SHA256 777e64bf01b97716401039fcc019c17cea9adc957a07cce57952164663ab564c
MD5 7859c0337657249625b05e0fe55579f4
BLAKE2b-256 732f2d991fba3c3bba06334a39c23ddbde8d9b9114563141c664c6ffcf7e18e6

See more details on using hashes here.

File details

Details for the file forecasting_tools-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: forecasting_tools-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 1.5 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.4 CPython/3.10.15 Linux/6.9.3-76060903-generic

File hashes

Hashes for forecasting_tools-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2bfb27a968243e613113c7ed362a0847d8ee48811cc81745811d8349c3561636
MD5 1a520af71868a81ed6f9b20d21fdcf2e
BLAKE2b-256 61e242088829e68e6e2b2a6662a9b7e76164c18ad20e03f27f7ad5499e4d4895

See more details on using hashes here.

Supported by

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