class Simulator(config: Config, mode: str)

Bases: object

Custom Environment that follows gym interface

get_user_data(user_idx: int) Tuple[int, numpy.typing.NDArray, numpy.typing.NDArray]

Get user data by user index

Parameters:

user_idx – (int) index of user

Returns:

(Tuple[int, NDArray, NDArray]) User ID, Array with items, Array with Rates

step(user_id: int, recommended_item_id: int) int

Executes a step in the environment by applying an action. Returns the new observation and reward.

Parameters:
  • user_id – Current agent (user)

  • recommended_item_id – Action (selected item)

Returns:

reward (0 if not interaction, attribute otherwise)