Skip to main content

A OpenAI Gym Env for continuous control

Project description

Gym-style API environment

The domain features a continuos state and action space:

Action space: self.action_space = spaces.Box( low = np.float32(-np.array([2, 2, 2])), high = np.float32(np.array([2, 2, 2]))) *the actions represent the coefficients thetas of a logistic regression that will be run on the dataset of patients

Observation space: self.observation_space = spaces.Box( low=np.array([0], high=np.array([1], dtype=np.float32)
*the states represent values for the covariates X_a, X_s

At every episode there is a new population of patients, it is represented by a cross-sectional dataset equation
equation follows a truncated normal distribution equation
equation follows a Binomial distribution equation, equation

We are interested in observing the behaviour of equation

The environment produces the following iteration:


**e=0, t=0**
Sees a population of patients ![equation](https://latex.codecogs.com/svg.image?(Y,&space;X_a(0),&space;X_s(0))_{i=1}^N)

**e=0, t=1**
See the same population ![equation](https://latex.codecogs.com/svg.image?(Y,&space;X_a(1),&space;X_s(1))_{i=1}^N)
take an action ![equation](https://latex.codecogs.com/svg.image?a=%5C%7B%5Ctheta_0,%20%5Ctheta_1,%20%5Ctheta_2%5C%7D)
Computes the logit risk of each observation ![equation](https://latex.codecogs.com/svg.image?\rho_1(X_a(1),&space;X_s(1)))

**e=1, t=0**
See a new population of patients ![equation](https://latex.codecogs.com/svg.image?(Y,&space;X_a(0),&space;X_s(0))_{i=1}^N)
Computes the intervention value ![equation](https://latex.codecogs.com/svg.image?%5Cbar%7BX%7D_a%20=%20g(%5Crho_1,%20X_a))

e=1, t=1
See outcome Y
Fits a logistic regression on the patients: equation
Retrieves the coefficients equation
Computes the logit risk of each observation equation
Computes the mean logit risk across all observations, which is the reward given by the environment back to the agent (as a result of the 'good deed' of the action)

Then the episode ends and the environment restarts from episode 1

To install

To change version

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

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

gym_update-0.2.4-py3-none-any.whl (5.9 kB view details)

Uploaded Python 3

File details

Details for the file gym_update-0.2.4-py3-none-any.whl.

File metadata

  • Download URL: gym_update-0.2.4-py3-none-any.whl
  • Upload date:
  • Size: 5.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.4.2 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.8.0 tqdm/4.30.0 CPython/3.8.10

File hashes

Hashes for gym_update-0.2.4-py3-none-any.whl
Algorithm Hash digest
SHA256 55c3c8c869028d3256ecc554ea95190c98826e0b8909bf7808410adf6b35c301
MD5 8594fb1ad912344d13117865c3367b86
BLAKE2b-256 e205d66f75a41f0e77fc7cf753c9e7c873cb63991906fed8101c9cee50473a19

See more details on using hashes here.

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