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 Distribution

gym_update-0.2.6.tar.gz (5.1 kB view hashes)

Uploaded Source

Built Distribution

gym_update-0.2.6-py3-none-any.whl (5.9 kB view hashes)

Uploaded Python 3

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