# mab-lite-dhruv
Minimal multi-armed bandit helpers for **pure exploration** and **pure exploitation**.
Perfect for teaching, quick baselines, and sanity checks.
---
## Features
- **Pure exploration**: uniform random arm pulls for `t` trials
- **Pure exploitation**: always pull one arm (optionally specify which)
- **Reproducible**: optional `seed`
- **History**: returns per-arm counts, rewards, and (arm, reward) history
---
## Installation
```bash
pip install mab-lite-dhruv
## Test the installation
After installing, you can quickly verify the package works:
```python
# test_mab.py
from mab_lite_dhruv import pure_exploration, pure_exploitation
import numpy as np
n, t = 5, 20
true_probabilities = np.random.rand(n).tolist()
print("True probabilities:", true_probabilities)
# Pure exploration
pe_counts, pe_rewards, pe_history = pure_exploration(n, t, true_probabilities, seed=42)
print("\n--- Pure Exploration ---")
print("Arm counts:", dict(pe_counts))
print("Arm rewards:", dict(pe_rewards))
print("History sample:", pe_history[:5])
# Pure exploitation
px_counts, px_rewards, px_history = pure_exploitation(n, t, true_probabilities, seed=42)
print("\n--- Pure Exploitation ---")
print("Arm counts:", dict(px_counts))
print("Arm rewards:", dict(px_rewards))
print("History sample:", px_history[:5])
print("\n✅ Tests finished successfully.")
Raw data
{
"_id": null,
"home_page": null,
"name": "mab-lite-dhruv",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": "bandit, exploitation, exploration, multi-armed-bandit, reinforcement-learning",
"author": "Dhruv Pithadia",
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/51/f2/d624675bfa92c900c8e0fcb6446f245c3d30f8c8434ea2051ab0f984c793/mab_lite_dhruv-0.1.2.tar.gz",
"platform": null,
"description": "# mab-lite-dhruv\n\nMinimal multi-armed bandit helpers for **pure exploration** and **pure exploitation**. \nPerfect for teaching, quick baselines, and sanity checks.\n\n---\n\n## Features\n- **Pure exploration**: uniform random arm pulls for `t` trials \n- **Pure exploitation**: always pull one arm (optionally specify which) \n- **Reproducible**: optional `seed` \n- **History**: returns per-arm counts, rewards, and (arm, reward) history\n\n---\n\n## Installation\n```bash\npip install mab-lite-dhruv\n\n## Test the installation\n\nAfter installing, you can quickly verify the package works:\n\n```python\n# test_mab.py\nfrom mab_lite_dhruv import pure_exploration, pure_exploitation\nimport numpy as np\n\nn, t = 5, 20\ntrue_probabilities = np.random.rand(n).tolist()\nprint(\"True probabilities:\", true_probabilities)\n\n# Pure exploration\npe_counts, pe_rewards, pe_history = pure_exploration(n, t, true_probabilities, seed=42)\nprint(\"\\n--- Pure Exploration ---\")\nprint(\"Arm counts:\", dict(pe_counts))\nprint(\"Arm rewards:\", dict(pe_rewards))\nprint(\"History sample:\", pe_history[:5])\n\n# Pure exploitation\npx_counts, px_rewards, px_history = pure_exploitation(n, t, true_probabilities, seed=42)\nprint(\"\\n--- Pure Exploitation ---\")\nprint(\"Arm counts:\", dict(px_counts))\nprint(\"Arm rewards:\", dict(px_rewards))\nprint(\"History sample:\", px_history[:5])\n\nprint(\"\\n\u2705 Tests finished successfully.\")",
"bugtrack_url": null,
"license": "MIT",
"summary": "Minimal multi-armed bandit helpers: pure exploration & pure exploitation.",
"version": "0.1.2",
"project_urls": {
"Homepage": "https://github.com/dhruvpithadia/mab-lite-dhruv",
"Issues": "https://github.com/dhruvpithadia/mab-lite-dhruv/issues"
},
"split_keywords": [
"bandit",
" exploitation",
" exploration",
" multi-armed-bandit",
" reinforcement-learning"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "596d925f7cbbb818da467af1344e7f683aa71af3abdbae3de73e41aaed8eb0dc",
"md5": "0784a4916e928b31f2cb327e85720787",
"sha256": "fe249665d95389acb42fc86d26ab107610eb56915c2ff55a2cc1dd530aa383e9"
},
"downloads": -1,
"filename": "mab_lite_dhruv-0.1.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "0784a4916e928b31f2cb327e85720787",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 3809,
"upload_time": "2025-08-11T03:20:47",
"upload_time_iso_8601": "2025-08-11T03:20:47.480711Z",
"url": "https://files.pythonhosted.org/packages/59/6d/925f7cbbb818da467af1344e7f683aa71af3abdbae3de73e41aaed8eb0dc/mab_lite_dhruv-0.1.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "51f2d624675bfa92c900c8e0fcb6446f245c3d30f8c8434ea2051ab0f984c793",
"md5": "9ef4ce2c110196e8ad43cb53a634fe6a",
"sha256": "f3acfc685d40317aac96d501f7669ffd2ae8e0ad18ebd16fea8860d225b4acff"
},
"downloads": -1,
"filename": "mab_lite_dhruv-0.1.2.tar.gz",
"has_sig": false,
"md5_digest": "9ef4ce2c110196e8ad43cb53a634fe6a",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 2869,
"upload_time": "2025-08-11T03:20:48",
"upload_time_iso_8601": "2025-08-11T03:20:48.469848Z",
"url": "https://files.pythonhosted.org/packages/51/f2/d624675bfa92c900c8e0fcb6446f245c3d30f8c8434ea2051ab0f984c793/mab_lite_dhruv-0.1.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-08-11 03:20:48",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "dhruvpithadia",
"github_project": "mab-lite-dhruv",
"github_not_found": true,
"lcname": "mab-lite-dhruv"
}