-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor MAB and Strategy Classes with Cold Start Methods and Enhance…
…d Validation Change log: 1. Moved Strategy, Model, and MAB to strategy.py, model.py, and to the new mab.py. base.py is now only for definitions and abstract PyBanditsBaseModel. 2. Introduced TailoredBaseMab as a child of BaseMab. The new abstract MAB should hold any common functionality for all MABs that are tailored for a specific strategy. Consequently, all MABs except for BaseMab are now inheriting from the new class. 3. The from_state functionality is now directly inherited by all MABs from BaseMab. 4. Replaced all cold_start methods in cmab.py and smab.py with cold_start_instantiate stemming from TailoredBaseMab. Correspondingly, updated test cases to use the new cold_start_instantiate methods. 5. Introduced numerize_field and get_expected_value_from_state methods in the Strategy class to handle default values and state extraction. Added field_validator for exploit_p in BestActionIdentification and subsidy_factor in CostControlBandit to ensure proper default handling and validation. 6. Merged common functionality into a new CostControlStrategy abstract class, which is now inherited by CostControlBandit and MultiObjectiveCostControlBandit. Simplified the select_action methods by using helper methods like _evaluate_and_select and _reduce. 7. Plugged get_pareto_front into a new MultiObjectiveStrategy abstract class, which is now inherited by MultiObjectiveBandit and MultiObjectiveCostControlBandit. 8. In model.py. Removed the redundant BaseBetaMO and BaseBayesianLogisticRegression. Added cold_start_instantiate method to BetaMO and BayesianLogisticRegression models. 9. Added extract_argument_names_from_function under utils.py to allow extract function parameter names by handle. 10. Changed tes_base.py into test_mab.py. 11. Updated deprecated linter settings in pyproject.toml. 12. Added test_smab_mo_cc_update test on test_smab.py.
- Loading branch information
1 parent
95122f4
commit 0748967
Showing
15 changed files
with
810 additions
and
1,098 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.