scope_rl.utils.MultipleInputDict#

class scope_rl.utils.MultipleInputDict(action_type, path, save_relative_path=False)[source]#

This class contains paths to multiple input dictionaries for OPE and returns input_dict.

Parameters:
  • action_type ({"discrete", "continuous"}) – Type of the action space.

  • path (str) – Path to the directory. Either absolute or relative path is acceptable.

  • save_relative_path (bool, default=False.) –

    Whether to save a relative path. If True, a path relative to the scope-rl directory will be saved. If False, the absolute path will be saved.

    Note that this option was added in order to run examples in the documentation properly. Otherwise, the default setting (False) is recommended.

Attributes:
behavior_policy_names
n_datasets
n_eval_policies

Check the number of evaluation policies of each input dict.

use_same_eval_policy_across_dataset

Check if the contained logged datasets use the same evaluation policies.

Methods

add(input_dict, behavior_policy_name, dataset_id)

Save input_dict.

get(behavior_policy_name, dataset_id)

Load input_dict.

add(input_dict, behavior_policy_name, dataset_id)[source]#

Save input_dict.

Parameters:
  • input_dict (OPEInputDict.) – Input dictionary for OPE to save.

  • behavior_policy_name (str) – Name of the behavior policy that generated the logged dataset.

  • dataset_id (int) – Id of the logged dataset.

get(behavior_policy_name, dataset_id)[source]#

Load input_dict.

Parameters:
  • behavior_policy_name (str) – Name of the behavior policy that generated the logged dataset.

  • dataset_id (int) – Id of the logged dataset.

Returns:

input_dict – Input dictionary for OPE.

Return type:

OPEInputDict.

property use_same_eval_policy_across_dataset#

Check if the contained logged datasets use the same evaluation policies.

property n_eval_policies#

Check the number of evaluation policies of each input dict.

Methods