MAB Simulator is a Python package that provides a framework for simulating and comparing multi-armed bandit algorithms.
@WARNING: This is current work, so that I will update it frequently.
- Notes:
- Case Study:
You can install the MAB Simulator package using Poetry, a dependency management and packaging tool for Python.
# Clone the repository
git clone https://github.com/JordiMateoUdL/MAB.git
# Navigate to the project directory
cd MAB
# Install the dependencies
poetry install
To use the MAB Simulator package, you need to follow these steps:
- Create instances of the bandit arms that represent your problem.
- Create a Bandit object and pass the list of arms to it.
- Create instances of different solvers, such as EpsilonGreedySolver, UCB1Solver, or ThomsonSamplingSolver, and pass the Bandit object to them. Also, you can extend the Solver class to compare other solvers or strategies.
- Create a Simulator object and pass the Bandit object and the solvers list to it.
- Analyze and visualize the results using the available plotting functions.
See main.py
and case_study/slot_machine.py
for a basic usage example.
We welcome contributions to the MAB Simulator package! If you would like to contribute, please follow these steps:
- Fork the repository and clone it locally.
- Create a new branch for your feature or bug fix:
- Make your changes, ensuring that your code follows the project's coding conventions and standards.
- Write tests to cover your changes and ensure that existing tests pass:
- Commit your changes with a descriptive commit message.
- Push your branch to your forked repository:
- Open a Pull Request (PR) against the
main
branch of this repository. Provide a clear and detailed description of your changes in the PR, and reference any related issues or discussions.
Once your PR is submitted, it will be reviewed by the project maintainers. They may provide feedback or request further changes. Once the changes are approved, your code will be merged into the main
branch.