Skip to content

Commit

Permalink
Add offline policy evaluation module and update dependencies
Browse files Browse the repository at this point in the history
 ### Changes
 * Introduced `offline_policy_evaluator.py` with classes for propensity score estimation and offline policy evaluation.
 * Updated `pyproject.toml` to include new dependencies: `bokeh`, `obp` and `optuna`. Further adjusted existing dependencies to compatible versions.
 * Added class method to PyBanditsBaseModel on base.py to allow seeing default values for arguments that were not passed to the model.
 * Added test_offline_policy_evaluator.py as a test suite for the OfflinePolicyEvaluator.
 * Added `visualize_via_bokeh` and `in_jupyter_notebook` utility functions.
  • Loading branch information
shaharbar1 authored and Shahar-Bar committed Sep 15, 2024
1 parent 70dde37 commit d5118c3
Show file tree
Hide file tree
Showing 5 changed files with 1,442 additions and 6 deletions.
4 changes: 4 additions & 0 deletions pybandits/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ class PyBanditsBaseModel(BaseModel, extra="forbid"):
BaseModel of the PyBandits library.
"""

@classmethod
def _get_value(cls, key: str, values: Dict[str, Any]) -> Any:
return values.get(key, cls.model_fields[key].default)


class Model(PyBanditsBaseModel, ABC):
"""
Expand Down
Loading

0 comments on commit d5118c3

Please sign in to comment.