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 hashes)

Uploaded Source

Built Distribution

gym_display_advertising-0.0.1-py3-none-any.whl (8.3 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