Skip to main content

No project description provided

Project description

AEPsych Python client v0.2.0

This lets you use Python to interface with the AEPsych server to do model-based adaptive experimentation.

Installation

We recommend installing the client under a virtual environment like Anaconda. Once you've created a virtual environment for AEPsychClient and activated it, you can install through pip:

pip install aepsych_client

If you are a developer, you should also install the main AEPsych package so that you can run the tests.

Configuration

This interface uses AEPsych's ini-based config, which gets passed as a string to the server:

# Instantiate a client
client = AEPsychClient(ip="0.0.0.0", port=5555)

# Send a config message to the server, passing in a configuration filename
filename = 'configs/single_lse_2d.ini'
client.configure(config_path=filename)

Ask and tell

To get the next configuration from the server, we call ask; we report on the outcome with tell.

# Send an ask message to the server
trial_params = client.ask()

# Send a tell back
client.tell(config={"par1": [0], "par2": [1]}, outcome=1)

Resume functionality

We can run multiple interleaved experiments. When we call configure, we get back a strategy ID. The client keeps track of all these strategy IDs and we can use them to resume experiments. By doing this we can interleave different model runs.

# Configure the server using one config
client.configure(config_path=file1, config_name='config1')

# Run some stuff on this config
...

# Configure the server using another config
client.configure(config_path=file2, config_name='config2')

# Run some stuff on this other config
...

# Resume the past config
client.resume(config_name="config1)

Ending a session

When you are done with your experiment, you should call client.finalize(), which will stop the server and save your data to a database.

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

aepsych_client-0.3.0.tar.gz (5.4 kB view details)

Uploaded Source

Built Distribution

aepsych_client-0.3.0-py3-none-any.whl (6.5 kB view details)

Uploaded Python 3

File details

Details for the file aepsych_client-0.3.0.tar.gz.

File metadata

  • Download URL: aepsych_client-0.3.0.tar.gz
  • Upload date:
  • Size: 5.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.7

File hashes

Hashes for aepsych_client-0.3.0.tar.gz
Algorithm Hash digest
SHA256 b3a23821eae4777eb845ccf64b49b909623b66750bc069a32b54718a92023270
MD5 14ad82a06725ac085a7fe5540303c1c5
BLAKE2b-256 d70087393c507afb2c7e0e1f57aee69a1a4ab17d17b9c0be8efb8515fb0a9fee

See more details on using hashes here.

File details

Details for the file aepsych_client-0.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for aepsych_client-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 65dda00188b8f0c9dbb626ed148255ab587135675037b88e0e3a68532790dadc
MD5 5fcd16cc23d9354a3e3daf21ec2846a1
BLAKE2b-256 183991d73f051abde612d3f47d1a3e72c05bdd270cf0879a484c86790df1c8f4

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