Skip to main content

A package for after-study analysis of adaptive experiments in which data is pooled across users.

Project description

  _ _  __     _            _        _
 | (_)/ _|   (_)          | |      | |
 | |_| |_ ___ _  __ _  ___| | _____| |_
 | | |  _/ _ \ |/ _` |/ __| |/ / _ \ __|
 | | | ||  __/ | (_| | (__|   <  __/ |_
 |_|_|_| \___| |\__,_|\___|_|\_\___|\__|
            _/ |
           |__/

Save your standard errors from pooling in adaptive experiments.

Setup (if not using conda)

Create and activate a virtual environment

  • python3 -m venv .venv; source /.venv/bin/activate

Adding a package

  • Add to requirements.txt with a specific version or no version if you want the latest stable
  • Run pip freeze > requirements.txt to lock the versions of your package and all its subpackages

Running the code

  • `export PYTHONPATH to the absolute path of this repository on your computer
  • ./run_local_synthetic.sh, which outputs to simulated_data/ by default. See all the possible flags to be toggled in the script code.

Linting/Formatting

Testing

python -m pytest python -m pytest tests/unit_tests python -m pytest tests/integration_tests

Talk about gitignored cluster simulation scripts

Important Large-Scale Simulations

No adaptivity

sbatch --array=[0-999] -t 0-5:00 --mem=50G run_and_analysis_parallel_synthetic --T=10 --n=50000 --recruit_n=50000 --steepness=0.0 --alg_state_feats=intercept,past_reward --action_centering_RL=0 --inference_loss_func_filename="functions_to_pass_to_analysis/get_least_squares_loss_inference_no_action_centering.py" --theta_calculation_func_filename="functions_to_pass_to_analysis/estimate_theta_least_squares_no_action_centering.py"

No adaptivity, 5 batches incremental recruitment

sbatch --array=[0-999] -t 0-5:00 --mem=50G run_and_analysis_parallel_synthetic --T=10 --n=50000 --recruit_n=10000 --steepness=0.0 --alg_state_feats=intercept,past_reward --action_centering_RL=0 --inference_loss_func_filename="functions_to_pass_to_analysis/get_least_squares_loss_inference_no_action_centering.py" --theta_calculation_func_filename="functions_to_pass_to_analysis/estimate_theta_least_squares_no_action_centering.py"

Some adaptivity, no action_centering

sbatch --array=[0-999] -t 0-5:00 --mem=50G run_and_analysis_parallel_synthetic --T=10 --n=50000 --recruit_n=50000 --steepness=3.0 --alg_state_feats=intercept,past_reward --action_centering_RL=0 --inference_loss_func_filename="functions_to_pass_to_analysis/get_least_squares_loss_inference_no_action_centering.py" --theta_calculation_func_filename="functions_to_pass_to_analysis/estimate_theta_least_squares_no_action_centering.py"

Some adaptivity, no action_centering, 5 batches incremental recruitment

sbatch --array=[0-999] -t 0-5:00 --mem=50G run_and_analysis_parallel_synthetic --T=10 --n=50000 --recruit_n=10000 --steepness=3.0 --alg_state_feats=intercept,past_reward --action_centering_RL=0 --inference_loss_func_filename="functions_to_pass_to_analysis/get_least_squares_loss_inference_no_action_centering.py" --theta_calculation_func_filename="functions_to_pass_to_analysis/estimate_theta_least_squares_no_action_centering.py"

More adaptivity, no action_centering

sbatch --array=[0-999] -t 0-5:00 --mem=50G run_and_analysis_parallel_synthetic --T=10 --n=50000 --recruit_n=50000 --steepness=5.0 --alg_state_feats=intercept,past_reward --action_centering_RL=0 --inference_loss_func_filename="functions_to_pass_to_analysis/get_least_squares_loss_inference_no_action_centering.py" --theta_calculation_func_filename="functions_to_pass_to_analysis/estimate_theta_least_squares_no_action_centering.py"

Even more adaptivity, no action_centering

sbatch --array=[0-999] -t 0-5:00 --mem=50G run_and_analysis_parallel_synthetic --T=10 --n=50000 --recruit_n=50000 --steepness=10.0 --alg_state_feats=intercept,past_reward --action_centering_RL=0 --inference_loss_func_filename="functions_to_pass_to_analysis/get_least_squares_loss_inference_no_action_centering.py" --theta_calculation_func_filename="functions_to_pass_to_analysis/estimate_theta_least_squares_no_action_centering.py"

Some adaptivity, RL action_centering, no inference action centering

sbatch --array=[0-999] -t 0-5:00 --mem=50G run_and_analysis_parallel_synthetic --T=10 --n=50000 --recruit_n=50000 --steepness=3.0 --alg_state_feats=intercept,past_reward --action_centering_RL=1 --inference_loss_func_filename="functions_to_pass_to_analysis/get_least_squares_loss_inference_no_action_centering.py" --theta_calculation_func_filename="functions_to_pass_to_analysis/estimate_theta_least_squares_no_action_centering.py"

Some adaptivity, inference action_centering, no RL action centering

sbatch --array=[0-999] -t 0-5:00 --mem=50G run_and_analysis_parallel_synthetic --T=10 --n=50000 --recruit_n=50000 --steepness=3.0 --alg_state_feats=intercept,past_reward --action_centering_RL=0 --inference_loss_func_filename="functions_to_pass_to_analysis/get_least_squares_loss_inference_action_centering.py" --theta_calculation_func_filename="functions_to_pass_to_analysis/estimate_theta_least_squares_action_centering.py"

Some adaptivity, inference and RL action_centering

sbatch --array=[0-999] -t 0-5:00 --mem=50G run_and_analysis_parallel_synthetic --T=10 --n=50000 --recruit_n=50000 --steepness=3.0 --alg_state_feats=intercept,past_reward --action_centering_RL=1 --inference_loss_func_filename="functions_to_pass_to_analysis/get_least_squares_loss_inference_action_centering.py" --theta_calculation_func_filename="functions_to_pass_to_analysis/estimate_theta_least_squares_action_centering.py"

Some adaptivity, inference and RL action_centering, even more T

sbatch --array=[0-999] -t 1-00:00 --mem=50G run_and_analysis_parallel_synthetic --T=25 --n=50000 --recruit_n=50000 --steepness=3.0 --alg_state_feats=intercept,past_reward --action_centering_RL=1 --inference_loss_func_filename="functions_to_pass_to_analysis/get_least_squares_loss_inference_no_action_centering.py" --theta_calculation_func_filename="functions_to_pass_to_analysis/estimate_theta_least_squares_no_action_centering.py"

Some adaptivity, inference and RL action_centering, even more T, 5 batches incremental recruitment

sbatch --array=[0-999] -t 1-00:00 --mem=50G run_and_analysis_parallel_synthetic --T=25 --n=50000 --recruit_n=10000 --steepness=3.0 --alg_state_feats=intercept,past_reward --action_centering_RL=1 --inference_loss_func_filename="functions_to_pass_to_analysis/get_least_squares_loss_inference_no_action_centering.py" --theta_calculation_func_filename="functions_to_pass_to_analysis/estimate_theta_least_squares_no_action_centering.py"

TODO

  1. Add precommit hooks (pip freeze, linting, formatting)
  2. Run tests on PRs

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

lifejacket-0.2.0.tar.gz (63.6 kB view details)

Uploaded Source

Built Distribution

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

lifejacket-0.2.0-py3-none-any.whl (68.9 kB view details)

Uploaded Python 3

File details

Details for the file lifejacket-0.2.0.tar.gz.

File metadata

  • Download URL: lifejacket-0.2.0.tar.gz
  • Upload date:
  • Size: 63.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for lifejacket-0.2.0.tar.gz
Algorithm Hash digest
SHA256 dd26158367c125cfb5d044819eb7901fc73de9f1124281b2466f3f84b7dddd72
MD5 dd85994e15cacecc23b933beff7caa07
BLAKE2b-256 fb46a88808db1e05d522fb2fb942f95066a2c020cd0162262ba9869d7e2afc06

See more details on using hashes here.

Provenance

The following attestation bundles were made for lifejacket-0.2.0.tar.gz:

Publisher: publish_to_pypi.yml on StatisticalReinforcementLearningLab/adaptive-sandwich

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file lifejacket-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: lifejacket-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 68.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for lifejacket-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c69c1bb37433c59d25db1488addffaf156149062d154f4434e70db05785b484e
MD5 a58f354843fa2616271043c848db2240
BLAKE2b-256 6e3b95383fa62b04eb28c8055fe703be89c9e8321f8f7c81c616e2b7d7cf8367

See more details on using hashes here.

Provenance

The following attestation bundles were made for lifejacket-0.2.0-py3-none-any.whl:

Publisher: publish_to_pypi.yml on StatisticalReinforcementLearningLab/adaptive-sandwich

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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