Skip to main content

An OpenAI Gym for Display Advertisment Reinforcement Learning

Project description

gym-display-advertising

An OpenAI Gym for Display Advertisment Reinforcement Learning

Installation

pip install gym-display-advertising

Usage

import gym_display_advertising

env = gym.make("StaticDisplayAdvertising-v0")
episode_over = False
while not episode_over:
    state, reward, episode_over, _ = env.step(env.action_space.sample())
    print(state, reward)
import gym_display_advertising

env = gym.make("DisplayAdvertising-v0")
episode_over = False
while not episode_over:
    state, reward, episode_over, _ = env.step(env.action_space.sample())
    print(state, reward)

Real Ad Bidding Data

The repository contains real-life bidding data from a single merchant and loads this by default. If you want to load more data follow the instructions in the make-ipinyou-data repository to create the data.

Then use the helper class ProcessedIPinYouData to load the data and pass the dataframe into the gym.make command.

import pathlib
import gym
import gym_display_advertising

ipinyou = gym_display_advertising.data.ProcessedIPinYouData(directory=pathlib.Path("path/to/file"))
training_data, _ = ipinyou.get_merchant_data(2997)
env = gym.make("DisplayAdvertising-v0", data=training_data)
state, reward, _, _ = env.step(env.action_space.sample())
print(state, reward)

Acknowledgements

This is a project by Winder Research, a Cloud-Native Data Science consultancy.

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_display_advertising-0.0.1.tar.gz (78.7 kB view details)

Uploaded Source

Built Distribution

gym_display_advertising-0.0.1-py3-none-any.whl (8.3 kB view details)

Uploaded Python 3

File details

Details for the file gym_display_advertising-0.0.1.tar.gz.

File metadata

  • Download URL: gym_display_advertising-0.0.1.tar.gz
  • Upload date:
  • Size: 78.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.4

File hashes

Hashes for gym_display_advertising-0.0.1.tar.gz
Algorithm Hash digest
SHA256 2210d234c80ae914442a14d092cb2b4fdc7009b9236be68a5929781747460fcc
MD5 495963546bb83a63315488f73562d038
BLAKE2b-256 42c3bf5f31aae4eea0e38b8ae2c6b0128c3f00306f88145f7e4c8c20d7e33fd2

See more details on using hashes here.

File details

Details for the file gym_display_advertising-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: gym_display_advertising-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 8.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.4

File hashes

Hashes for gym_display_advertising-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 dd703412daf918d5f7d2f637b9a5f666f96fdbb2e9a346f086eff2d55139682d
MD5 114b5acd508bf9845d7de0d686c6d0b3
BLAKE2b-256 039b921afb089808b6486686c922a9d578980dd2b691cd010cca89791560b080

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