{"id":24483167,"url":"https://github.com/sukiboo/rl_personalization_challenge","last_synced_at":"2026-05-14T22:43:38.199Z","repository":{"id":128451933,"uuid":"459359557","full_name":"sukiboo/rl_personalization_challenge","owner":"sukiboo","description":"Challenge of solving a personalization task with RL methods.","archived":false,"fork":false,"pushed_at":"2022-03-26T23:51:10.000Z","size":17,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-21T12:35:53.647Z","etag":null,"topics":["contextual-bandits","openai-gym","personalization","reinforcement-learning","simulation"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sukiboo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-02-14T23:29:01.000Z","updated_at":"2023-12-10T19:16:36.000Z","dependencies_parsed_at":null,"dependency_job_id":"e056e65f-67e1-47b2-b06d-3252271f8033","html_url":"https://github.com/sukiboo/rl_personalization_challenge","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sukiboo%2Frl_personalization_challenge","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sukiboo%2Frl_personalization_challenge/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sukiboo%2Frl_personalization_challenge/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sukiboo%2Frl_personalization_challenge/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sukiboo","download_url":"https://codeload.github.com/sukiboo/rl_personalization_challenge/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243639406,"owners_count":20323505,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["contextual-bandits","openai-gym","personalization","reinforcement-learning","simulation"],"created_at":"2025-01-21T12:31:11.153Z","updated_at":"2025-10-29T01:32:43.937Z","avatar_url":"https://github.com/sukiboo.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Reinforcement Learning Personalization Challenge\nIn this challenge your goal is to train an RL agent to solve a personalization task that is simulated as a synthetic contextual bandit.\n\nIn the given environment the state space is continuous and is reperesented by a `100`-dimensional hypercube, and the action space is discrete and consists of `100` fixed `100`-dimensional vectors. The reward signal is a bit convoluted in its nature but it's intentionally made this way to mimic the human behavioral preferencing (*and we can discuss what it actually means or how it's designed in more detail*).\n\nThe rationale behind such an environment is the following: the set of available actions represents the *possible recommendations* and the observed states are the parameterized representations of the *persons* to whom the recommendations are provided; for each state-action pair the received reward value represents the *suitability* of the provided recommendation for the given person with `1` being the best recomendation and `-1` being the worst.\n\n## Setup\nInstall the dependancies with `pip install -r requirements.txt`, then run with `python main.py`.\n\n## Files\nEssentially this simple repository consists of the following files:\n* `environment.py` --- contains the class `SampleEnv` that creates an OpenAI Gym contextual bandit environment\n* `main.py` --- trains a policy gradient agent, serving as a basic baseline --- **modify this file to implement and train your agent**\n\n## Environment\nThe generated `SampleEnv` environment inherits from `gym.Env` and, as such, has the following methods:\n* `reset()` --- observe a new state\n* `step(action)` --- take an action and return the result\n\nThe above methods are technically sufficient to solve the environment.\nOther useful methods include\n* `evaluate_agent(agent)` --- compute the *deterministic* performance of the agent's policy on the environment\n* `restart()` --- fully recreate the environment; should be called between the training of different agents for reproducibility\n* `observe(num=1)` --- observe new states; identical to `reset` but can sample multiple states (`num`) simultaneously\n* `compute_reward(s,a_ind)` --- compute the *normalized* reward for a state `s` and an action index `a_ind`\n* `compute_reward_raw(s,a)` --- compute the *un-normalized* reward value of a state-action pair `(s,a)`\n* `print_action_histogram()` --- print the histogram of the optimal actions; ideally an agent should provide a similar histogram\n\n## Results\nBy default the reward values returned by the environment are *normalized*, i.e. the optimal reward for any state `s` is `1` and the average reward is `0`.\nHence any sensible agent should achieve a positive return and the optimal agent has the return of `1`.\nFor example, the current baseline agent achieves a performance score of `0.2318`.\n\nThe intended outcome is to train an agent that demonstrates a *good* performance, e.g. `\u003e 0.8` or so.\nIf you manage to obtain such an agent, please let me know!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsukiboo%2Frl_personalization_challenge","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsukiboo%2Frl_personalization_challenge","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsukiboo%2Frl_personalization_challenge/lists"}