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
ttrials - Pure exploitation: always pull one arm (optionally specify which)
- Reproducible: optional
seed - History: returns per-arm counts, rewards, and (arm, reward) history
Installation
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.")
Metadata
Release files for mab-lite-dhruv 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| mab_lite_dhruv-0.1.2.tar.gz | 2.9 kB | Without provenance | Details for mab_lite_dhruv-0.1.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| mab_lite_dhruv-0.1.2-py3-none-any.whl | Python 3 | none | any | Details for mab_lite_dhruv-0.1.2-py3-none-any.whl |
Total release size: 6.7 kB
Release files / mab_lite_dhruv-0.1.2.tar.gz
| Download URL | mab_lite_dhruv-0.1.2.tar.gz |
|---|---|
| Size | 2.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f3acfc685d40317aac96d501f7669ffd2ae8e0ad18ebd16fea8860d225b4acff
|
|
BLAKE2b-256 checksum How to use checksums |
51f2d624675bfa92c900c8e0fcb6446f245c3d30f8c8434ea2051ab0f984c793
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.5
|
Release files / mab_lite_dhruv-0.1.2-py3-none-any.whl
| Download URL | mab_lite_dhruv-0.1.2-py3-none-any.whl |
|---|---|
| Size | 3.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
fe249665d95389acb42fc86d26ab107610eb56915c2ff55a2cc1dd530aa383e9
|
|
BLAKE2b-256 checksum How to use checksums |
596d925f7cbbb818da467af1344e7f683aa71af3abdbae3de73e41aaed8eb0dc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.5
|
Security for mab-lite-dhruv 0.1.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.