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 online decision-making algorithms.

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.1.tar.gz (63.7 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.1-py3-none-any.whl (68.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: lifejacket-0.2.1.tar.gz
  • Upload date:
  • Size: 63.7 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.1.tar.gz
Algorithm Hash digest
SHA256 2deef41e1c1d1ba380564a90425ab18cc88cf7b5980cf818797b6a55a1763596
MD5 c14016dcc14156cabb20019cf442cf57
BLAKE2b-256 3739b9d0aba96078402a3c0b1d1a5bf9d8eb51cea7a9aa73cbf63520e275ab2f

See more details on using hashes here.

Provenance

The following attestation bundles were made for lifejacket-0.2.1.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.1-py3-none-any.whl.

File metadata

  • Download URL: lifejacket-0.2.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e02c6c8ac2b41d491f29c8e8d292585c300dc9a8c2f504a290d20c9aabc8b136
MD5 7e2bc570d8a24f6d6809b2978051fe25
BLAKE2b-256 9c43ecf9a7e8fca8c9268fe3df816b85c3ab5c5fc7195470562ff09b3d00e2c4

See more details on using hashes here.

Provenance

The following attestation bundles were made for lifejacket-0.2.1-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