A very simple Epsilon-Greedy Bandit RL example package
Project description
Simple RL Pack
A simple Python package demonstrating an Epsilon-Greedy Multi-Armed Bandit.
This package was created as an individual activity.
Usage
```python from simple_rl_pack import EpsilonGreedyBandit
Create a bandit with 3 arms
bandit = EpsilonGreedyBandit(num_arms=3, epsilon=0.1)
--- Simulate pulling arms ---
1. Select an action
action_to_pull = bandit.select_action()
2. Get a reward (in a real app, this comes from your environment)
Let's pretend arm 1 is the best
reward = 0.0 if action_to_pull == 1: reward = 1.0 elif action_to_pull == 2: reward = 0.5
3. Update the bandit's knowledge
bandit.update_value(action_to_pull, reward)
print(f"Pulled arm {action_to_pull}, received reward {reward}") print(f"Current best guess: Arm {bandit.get_best_arm()}") ```
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file simple_rl_pack_kritarth04-0.0.1.tar.gz.
File metadata
- Download URL: simple_rl_pack_kritarth04-0.0.1.tar.gz
- Upload date:
- Size: 2.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
86c0b4057187bfbebae427a43db6f5eff9ad52b5a1cb06108196eab479541e81
|
|
| MD5 |
8d4074853aefbfa1576a49de593ad64f
|
|
| BLAKE2b-256 |
193de6c876d4e1c6eaafece0f4c3df48b5d76211a292f873e33197b471ba3074
|
File details
Details for the file simple_rl_pack_kritarth04-0.0.1-py3-none-any.whl.
File metadata
- Download URL: simple_rl_pack_kritarth04-0.0.1-py3-none-any.whl
- Upload date:
- Size: 3.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f375d5c7f3bd3dd6e0bd04f294a57d0289ac62636a52f85e11e3eedc26184963
|
|
| MD5 |
13be0b6723fb30443f5ae8a551c0542b
|
|
| BLAKE2b-256 |
73a97a0bea830df6d0e35b6b2b07ccb42522be7e464ec25dff62470139ab4c43
|