Skip to content

Commit

Permalink
PR suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
adarmiento committed Nov 1, 2023
1 parent ce85426 commit 402ba3c
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions pybandits/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,9 @@ def _get_valid_actions(self, forbidden_actions: Optional[Set[ActionId]]) -> Set[
return valid_actions

def _check_update_params(
self,
actions: List[ActionId],
rewards: List[Union[NonNegativeInt, List[NonNegativeInt]]],
self,
actions: List[ActionId],
rewards: List[Union[NonNegativeInt, List[NonNegativeInt]]],
):
"""
Verify that the given list of action IDs is a subset of the currently defined actions.
Expand All @@ -152,11 +152,11 @@ def _check_update_params(
@abstractmethod
@validate_arguments
def update(
self,
actions: List[ActionId],
rewards: List[Union[BinaryReward, List[BinaryReward]]],
*args,
**kwargs,
self,
actions: List[ActionId],
rewards: List[Union[BinaryReward, List[BinaryReward]]],
*args,
**kwargs,
):
"""
Update the stochastic multi-armed bandit model.
Expand Down Expand Up @@ -190,14 +190,14 @@ def predict(self, forbidden_actions: Optional[Set[ActionId]] = None):

def get_state(self) -> (str, dict):
"""
Access the complete model internal state, enough to create an exact copy of the same model from it.
Returns
-------
model_class_name: str
The name of the class of the model.
model_state: dict
The internal state of the model (actions, scores, etc.).
"""
Access the complete model internal state, enough to create an exact copy of the same model from it.
Returns
-------
model_class_name: str
The name of the class of the model.
model_state: dict
The internal state of the model (actions, scores, etc.).
"""
model_name = self.__class__.__name__
state: dict = self.dict()
return model_name, state

0 comments on commit 402ba3c

Please sign in to comment.