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.1.0.tar.gz (63.2 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.1.0-py3-none-any.whl (68.5 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for lifejacket-0.1.0.tar.gz
Algorithm Hash digest
SHA256 b9014494753692272de6825c44db9295cad4185abf02f2d8b6cd4ffe89d354e4
MD5 ed8aeade8d8c4391a035b5b8342a8ba0
BLAKE2b-256 e2f261b52923ec7f8af15dfddba8a27b84445ce31997e91e37db7413bf4e385a

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: lifejacket-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 68.5 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.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1a96b5d2611123b01a3012e53dfc1e45831541c23c4e2657e37087bef29d37a1
MD5 4723424169989daaa688a6564f78defb
BLAKE2b-256 783634d9ff709dfccd0a2772fb885154c344aa0ad15e1f994aa08edb2bf55905

See more details on using hashes here.

Provenance

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