fidelity / mabwiser

[IJAIT 2021] MABWiser: Contextual Multi-Armed Bandits Library
https://fidelity.github.io/mabwiser/
Apache License 2.0
213 stars 42 forks source link

Fix double warm start issue #63

Closed dorukkilitcioglu closed 1 year ago

dorukkilitcioglu commented 1 year ago

This PR fixes the double warm start issue, wherein an arm that was previously warm started, but not trained, could be warm started again by a different arm. With this fix, once an arm is warm started, it is permanent, it will not be warm started again. All arms that were warm started but not trained are now included in the mab._imp.cold_arm_to_warm_arm object. If or when a warm started arm gets partial fit, it will then be considered a "trained" arm.

The neighborhood policies work slightly differently: if warm start is enabled, they fit and warm_start during the predict step. Since they are always trained from scratch during the predict step this logic does not apply to them.

@bkleyn Let me know if you have any input. If all looks good, I'll push another commit just to bump the version/docs and merge. Given this changes how warm start works I'd bump the version to 2.5.0.