Gym-style API
The domain features a continuos state and a dicrete action space.
The environment initializes:
- cross-sectional dataset with variables X_a, X_s, Y and N observations;
- logit model fitted on the dataset, retrieving parameters \theta_0, \theta_1, \theta_2;
The agent:
- sees a patient (sample observation);
- predict his risk of admission \rho, using initialized parameters
- if \rho < 1/2:
- do not intervene on X_a, which stays the same
- else:
- sample an action a in [0,1]
- compute g(a, X_a) = newX_a
- intervene on X_a by updating it to newX_a
- give reward equal to average risk of admission, using predicted Y, initial parameters and sampled values
(shouldn't I fit a new logit-link? parameters are now diff?)
To install
-
cd gym-contin
-
!pip install gym-contin
-
import gym
-
import gym_contin
-
env =gym.make('contin-v0')
To change version
- change version to, e.g., 1.0.7 from setup.py file
- git clone https://github.com/claudia-viaro/gym-contin.git
- cd gym-contin
- python setup.py sdist bdist_wheel
- twine check dist/*
- twine upload --repository-url https://upload.pypi.org/legacy/ dist/*
Release files for gym-contin 1.5.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| gym_contin-1.5.0.tar.gz | 4.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| gym_contin-1.5.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 9.7 kB
Release files / gym_contin-1.5.0.tar.gz
| Download URL | gym_contin-1.5.0.tar.gz |
|---|---|
| Size | 4.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5c4426217433fef3a33a1bd04f38a0d459f01f875eabb7e5c49e45fa6ae84fcd
|
|
BLAKE2b-256 checksum How to use checksums |
dbf94e01859a5d158f2bd94de2dcedecf801aa7095d8af2494179fca39fc5ee1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.6.1 requests/2.24.0 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.5
|
Release files / gym_contin-1.5.0-py3-none-any.whl
| Download URL | gym_contin-1.5.0-py3-none-any.whl |
|---|---|
| Size | 5.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e6c1a85e9d96482b090180ce401ddca32ef92eb38d75322337bdde901247f41c
|
|
BLAKE2b-256 checksum How to use checksums |
3b43b3fb75f5675242483636835a2f9b0b06fa194e3ac625ca2c246689d05e27
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.6.1 requests/2.24.0 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.5
|