Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Save the state of Contextual MAB #85

Closed
maypink opened this issue Aug 22, 2023 · 3 comments
Closed

Save the state of Contextual MAB #85

maypink opened this issue Aug 22, 2023 · 3 comments

Comments

@maypink
Copy link

maypink commented Aug 22, 2023

Hi!

We're using your implementation of MAB in our project and it's a great pleasure! However, I'd like to ask: is there a possibility to save the current state of MAB at any time? For example, it would be useful to plot actions probabilities for different contexts throughout the evolution process in our case.

Thank you in advance!

@bkleyn
Copy link
Contributor

bkleyn commented Aug 24, 2023

Hey @maypink, thank you for the kind feedback. Remember to ⭐️ the library if you like it.

Based on the information you provided, one option might be to use the predict_expectation() method to store the predicted expectations for each arm at different points in time.

Alternatively, if you don't know exactly what information you need, you could serialize the MAB object by using the Python pickle library and save this for later use.

Hope this helps!

@maypink
Copy link
Author

maypink commented Sep 11, 2023

Thank you for reply!

I forgot to clarify that I want to save Contextual bandits, so it's improtant to save the whole object as it is. [predict_expectation()](https://fidelity.github.io/mabwiser/api.html#mabwiser.mab.MAB.predict_expectations) is not enough for me in that case. Also, saving with json is much faster and compact than with pickle, so is it possible that save and load methods will be implemented in mabwiser?

@bkleyn
Copy link
Contributor

bkleyn commented Oct 9, 2023

Hey @maypink

We currently don't have plans to implement dedicated save and load methods. As mentioned in the previous comment using pickle (or similar) to serialize the MAB object itself would be our suggested approach as this ensures all the variables corresponding to the bandit state is captured.

@bkleyn bkleyn closed this as completed Oct 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants